ALSA: hda - Fix the connection selection of ADCs on Cirrus codecs
authorTakashi Iwai <tiwai@suse.de>
Wed, 16 Nov 2011 17:05:11 +0000 (18:05 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 26 Nov 2011 17:08:33 +0000 (09:08 -0800)
commitea054a92dcd97d4f26694f7535912fc82bf0e7a9
tree95dfae8778b52a79ce0668396f8edb1c4c1d0edd
parentd6b8bd1b2d0950cd59f52d260bc7e97b04600b94
ALSA: hda - Fix the connection selection of ADCs on Cirrus codecs

commit 05ee7964a470d29889ac48cc8274c1b5a1904a11 upstream.

spec->cur_adc isn't set until cs_capture_pcm_prepare() is called although
the driver tries to select the connection at init time and at auto-mic
switch.  This results in the access to the widget NID 0, which is
obviously invalid, also a wrong capture source.

This patch fixes the issue by issuing the connect-select verb conditionally
at appropriate places.

Reported-and-tested-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/hda/patch_cirrus.c