diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-04-19 16:07:50 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-04-19 16:07:50 -0400 |
commit | de3df8a986b635082a1d94bae2c361d043c57106 (patch) | |
tree | 5ab2e67a5c451c0b226441e029375519064ed287 | |
parent | afecb146d8d8a60a1dde9cdf570c278649617fde (diff) |
ALSA: hda - Keep powering up ADCs on Cirrus codecs
Although one weird behavior about the input path (inconsistent D0/D3
switch) on Cirrus CS420x codecs was fixed in the previous commit,
there is still an issue on some Mac machines: the capture stream
stalls when switching the ADCs on the fly. More badly, this keeps
stuck until the next reboot.
The dynamic ADC switching is already a bit fragile and assuming
optimistically that the chip accepts the frequent power changes. On
Cirrus codecs, this doesn't seem applicable.
As a quick workaround, we pin down the ADCs to keep up in D0 when
spec->dyn_adc_switch is set. In this way, the ADCs are kept up only
for the system that were confirmed to be broken.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116171
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index a47e8ae0eb30..80bbadc83721 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -361,6 +361,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) | |||
361 | { | 361 | { |
362 | struct cs_spec *spec = codec->spec; | 362 | struct cs_spec *spec = codec->spec; |
363 | int err; | 363 | int err; |
364 | int i; | ||
364 | 365 | ||
365 | err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); | 366 | err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); |
366 | if (err < 0) | 367 | if (err < 0) |
@@ -370,6 +371,19 @@ static int cs_parse_auto_config(struct hda_codec *codec) | |||
370 | if (err < 0) | 371 | if (err < 0) |
371 | return err; | 372 | return err; |
372 | 373 | ||
374 | /* keep the ADCs powered up when it's dynamically switchable */ | ||
375 | if (spec->gen.dyn_adc_switch) { | ||
376 | unsigned int done = 0; | ||
377 | for (i = 0; i < spec->gen.input_mux.num_items; i++) { | ||
378 | int idx = spec->gen.dyn_adc_idx[i]; | ||
379 | if (done & (1 << idx)) | ||
380 | continue; | ||
381 | snd_hda_gen_fix_pin_power(codec, | ||
382 | spec->gen.adc_nids[idx]); | ||
383 | done |= 1 << idx; | ||
384 | } | ||
385 | } | ||
386 | |||
373 | return 0; | 387 | return 0; |
374 | } | 388 | } |
375 | 389 | ||