Commit 8b3dfdaf0c25a584cb31d04d2574115cf2d422ab
1 parent
76c2132ec9
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
ALSA: hda - Adjust speaker HPF and add LED support for HP Spectre 13
HP Spectre 13 has the IDT 92HD95 codec, and BIOS seems to set the default high-pass filter in some "safer" range, which results in the very soft tone from the built-in speakers in contrast to Windows. Also, the mute LED control is missing, since 92HD95 codec still has no HP-specific fixups for GPIO setups. This patch adds these missing features: the HPF is adjusted by the vendor-specific verb, and the LED is set up from a DMI string (but with the default polarity = 0 assumption due to the incomplete BIOS on the given machine). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=74841 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 2 changed files with 62 additions and 1 deletions Side-by-side Diff
Documentation/sound/alsa/HD-Audio-Models.txt
... | ... | @@ -286,6 +286,11 @@ |
286 | 286 | hp-inv-led HP with broken BIOS for inverted mute LED |
287 | 287 | auto BIOS setup (default) |
288 | 288 | |
289 | +STAC92HD95 | |
290 | +========== | |
291 | + hp-led LED support for HP laptops | |
292 | + hp-bass Bass HPF setup for HP Spectre 13 | |
293 | + | |
289 | 294 | STAC9872 |
290 | 295 | ======== |
291 | 296 | vaio VAIO laptop without SPDIF |
sound/pci/hda/patch_sigmatel.c
... | ... | @@ -122,6 +122,12 @@ |
122 | 122 | }; |
123 | 123 | |
124 | 124 | enum { |
125 | + STAC_92HD95_HP_LED, | |
126 | + STAC_92HD95_HP_BASS, | |
127 | + STAC_92HD95_MODELS | |
128 | +}; | |
129 | + | |
130 | +enum { | |
125 | 131 | STAC_925x_REF, |
126 | 132 | STAC_M1, |
127 | 133 | STAC_M1_2, |
... | ... | @@ -4128,6 +4134,48 @@ |
4128 | 4134 | {} /* terminator */ |
4129 | 4135 | }; |
4130 | 4136 | |
4137 | +static void stac92hd95_fixup_hp_led(struct hda_codec *codec, | |
4138 | + const struct hda_fixup *fix, int action) | |
4139 | +{ | |
4140 | + struct sigmatel_spec *spec = codec->spec; | |
4141 | + | |
4142 | + if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4143 | + return; | |
4144 | + | |
4145 | + if (find_mute_led_cfg(codec, spec->default_polarity)) | |
4146 | + codec_dbg(codec, "mute LED gpio %d polarity %d\n", | |
4147 | + spec->gpio_led, | |
4148 | + spec->gpio_led_polarity); | |
4149 | +} | |
4150 | + | |
4151 | +static const struct hda_fixup stac92hd95_fixups[] = { | |
4152 | + [STAC_92HD95_HP_LED] = { | |
4153 | + .type = HDA_FIXUP_FUNC, | |
4154 | + .v.func = stac92hd95_fixup_hp_led, | |
4155 | + }, | |
4156 | + [STAC_92HD95_HP_BASS] = { | |
4157 | + .type = HDA_FIXUP_VERBS, | |
4158 | + .v.verbs = (const struct hda_verb[]) { | |
4159 | + {0x1a, 0x795, 0x00}, /* HPF to 100Hz */ | |
4160 | + {} | |
4161 | + }, | |
4162 | + .chained = true, | |
4163 | + .chain_id = STAC_92HD95_HP_LED, | |
4164 | + }, | |
4165 | +}; | |
4166 | + | |
4167 | +static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = { | |
4168 | + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS), | |
4169 | + {} /* terminator */ | |
4170 | +}; | |
4171 | + | |
4172 | +static const struct hda_model_fixup stac92hd95_models[] = { | |
4173 | + { .id = STAC_92HD95_HP_LED, .name = "hp-led" }, | |
4174 | + { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" }, | |
4175 | + {} | |
4176 | +}; | |
4177 | + | |
4178 | + | |
4131 | 4179 | static int stac_parse_auto_config(struct hda_codec *codec) |
4132 | 4180 | { |
4133 | 4181 | struct sigmatel_spec *spec = codec->spec; |
4134 | 4182 | |
... | ... | @@ -4580,10 +4628,16 @@ |
4580 | 4628 | spec->gen.beep_nid = 0x19; /* digital beep */ |
4581 | 4629 | spec->pwr_nids = stac92hd95_pwr_nids; |
4582 | 4630 | spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); |
4583 | - spec->default_polarity = -1; /* no default cfg */ | |
4631 | + spec->default_polarity = 0; | |
4584 | 4632 | |
4585 | 4633 | codec->patch_ops = stac_patch_ops; |
4586 | 4634 | |
4635 | + snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, | |
4636 | + stac92hd95_fixups); | |
4637 | + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
4638 | + | |
4639 | + stac_setup_gpio(codec); | |
4640 | + | |
4587 | 4641 | err = stac_parse_auto_config(codec); |
4588 | 4642 | if (err < 0) { |
4589 | 4643 | stac_free(codec); |
... | ... | @@ -4591,6 +4645,8 @@ |
4591 | 4645 | } |
4592 | 4646 | |
4593 | 4647 | codec->proc_widget_hook = stac92hd_proc_hook; |
4648 | + | |
4649 | + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); | |
4594 | 4650 | |
4595 | 4651 | return 0; |
4596 | 4652 | } |