summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
AgeCommit message (Collapse)Author
2015-07-29ALSA: hda - Fix race between PM ops and HDA init/probeU. Artie Eoff
PM ops could be triggered before HDA is done initializing and cause PM to set HDA controller to D3Hot. This can result in "CORB reset timeout#2, CORBRP = 65535" and "no codecs initialized". Additionally, PM ops can be triggered before azx_probe_continue finishes (async probe). This can result in a NULL deref kernel crash. To fix this, avoid PM ops if !chip->running. Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-24Merge tag 'asoc-fix-v4.2-rc3' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v4.2 A lot of small fixes here, a few to the core: - Fix for binding DAPM stream widgets on devices with prefixes assigned to them - Minor fixes for the newly added topology interfaces - Locking and memory leak fixes for DAPM - Driver specific fixes
2015-07-20ALSA: hda: add new AMD PCI IDs with proper driver capsMaruthi Srinivas Bayyavarapu
Fixes audio problems on newer asics Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-20ALSA: hda - Fix Skylake codec timeoutDavid Henningsson
When the controller is powered up but the HDMI codec is powered down on Skylake, the power well is turned off. When the codec is then powered up again, we need to poke the codec a little extra to make sure it wakes up. Otherwise we'll get sad "no response from codec" messages and broken audio. This also changes azx_runtime_resume to actually call snd_hdac_set_codec_wakeup for Skylake (before STATETS read). (Otherwise it would only have been called for Haswell and Broadwell, which both do not need it, so this probably was not the author's intention.) Signed-off-by: David Henningsson <david.henningsson@canonical.com> Reviewed-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-01Merge tag 'sound-fix-4.2-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Here are a bunch of small fixes, mostly for HD-audio quirks, in addition to a few regression fixes and trivial cleanups" * tag 'sound-fix-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: Fix uninintialized error return ALSA: hda: Delete an unnecessary check before the function call "snd_info_free_entry" ALSA: hda - Add a fixup for Dell E7450 ALSA: hda - Fix the dock headphone output on Fujitsu Lifebook E780 ALSA: hda - Add headset support to Acer Aspire V5 ALSA: hda - restore the MIC FIXUP for some Dell machines ALSA: jack: Fix endless loop at unique index detection ALSA: hda - set proper caps for newer AMD hda audio in KB/KV ALSA: hda - Disable widget power-save for VIA codecs ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out
2015-07-01Merge tag 'modules-next-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull module updates from Rusty Russell: "Main excitement here is Peter Zijlstra's lockless rbtree optimization to speed module address lookup. He found some abusers of the module lock doing that too. A little bit of parameter work here too; including Dan Streetman's breaking up the big param mutex so writing a parameter can load another module (yeah, really). Unfortunately that broke the usual suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were appended too" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits) modules: only use mod->param_lock if CONFIG_MODULES param: fix module param locks when !CONFIG_SYSFS. rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() module: add per-module param_lock module: make perm const params: suppress unused variable error, warn once just in case code changes. modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'. kernel/module.c: avoid ifdefs for sig_enforce declaration kernel/workqueue.c: remove ifdefs over wq_power_efficient kernel/params.c: export param_ops_bool_enable_only kernel/params.c: generalize bool_enable_only kernel/module.c: use generic module param operaters for sig_enforce kernel/params: constify struct kernel_param_ops uses sysfs: tightened sysfs permission checks module: Rework module_addr_{min,max} module: Use __module_address() for module_address_lookup() module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING module: Optimize __module_address() using a latched RB-tree rbtree: Implement generic latch_tree seqlock: Introduce raw_read_seqcount_latch() ...
2015-06-25ALSA: hda - set proper caps for newer AMD hda audio in KB/KVAlex Deucher
Fixes audio problems on newer asics. Noticed by: Kelly Anderson <kelly@xilka.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-12Merge branch 'for-linus' into for-nextTakashi Iwai
Yet another non-trivial conflicts resolution for the recent HD-audio fix. Conflicts: sound/pci/hda/hda_intel.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-12ALSA: hda - Abort the probe without i915 binding for HSW/BDWTakashi Iwai
The previous patch tried to continue the probe if i915 binding fails. For for simplicity reason, we haven't implemented abort even for controller chips that are dedicated for HDMI/DP on HSW and BDW. However, Mengdong suggested that this can be dangerous; BIOS may disable gfx power well although the PCI entry for HD-audio is left, and this may result in the unexpected behavior, kernel errors, etc. For avoiding this situation, abort the probe at i915 binding failure only for HSW/BDW chips selectively. For other chips, it still continues. Fixes: bf06848bdbe5 ('ALSA: hda - Continue probing even if i915 binding fails') Reported-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-11Merge branch 'for-linus' into for-nextTakashi Iwai
This merges and resolves the non-trivial conflicts with the recent fix for hda-i915 binding fallback. Conflicts: sound/pci/hda/hda_intel.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-11ALSA: hda - Continue probing even if i915 binding failsTakashi Iwai
Currently snd-hda-intel driver aborts the probing of Intel HD-audio controller with i915 power well management when binding with i915 driver via hda_i915_init() fails. This is no big problem for Haswell and Broadwell where the HD-audio controllers are dedicated to HDMI/DP, thus i915 link is mandatory. However, Skylake, Baytrail and Braswell have only one controller and both HDMI/DP and analog codecs share the same bus. Thus, even if HDMI/DP isn't usable, we should keep the controller working for other codecs. For fixing this, this patch simply allows continuing the probing even if hda_i915_init() call fails. This may leave stale sound components for HDMI/DP devices that are unbound with graphics. We could abort the probing selectively, but from the code simplicity POV, it's better to continue in all cases. Reported-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-03ALSA: hda - remove controller dependency on i915 power well for SKLLibin Yang
For SKL, only the HDMI codec is in the display power well while the HD-A controller isn't. So the controller flag 'need_i915_power' is not set to release the display power after probe, and the codec flag 'link_power_control' is set to request/release the display power via bus link_power ops. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-29Merge branch 'for-linus' into for-nextTakashi Iwai
Merge back the latest HD-audio stuff for further development.
2015-05-28kernel/params: constify struct kernel_param_ops usesLuis R. Rodriguez
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-27ALSA: hda - Fix noise on AMD radeon 290x controllerTakashi Iwai
A new AMD controller [1002:aac8] seems to need the quirk for other AMD NS HDMI stuff, otherwise it gives noisy sounds. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=99021 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-20ALSA: hda - Move hda_i915.c from sound/pci/hda to sound/hdaMengdong Lin
The file is moved to hda core and renamed to hdac_i915.c, so can be used by both legacy HDA driver and new Skylake audio driver. - Add snd_hdac_ prefix to the public APIs. - The i915 audio component is moved to core bus and dynamically allocated. - A static pointer hdac_acomp is used to help bind/unbind callbacks to get this component, because the sound card's private_data is used by the azx chip pointer, which is a legacy structure. It could be removed if private _data changes to some core structure which can be extended to find the bus. - snd_hdac_get_display_clk() is added to get the display core clock for HSW/BDW. - haswell_set_bclk() is moved to hda_intel.c because it needs to write the controller registers EM4/EM5, and only legacy HD-A needs it for HSW/BDW. - Move definition of HSW/BDW-specific registers EM4/EM5 to hda_register.h and rename them to HSW_EM4/HSW_EM5, because other HD-A controllers have different layout for the extended mode registers. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-18ALSA: hda - add hda_intel_trace.hLibin Yang
This patch creates hda_intel_trace.h to add some pm trace functions used in hda_intel.c Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-05ALSA: hda - reset display codec when power onLu, Han
In SKL, HDMI/DP codec and PCH HD Audio Controller are in different power wells, so it's necessary to reset display audio codecs when power well on, otherwise display audio codecs will disappear when resume from low power state. Reset steps when power on: enable codec wakeup -> azx_init_chip() -> disable codec wakeup The callback for codec wakeup enable/disable is in drivers/gpu/drm/i915/. Signed-off-by: Lu, Han <han.lu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-30Merge branch 'topic/hda' into for-nextTakashi Iwai
2015-04-30ALSA: hda - Reduce ifdef CONFIG_SND_HDA_I915Takashi Iwai
We're providing dummy functions for CONFIG_SND_HDA_i915=n, thus ifdef can be reduced. (But hda_i915_init() has to be fixed to return zero.) This automatically fixes a compile warning: sound/pci/hda/hda_intel.c: In function 'azx_probe_continue': sound/pci/hda/hda_intel.c:1966:1: warning: label 'i915_power_fail' defined but not used [-Wunused-label] Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-29Merge branch 'topic/hda' into for-nextTakashi Iwai
2015-04-29ALSA: hda - remove controller dependency on i915 power well for ↵Mengdong Lin
Baytrail/Braswell For Baytrail (Valleyview) and Braswell (Cherryview), only the HDMI codec is in the display power well while the HD-A controller isn't. So the controller flag 'need_i915_power' is not set to release the display power after probe, and the codec flag 'link_power_control" is set to request/release the display power via bus link_power ops. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-29ALSA: hda - divide controller and codec dependency on i915 gfx power wellMengdong Lin
This patch can improve power saving for Intel platforms on which only the display audio codec is in the shared i915 power well: - Add a flag "need_i915_power" to indicate whether the controller needs the i915 power well. - The driver will always request the i915 power when probing the controller and codecs if AZX_DCAPS_I915_POWERWELL is set (either the controller or a codec needs this power). - If the controller needs the i915 power, the power will be held after probe until the controller is runtime suspended or S3. If the controller doesn't need the power, the power will be released the after probe, and a codec that needs the power can request/release the power via bus link_power ops. Background: - For Haswell/Broadwell, which has a separate HD-A controller for display audio, both the controller and the display codec are in the i915 power well. - For Baytrail/Braswell, the display and analog audio share the same HDA controller and link, and only the display codec is in the i915 power well. - For Skylake, the display and analog audio share the same HDA controller but use separate links. Only the display codec is in the i915 power well. And in legacy mode we take the two links as one. So it can follow Baytrail/Braswell. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-29ALSA: hda - implement link_power ops for i915 display power controlMengdong Lin
This patch implements the bus link_power ops to request/release i915 display power well. It can be used by the display codec which shares this power well with GPU on Intel platforms. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-27Merge branch 'for-4.2' into for-nextTakashi Iwai
2015-04-27Merge branch 'topic/hda' into for-4.2Takashi Iwai
2015-04-21ALSA: hda - add AZX_DCAPS_I915_POWERWELL to BaytrailMengdong Lin
This patch addes AZX_DCAPS_I915_POWERWELL to BYT (Baytrail). Like Braswell and Skylake, the HDMI codec on Bytrail is also in the shared power well with GPU. This power well must be turned on before we reset link to probe the codec, to avoid communication failure with the codec. The side effect is that this power is always ON in S0 because the BYT HDMI codec does not support EPSS or D3ClkStop and so the controller doesn't enter D3 at runtime, and the HDMI codec and analog codec share a single physical HD-A link and so we cannot reset the HD-A link freely when we re-enable the power to use the HDMI codec. Next step is to test if an AGP reset or double AGP reset on BYT HDMI codec is okay to bring the HDMI codec back to a functional state after restoring the power. If okay, we can bind the power on/off with the HDMI codec PM without interrupting the analog audio. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: remove deprecated use of pci apiQuentin Lambert
Replace occurences of the pci api by appropriate call to the dma api. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @bad1@ idexpression id; position deprecated.p; @@ ...when != &id->dev when != pci_get_drvdata ( id ) when != pci_enable_device ( id ) ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @depends on !bad1@ idexpression id; expression direction; position deprecated.p; @@ ( - pci_dma_supported@p ( id, + dma_supported ( &id->dev, ... + , GFP_ATOMIC ) | - pci_alloc_consistent@p ( id, + dma_alloc_coherent ( &id->dev, ... + , GFP_ATOMIC ) ) Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Drop azx_sd_read*/write*() macrosTakashi Iwai
They are no longer used (only one place which can be replaced with a proper helper function). Let's drop. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Minor refactoringTakashi Iwai
Move the small portion of the common sequence in hda_intel.c and hda_tegra.c into hda_controller.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Embed bus into controller objectTakashi Iwai
... and replace with the existing hda-core helper codes. This reduces lots of lines, finally. Since struct hda_bus is now embedded into struct azx, snd_hda_bus_new() is moved and expanded from hda_codec.c to hda_controller.c, accordingly. Also private_free bus ops and private_data field are removed because we no longer need to point azx object from bus (we can use container_of()) The spin locks are consolidated into the single one, bus->reg_lock. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Migrate more hdac_stream codesTakashi Iwai
... including dsp loader helpers. Lots of codes removed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Migrate hdac_stream into legacy driverTakashi Iwai
Embed hdac_stream object into azx_dev, and use a few basic helper functions. The most of helper codes for hdac_stream aren't still used yet. Also this commit disables the tracepoints temporarily due to build problems. It'll be enabled again later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16ALSA: hda - Pass bus io_ops directly from the top-level driverTakashi Iwai
One less redirection again. This also requires the change of the call order in the toplevel divers. Namely, the bus has to be created at first before other initializations since the memory allocation ops are called through bus object now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-08Merge branch 'for-linus' into for-nextTakashi Iwai
Back merge HD-audio quirks to for-next branch, so that we can apply a couple of more quirks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-07ALSA: hda_intel: add AZX_DCAPS_I915_POWERWELL for SKL and BSWLibin Yang
HDMI/DP codec on SKL/BSW is in the power well. The power well must be turned on before probing the HDMI/DP codec. This is a temporary patch, which will power on the powerwell by adding AZX_DCAPS_I915_POWERWELL for SKL and BSW. After restructuring and new flag is added, this patch will be reverted. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-26ALSA: hda_intel: apply the Seperate stream_tag for Sunrise PointLibin Yang
The total stream number of Sunrise Point's input and output stream exceeds 15, which will cause some streams do not work because of the overflow on SDxCTL.STRM field if using the legacy stream tag allocation method. This patch uses the new stream tag allocation method by add the flag AZX_DCAPS_SEPARATE_STREAM_TAG for Skylake platform. Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-23ALSA: hda - Move some codes up to hdac_bus structTakashi Iwai
A few basic codes for communicating over HD-audio bus are moved to struct hdac_bus now. It has only command and get_response ops in addition to the unsolicited event handling. Note that the codec-side tracing support is disabled temporarily during this transition due to the code shuffling. It will be re-enabled later once when all pieces are settled down. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-16Merge branch 'topic/hda-unbind' into for-nextTakashi Iwai
2015-03-16Merge branch 'topic/hda-bus' into for-nextTakashi Iwai
2015-03-13ALSA: hda - Use shutdown driver ops instead of reboot notifierTakashi Iwai
The driver shutdown ops is simpler than registering reboot notifier manually. There should be no functional change by this -- the codec driver calls its own callback while the bus driver just calls azx_stop() like before. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-06Merge tag 'asoc-v4.1' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Changes for v4.1 A selection of changes for v4.1 so far. The main things are: - Move of jack registration to the card where it belongs. - Support for DAPM routes specified by both the machine driver and DT.
2015-03-03ALSA: hda - Use standard workqueue for unsol and jack eventsTakashi Iwai
The events that are handled by HD-audio drivers are no frequent and urgent ones, so we can use the standard workqueue without any problem nowadays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-03ALSA: hda - Build PCMs and controls at codec driver probeTakashi Iwai
This makes the code flow easier -- instead of the controller driver calling snd_hda_build_pcms() and snd_hda_build_controls() explicitly, the codec driver itself builds PCMs and controls at probe time. Then the controller driver only needs to call snd_card_register(). Also, this allows us the full bind/unbind control, too. Even when a codec driver is bound later, it automatically registers the new PCM and controls by itself. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-03-03ALSA: hda - Remove superfluous memory allocation error messagesTakashi Iwai
The memory allocators should have already given the kernel warning messages, thus we don't have to annoy again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-26ALSA: hda - Power down codec automatically at registrationTakashi Iwai
So far, we let the controller driver power down the all codecs at the end of probe. But this can be done better in the codec's dev_register callback. This results in the reduction of duplicated codes in each control driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-26ALSA: hda - Replace bus pm_notify with the standard runtime PM frameworkTakashi Iwai
Now the final bit of runtime PM cleanup: instead of manual notification of the power up/down of the codec via hda_bus pm_notify ops, use the standard runtime PM feature. The child codec device will kick off the runtime PM of the parent (PCI) device upon suspend/resume automatically. For managing whether the link can be really turned off, we use the bit flags bus->codec_powered instead of the earlier bus->power_keep_link_on. flag. Each codec driver is responsible to set/clear the bit flag, and the controller device can be turned off only when all these bits are cleared. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-26ALSA: hda - Drop power_save value indirection in hda_busTakashi Iwai
We used to pass the power_save option value to hda_bus via a given pointer. This was needed to refer to the value from the HD-audio core side. However, after the transition to the runtime PM, this is no longer needed. This patch drops the power_save value indirection in hda_bus above, and let the controller driver reprograms the autosuspend value explicitly by a new helper, snd_hda_set_power_save(). Without this call, the HD-audio core doesn't set up the autosuspend and flip the runtime PM. (User may still be able to set up via sysfs, though.) Along with this change, the pointer argument of azx_bus_create() is dropped as well. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-25ALSA: hda - Disable runtime PM for Panther Point againTakashi Iwai
This is essentially a partial revert of the commit [b1920c21102a: 'ALSA: hda - Enable runtime PM on Panther Point']. There was a bug report showing the HD-audio bus hang during runtime PM on HP Spectre XT. Reported-by: Dang Sananikone <dang.sananikone@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-23ALSA: hda - Use standard runtime PM for codec power-save controlTakashi Iwai
Like the previous transition of suspend/resume, now move the power-save code to the standard runtime PM. As usual for runtime PM, it's a bit tricky, but this simplified codes a lot in the end. For keeping the usage compatibility, power_save module option still controls the whole power-saving behavior on all codecs. The value is translated to pm_runtime_*_autosuspend() and pm_runtime_allow() / pm_runtime_forbid() calls. snd_hda_power_up() and snd_hda_power_down() are translated to pm_runtime_get_sync() and pm_runtime_put_autosuspend(), respectively. Since we can do call pm_runtime_get_sync() more reliably, the sync version is used always and snd_hda_power_up_d3wait() is dropped. Another slight difference is that snd_hda_power_up()/down() don't call runtime_pm code during the suspend/resume transition phase. Calling them there isn't safe unlike our own code, resulted in unexpected behavior (endless wakeups). The hda_power_count tracepoint was removed, as it doesn't match well with the new code. Last but not least, we need to set ignore_children flag in the parent dev.power field so that the runtime PM of the controller chip won't get confused. The notification is still done in the bus pm_notify callback. We'll get rid of this hack in the later patch. Signed-off-by: Takashi Iwai <tiwai@suse.de>