aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-04 10:32:01 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-05 01:49:41 -0500
commita1114a8c681b0724d6ad905f53ff06aa756f5fb8 (patch)
treeb482474baaaef3492e48a0acca2e99366974f4ed /sound/pci/hda
parent485e3e0cdf353e2e37570eafaad7208138bb6620 (diff)
ALSA: hda - Introduce the bitmask for excluding output volume
Add a bitmask to hda_gen_spec indicating NIDs to exclude from the possible volume controls. That is, when the bit is set, the NID corresponding to the bit won't be picked as an output volume control any longer. Basically this is just a band-aid for working around the issue found with CS4208 codec, where only the headphone pin has a volume AMP with different dB steps. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811 Cc: <stable@vger.kernel.org> [v3.12+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_generic.c8
-rw-r--r--sound/pci/hda/hda_generic.h3
-rw-r--r--sound/pci/hda/patch_cirrus.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index b7c89dff7066..276f6e759bac 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -549,11 +549,15 @@ static hda_nid_t look_for_out_mute_nid(struct hda_codec *codec,
549static hda_nid_t look_for_out_vol_nid(struct hda_codec *codec, 549static hda_nid_t look_for_out_vol_nid(struct hda_codec *codec,
550 struct nid_path *path) 550 struct nid_path *path)
551{ 551{
552 struct hda_gen_spec *spec = codec->spec;
552 int i; 553 int i;
553 554
554 for (i = path->depth - 1; i >= 0; i--) { 555 for (i = path->depth - 1; i >= 0; i--) {
555 if (nid_has_volume(codec, path->path[i], HDA_OUTPUT)) 556 hda_nid_t nid = path->path[i];
556 return path->path[i]; 557 if ((spec->out_vol_mask >> nid) & 1)
558 continue;
559 if (nid_has_volume(codec, nid, HDA_OUTPUT))
560 return nid;
557 } 561 }
558 return 0; 562 return 0;
559} 563}
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 48d44026705b..7e45cb44d151 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -242,6 +242,9 @@ struct hda_gen_spec {
242 /* additional mute flags (only effective with auto_mute_via_amp=1) */ 242 /* additional mute flags (only effective with auto_mute_via_amp=1) */
243 u64 mute_bits; 243 u64 mute_bits;
244 244
245 /* bitmask for skipping volume controls */
246 u64 out_vol_mask;
247
245 /* badness tables for output path evaluations */ 248 /* badness tables for output path evaluations */
246 const struct badness_table *main_out_badness; 249 const struct badness_table *main_out_badness;
247 const struct badness_table *extra_out_badness; 250 const struct badness_table *extra_out_badness;
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 18d972501585..38d073ed4bcc 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -660,6 +660,8 @@ static int patch_cs4208(struct hda_codec *codec)
660 return -ENOMEM; 660 return -ENOMEM;
661 661
662 spec->gen.automute_hook = cs_automute; 662 spec->gen.automute_hook = cs_automute;
663 /* exclude NID 0x10 (HP) from output volumes due to different steps */
664 spec->gen.out_vol_mask = 1ULL << 0x10;
663 665
664 snd_hda_pick_fixup(codec, cs4208_models, cs4208_fixup_tbl, 666 snd_hda_pick_fixup(codec, cs4208_models, cs4208_fixup_tbl,
665 cs4208_fixups); 667 cs4208_fixups);