Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+62 -1
+5
Documentation/sound/alsa/HD-Audio-Models.txt
··· 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
+57 -1
sound/pci/hda/patch_sigmatel.c
··· 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, ··· 4134 4128 {} /* terminator */ 4135 4129 }; 4136 4130 4131 + static void stac92hd95_fixup_hp_led(struct hda_codec *codec, 4132 + const struct hda_fixup *fix, int action) 4133 + { 4134 + struct sigmatel_spec *spec = codec->spec; 4135 + 4136 + if (action != HDA_FIXUP_ACT_PRE_PROBE) 4137 + return; 4138 + 4139 + if (find_mute_led_cfg(codec, spec->default_polarity)) 4140 + codec_dbg(codec, "mute LED gpio %d polarity %d\n", 4141 + spec->gpio_led, 4142 + spec->gpio_led_polarity); 4143 + } 4144 + 4145 + static const struct hda_fixup stac92hd95_fixups[] = { 4146 + [STAC_92HD95_HP_LED] = { 4147 + .type = HDA_FIXUP_FUNC, 4148 + .v.func = stac92hd95_fixup_hp_led, 4149 + }, 4150 + [STAC_92HD95_HP_BASS] = { 4151 + .type = HDA_FIXUP_VERBS, 4152 + .v.verbs = (const struct hda_verb[]) { 4153 + {0x1a, 0x795, 0x00}, /* HPF to 100Hz */ 4154 + {} 4155 + }, 4156 + .chained = true, 4157 + .chain_id = STAC_92HD95_HP_LED, 4158 + }, 4159 + }; 4160 + 4161 + static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = { 4162 + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS), 4163 + {} /* terminator */ 4164 + }; 4165 + 4166 + static const struct hda_model_fixup stac92hd95_models[] = { 4167 + { .id = STAC_92HD95_HP_LED, .name = "hp-led" }, 4168 + { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" }, 4169 + {} 4170 + }; 4171 + 4172 + 4137 4173 static int stac_parse_auto_config(struct hda_codec *codec) 4138 4174 { 4139 4175 struct sigmatel_spec *spec = codec->spec; ··· 4628 4580 spec->gen.beep_nid = 0x19; /* digital beep */ 4629 4581 spec->pwr_nids = stac92hd95_pwr_nids; 4630 4582 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); 4631 - spec->default_polarity = -1; /* no default cfg */ 4583 + spec->default_polarity = 0; 4632 4584 4633 4585 codec->patch_ops = stac_patch_ops; 4586 + 4587 + snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl, 4588 + stac92hd95_fixups); 4589 + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 4590 + 4591 + stac_setup_gpio(codec); 4634 4592 4635 4593 err = stac_parse_auto_config(codec); 4636 4594 if (err < 0) { ··· 4645 4591 } 4646 4592 4647 4593 codec->proc_widget_hook = stac92hd_proc_hook; 4594 + 4595 + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 4648 4596 4649 4597 return 0; 4650 4598 }