summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
AgeCommit message (Collapse)AuthorFilesLines
2014-02-10ALSA: hda - Fix undefined symbol due to builtin/module mixupTakashi Iwai1-15/+15
Even after the fix for leftover kconfig handling (commit f8f1becf), the current code still doesn't handle properly the builtin/module mixup case between the core snd-hda-codec and other codec drivers. For example, when CONFIG_SND_HDA_INTEL=y and CONFIG_SND_HDA_CODEC_HDMI=m, it'll end up with an unresolved symbol snd_hda_parse_hdmi_codec. This patch fixes the issue. Now codec->parser points to the parser object *only* when a module (either generic or HDMI parser) is loaded and bound. When a builtin symbol is used, codec->parser still points to NULL. This is the difference from the previous versions. Fixes: f8f1becfa4ac ('ALSA: hda - Fix leftover ifdef checks after modularization') Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07ALSA: hda - Fix leftover ifdef checks after modularizationTakashi Iwai1-3/+3
Since the commit [595fe1b702c3: ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate], the kconfig variables for the generic parser and codec drivers can be "m" instead of boolean, but some codes are left unchanged to check only #ifdef CONFIG_SND_HDA_CODEC_XXX, which is no longer true for modules. This patch fixes them by replacing with IS_ENABLED() macros. Fixes: 595fe1b702c3 ('ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate') Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70161 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-13ALSA: hda - Apply codec power_filter to FG nodesTakashi Iwai1-3/+9
Apply the codec->power_filter to the FG nodes in general for reducing hackish set_power_state ops override in patch_sigmatel.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19ALSA: hda - Kill EXPORT_SYMBOL_HDA()Takashi Iwai1-107/+107
Replace all with the standard EXPORT_SYMBOL_GPL(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06ALSA: hda - Clean up async codec PM using standard async infrastructureTakashi Iwai1-45/+19
This simplifies lots of codes indeed. Tested-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29ALSA: hda - allow a codec to define its own depop delay timeMengdong Lin1-2/+5
This patch adds 'depop_delay' to struct hda_codec, to indicate a depop delay time in ms when power-down, in function set_power_state() to D3. Default value is -1, for a default delay time. Machine fixup can set a suitable value according to the codec chip and HW audio design. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27ALSA: hda - resume codecs in parallelMengdong Lin1-6/+23
To reduce driver resume time, this patch resumes the codecs in parallel if there are multiple codecs on the bus. - The PM workqueue of bus is also used to parallel resuming multiple codecs. - The work item 'pm_work' is renamed to 'suspend_work' to parallel suspending codecs. - Add a work item 'resume_work' to parallel resuming codecs. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27ALSA: hda - suspend codecs in parallelMengdong Lin1-2/+45
The time to suspend a single codec may be several hundreds of ms. When runtime power saving is disabled, driver suspend time can be long especially when there are more than one codec on the bus. To reduce driver suspend time, this patch creates a work queue for the bus, and suspends the codecs in parallel if there are multiple codecs on the bus. [fixed cosmetic issues by tiwai] Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26ALSA: hda - Disable runtime PM when EPSS is unavailableTakashi Iwai1-2/+5
According to Mengdong, we shouldn't enable runtime PM when a codec doesn't support EPSS, based on the experiences on Windows. We have already this check in HDMI codec drivers, but now apply it in general in hda_codec.c. Credit goes to Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26ALSA: hda - Refactor pm notification in hda_codec.cTakashi Iwai1-23/+14
No functional change. - codec->pm_down_notified flag is renamed to codec->pm_up_notified flag (and takes the reversed meaning), which is managed solely in hda_call_pm_notify() now. - The explicit call of hda_call_pm_notify() is moved into hda_keep_power_on(). - Removed a redundant call of hda_call_pm_notify() in snd_hda_power_up(), as it's called in hda_call_codec_resume() anyway. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26ALSA: hda - Bind with HDMI codec parser automaticallyTakashi Iwai1-0/+27
If a codec contains only the digital outputs, it's very likely a HDMI/DP codec, which isn't supported by the generic parser but via HDMI codec parser code. Detect such a case and bind with the proper parser object if available. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26ALSA: hda - Split the generic parser as an individual moduleTakashi Iwai1-18/+49
Drop the hard dependency on the generic parser code and load / unload the generic parser code dynamically if built as a module. This allows us to avoid the generic parser if only HDMI/DP codecs are found. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-20ALSA: hda - Fix unbalanced runtime PM notification at resumeTakashi Iwai1-0/+4
When a codec is resumed, it keeps the power on while the resuming phase via hda_keep_power_on(), then turns down via snd_hda_power_down(). At that point, snd_hda_power_down() notifies the power down to the controller, and this may confuse the refcount if the codec was already powered up before the resume. In the end result, the controller goes to runtime suspend even before the codec is kicked off to the power save, and the communication stalls happens. The fix is to add the power-up notification together with hda_keep_power_on(), and clears the flag appropriately. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13ALSA: hda - Don't clear the power state at snd_hda_codec_reset()Takashi Iwai1-3/+0
snd_hda_codec_reset() is called either in resetting the whole setup at error paths or hwdep clear/reconfig sysfs triggers. But all of these don't assume that the power has to be off, rather they want to keep the power state unchanged (e.g. reconfig_codec() calls the power up/down by itself). Thus, unconditionally clearing the power state in snd_hda_codec_reset() leads to the inconsistency, confuses the further operation. This patch gets rid of the lines doing that bad thing. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05ALSA: hda - Add sanity check of vmaster slave dB stepsTakashi Iwai1-4/+12
Check whether all vmaster slaves have the same dB steps. Otherwise the behavior would become inconsistent. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05ALSA: hda - Fix possible zero-divisionTakashi Iwai1-2/+7
Check the TLV db scale result before actually dividing in vmaster slave init code. Also mask TLV_DB_SCALE_MUTE bit so that the right value is obtained even if this bit is set by the codec driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29ALSA: hda - Remove locally dead codesTakashi Iwai1-2/+1
Reported by coverity. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-26Merge branch 'for-linus' into for-nextTakashi Iwai1-2/+2
2013-10-24ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4Takashi Iwai1-2/+2
When a machine goes to S3/S4 after power-save is enabled, the runtime PM refcount might be incorrectly decreased because the power-down triggered soon after resume assumes that the controller was already powered up, and issues the pm_notify down. This patch fixes the incorrect pm_notify call simply by checking the current value properly. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17ALSA: hda - Treat zero connection as non-errorTakashi Iwai1-1/+1
The zero-length connection list happens so often on Haswell HDMI, and it results in warning messages like ALSA: hda_codec: invalid CONNECT_LIST verb 5[1]:0 at each time the codec resumes from the power-save, which is fairly annoying. Since this is no real error, make it shown only in the verbose debug mode. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-10ALSA: hda - Enable surround speakers (when line out is also present)David Henningsson1-5/+14
In the case where we have both line out and more than stereo speakers, the speaker DACs will end up in extra_out_nid. In fact, AFAIU, speakers are the only ones that can end up in extra_out_nid, and if we have several of those, they should be surround outputs rather than copy front. BugLink: https://bugs.launchpad.net/bugs/1236965 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27ALSA: hda - add flags and routines to get devices selection info for DP1.2 MSTMengdong Lin1-0/+58
This patch adds flags and routines to get device list & selection info on a pin. To support Display Port 1.2 multi-stream transport (MST) over single DP port, a pin can support multiple devices. Please refer to HD-A spec Document Change Notificaton HDA040-A. A display audio codec can set flag "dp_mst" in its patch, indicating its pins can support MST. But at runtime, a pin may not be multi-streaming capable and report the device list is empty, depending on Gfx driver configuration. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29ALSA: hda - jack poll once if jackpoll_interval==0Wang Xingchao1-2/+4
With jackpoll_interval != 0, it's used to poll jack event periodically in a delayed work. if it's 0, give the caller chance to probe jack status but will not restart the delayed work. In the next patch which enable WAKEEN feature, HDA controller was able to wake up system when it's in D3, it's useful to detect Jack hotplug event and notify userspace. By default the jackpoll_interval=0, this patch let jack poll once without starting the delayed work. Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-04Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "The usual stuff from trivial tree" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits) treewide: relase -> release Documentation/cgroups/memory.txt: fix stat file documentation sysctl/net.txt: delete reference to obsolete 2.4.x kernel spinlock_api_smp.h: fix preprocessor comments treewide: Fix typo in printk doc: device tree: clarify stuff in usage-model.txt. open firmware: "/aliasas" -> "/aliases" md: bcache: Fixed a typo with the word 'arithmetic' irq/generic-chip: fix a few kernel-doc entries frv: Convert use of typedef ctl_table to struct ctl_table sgi: xpc: Convert use of typedef ctl_table to struct ctl_table doc: clk: Fix incorrect wording Documentation/arm/IXP4xx fix a typo Documentation/networking/ieee802154 fix a typo Documentation/DocBook/media/v4l fix a typo Documentation/video4linux/si476x.txt fix a typo Documentation/virtual/kvm/api.txt fix a typo Documentation/early-userspace/README fix a typo Documentation/video4linux/soc-camera.txt fix a typo lguest: fix CONFIG_PAE -> CONFIG_x86_PAE in comment ...
2013-06-28treewide: relase -> releaseGeert Uytterhoeven1-1/+1
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-06-06ALSA: hda - Don't take unresponsive D3 transition too seriousTakashi Iwai1-1/+6
When a codec is powered off, some systems don't respond properly after D3 FG transition, while the driver still expects the response and tries to fall back to different modes (polling and single-cmd). When the fallback happens, the driver stays in that mode, and falling back to the single-cmd mode means it'll loose the unsol event handling, too. The unresponsiveness at D3 isn't too serious, thus this fallback is mostly superfluous. We can gracefully ignore the error there so that the driver keeps the normal operation mode. This patch adds a new bit flag for codec read/write, set in the power transition stage, which is notified to the controller driver via a new bus->no_response_fallback flag. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-06ALSA: hda - Introduce bit flags to snd_hda_codec_read/write()Takashi Iwai1-21/+20
snd_hda_codec_read(), snd_hda_codec_write() & co take the argument "direct" that indicates whether the given NID is a direct reference or an indirect reference. However, the indirect reference is practically unimplemented and never exists. And moreover, we don't need the indication of indirect reference at this high level, as NID can be represented in 16bit values at this point. Meanwhile, there are some cases where it'd be nice to give some operational options to these functions. So, we can reuse this argument as a new bit flag! Pretty frugal, eh? All callers so far pass zero to this argument, thus there is no behavior change by this replacement. The real usage of this new bit option will be added in the following patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-06ALSA: hda - Drop hard dependency on CONFIG_SND_DYNAMIC_MINORSTakashi Iwai1-4/+15
Currently HDMI codec driver sets the hard dependency (reverse selection) on CONFIG_SND_DYNAMIC_MINORS because the recent codecs may support more than two PCMs. But, this doesn't mean that we need always this option, since there can be a single PCM stream even with the modern codecs. This patch drops the hard dependency again but give more sensible error message when no enough PCMs are available due to the lack of this option. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-10Revert "ALSA: hda - Don't set up active streams twice"Takashi Iwai1-2/+2
This reverts commit affdb62b815b38261f09f9d4ec210a35c7ffb1f3. The commit introduced a regression with AD codecs where the stream is always clean up. Since the patch is just a minor optimization and reverting the commit fixes the issue, let's just revert it. Reported-and-tested-by: Michael Burian <michael.burian@sbg.at> Cc: <stable@vger.kernel.org> [v3.9+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-07ALSA: HDA: Fix Oops caused by dereference NULL pointerWang YanQing1-0/+3
The interrupt handler azx_interrupt will call azx_update_rirb, which may call snd_hda_queue_unsol_event, snd_hda_queue_unsol_event will dereference chip->bus pointer. The problem is we alloc chip->bus in azx_codec_create which will be called after we enable IRQ and enable unsolicited event in azx_probe. This will cause Oops due dereference NULL pointer. I meet it, good luck:) [Rearranged the NULL check before the tracepoint and added another NULL check of bus->workq -- tiwai] Signed-off-by: Wang YanQing <udknight@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18ALSA: hda - Disable the sanity check in snd_hda_add_pincfg()Takashi Iwai1-0/+6
When pin default configs are overridden via patch option, these are evaluated before fixups are applied. Since some fixups change the whole codec trees and/or add pins dynamically, this sanity check might not pass when pins aren't present at the time the function is called. We may reorder the execution, but an easier fix is simply to disable this sanity check. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-17ALSA: hda - Don't call vmaster hook when bus->shutdown is setTakashi Iwai1-0/+5
The flag bus->shutdown implies that the control elements might have been already destroyed. When a codec is resumed at this state and tries to call vmaster hook (e.g. in snd_hda_gen_init()), it would refer to a non-existing object, resulting in Oops in the end. This patch just adds a check of the flag in the caller side for avoiding such a crash. Though, the best would be to clear hook->sw_kctl by the destructor of the corresponding ctl element, but vmaster uses its own private_free, it can't be done easily. So let it be for a while. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-15Merge tag 'asoc-v3.10' of ↵Takashi Iwai1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.10 A bunch of changes here, the most interesting one subsystem wise being Morimoto-san's work to create snd_soc_component which doesn't do much for now but will be pretty important going forwards: - Add a new component object type which will form the basis of moving to a more generic handling of SoC and off-SoC components, contributed by Kuninori Morimoto. - A fairly large set of cleanups for the dmaengine integration from Lars-Peter Clausen, starting to move towards being able to have a generic driver based on the library. - Performance optimisations to DAPM from Ryo Tsutsui. - Support for mixer control sharing in DAPM from Stephen Warren. - Multiplatform ARM cleanups from Arnd Bergmann. - New CODEC drivers for AK5385 and TAS5086 from Daniel Mack.
2013-04-04ALSA: hda - fix typo in proc outputDavid Henningsson1-1/+1
Rename "Digitial In" to "Digital In". This function is only used for proc output, so should not cause any problems to change. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22Merge branch 'for-linus' into for-nextTakashi Iwai1-1/+1
Merge back for-linus branch for the badness table adjustment for VIA codecs * for-linus: ALSA: hda - Fix DAC assignment for independent HP ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loader ALSA: hda - Fix typo in checking IEC958 emphasis bit ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() ALSA: snd-usb: mixer: propagate errors up the call chain ALSA: usb: Parse UAC2 extension unit like for UAC1 ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driver
2013-03-20ALSA: hda - Fix typo in checking IEC958 emphasis bitTakashi Iwai1-1/+1
There is a typo in convert_to_spdif_status() about checking the emphasis IEC958 status bit. It should check the given value instead of the resultant value. Reported-by: Martin Weishart <martin.weishart@telosalliance.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18Merge branch 'for-linus' into for-nextTakashi Iwai1-12/+23
Back-merged for refactoring beep stuff.
2013-03-13ALSA: hda - Don't apply EAPD power filter as defaultTakashi Iwai1-7/+6
So far, the driver doesn't power down the widget at going down to D3 when the widget node has an EAPD capability and EAPD is actually set on all codecs unless codec->power_filter is set explicitly. This caused a problem on some Conexant codecs, leading to click noises, and we set it as NULL there. But it is very unlikely that the problem hits only these codecs. Looking back at the development history, this workaround for EAPD was introduced just for some laptops with STAC9200 codec, then we applied it blindly for all. Now, since it's revealed to have an ill effect, we should disable this workaround per default and apply only for the known requiring systems. The EAPD workaround is implemented now as snd_hda_codec_eapd_power_filter(), and this has to be set explicitly by the codec driver when needed. As of now, only patch_stac9200() sets this one. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13ALSA: hda - Drop explicit memset() by reallocation with __GFP_ZEROTakashi Iwai1-3/+1
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12ALSA: hda - Fix snd_hda_get_num_raw_conns() to return a correct valueTakashi Iwai1-10/+14
In the connection list expansion in hda_codec.c and hda_proc.c, the value returned from snd_hda_get_num_raw_conns() is used as the array size to store the connection list. However, the function returns simply a raw value of the AC_PAR_CONNLIST_LEN parameter, and the widget list with ranges isn't considered there. Thus it may return a smaller size than the actual list, which results in -ENOSPC in snd_hda_get_raw_conections(). This patch fixes the bug by parsing the connection list correctly also for snd_hda_get_num_raw_conns(). Reported-and-tested-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - check NULL pointer when creating SPDIF PCM switchMengdong Lin1-2/+7
If the new control cannot be created, this function will return to avoid snd_hda_ctl_add dereferencing a NULL control pointer. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - check NULL pointer when creating SPDIF controlsMengdong Lin1-0/+2
If the SPDIF control array cannot be reallocated, the function will return to avoid dereferencing a NULL pointer. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12ALSA: hda - Fix broken workaround for HDMI/SPDIF conflictsTakashi Iwai1-22/+21
The commit [dcda58061: ALSA: hda - Add workaround for conflicting IEC958 controls] introduced a workaround for cards that have both SPDIF and HDMI devices for giving device=1 to SPDIF control elements. It turned out, however, that this workaround doesn't work well - - The workaround checks only conflicts in a single codec, but SPDIF and HDMI are provided by multiple codecs in many cases, and - ALSA mixer abstraction doesn't care about the device number in ctl elements, thus you'll get errors from amixer such as % amixer scontrols -c 0 ALSA lib simple_none.c:1551:(simple_add1) helem (MIXER,'IEC958 Playback Switch',0,1,0) appears twice or more amixer: Mixer hw:0 load error: Invalid argument This patch fixes the previous broken workaround. Instead of changing the device number of SPDIF ctl elements, shift the element indices of such controls up to 16. Also, the conflict check is performed over all codecs found on the bus. HDMI devices will be put to dev=0,index=0 as before. Only the conflicting SPDIF device is moved to a different place. The new place of SPDIF device is supposed by the updated alsa-lib HDA-Intel.conf, respectively. Reported-by: Stephan Raue <stephan@openelec.tv> Reported-by: Anssi Hannula <anssi.hannula@iki.fi> Cc: <stable@vger.kernel.org> [v3.8] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08ALSA: hda - Support rereading widgets under the function groupMengdong Lin1-0/+24
A codec may allow software to hide some unused pin/cvt widgets. Sometimes BIOS does not enable the hidden widgets properly although they are needed for the board. Thus the driver need to enable them as a board-specific fixup and the whole tree will change. This patch implements a common code for rereading codec widgets. So the fixup code can call it after enabling the hidden widgets. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07ALSA: hda - Remove limit of widget connectionsTakashi Iwai1-21/+41
Currently we set the max number of connections to be 32, but there seems codec that gives longer connection lists like AD1988, and we see errors in proc output and else. (Though, in the case of AD1988, it's a list of all codecs connected to a single vendor widget, so this must be something fishy, but it's still valid from the h/w design POV.) This patch tries to remove this restriction. For efficiency, we still use the fixed size array in the parser, but takes a dynamic array when the size is reported to be greater than that. Now the fixed array size is found only in patch_hdmi.c, but it should be fine, as the codec itself can't support so many pins. Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24ALSA: hda - Add snd_hda_check_power_state() helper functionTakashi Iwai1-7/+2
... for small refactoring. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24ALSA: hda - Synchronize the power state at the end of codec initTakashi Iwai1-0/+32
Put the power state synchronization at the end of the parsing of codec. This is necessary when the power filter is changed during the codec probe. Since the first power-up sequence is performed without the special filter, all widgets are supposed to be ON at this point. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24ALSA: hda - Add power state filteringTakashi Iwai1-14/+25
Add a hook to struct hda_codec for filtering the target power state of each widget when powering up/down. The current hackish EAPD check is implemented as the default hook pointer, too. This allows codec drivers to implement own power filter. In the upcoming changes, the generic parser will have the better power filter based on the active paths. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23Merge branch 'for-linus' into for-nextTakashi Iwai1-3/+2
Merge the 3.8 devel branch for correcting the newly added PB desktop fixup with the automute support.
2013-01-23ALSA: hda - Fix inconsistent pin states after resumeTakashi Iwai1-3/+2
The commit [26a6cb6c: ALSA: hda - Implement a poll loop for jacks as a module parameter] introduced the polling jack detection code, but it also moved the call of snd_hda_jack_set_dirty_all() in the resume path after resume/init ops call. This caused a regression when the jack state has been changed during power-down (e.g. in the power save mode). Since the driver doesn't probe the new jack state but keeps using the cached value due to no dirty flag, the pin state remains also as if the jack is still plugged. The fix is simply moving snd_hda_jack_set_dirty_all() to the original position. Reported-by: Manolo Díaz <diaz.manolo@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>