Skip to content

Commit 8b3dfda

Browse files
committed
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>
1 parent 76c2132 commit 8b3dfda

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

‎Documentation/sound/alsa/HD-Audio-Models.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ STAC92HD83*
286286
hp-inv-led HP with broken BIOS for inverted mute LED
287287
auto BIOS setup (default)
288288

289+
STAC92HD95
290+
==========
291+
hp-led LED support for HP laptops
292+
hp-bass Bass HPF setup for HP Spectre 13
293+
289294
STAC9872
290295
========
291296
vaio VAIO laptop without SPDIF

‎sound/pci/hda/patch_sigmatel.c‎

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ enum {
121121
STAC_92HD71BXX_MODELS
122122
};
123123

124+
enum {
125+
STAC_92HD95_HP_LED,
126+
STAC_92HD95_HP_BASS,
127+
STAC_92HD95_MODELS
128+
};
129+
124130
enum {
125131
STAC_925x_REF,
126132
STAC_M1,
@@ -4128,6 +4134,48 @@ static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
41284134
{} /* terminator */
41294135
};
41304136

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+
41314179
static int stac_parse_auto_config(struct hda_codec *codec)
41324180
{
41334181
struct sigmatel_spec *spec = codec->spec;
@@ -4580,10 +4628,16 @@ static int patch_stac92hd95(struct hda_codec *codec)
45804628
spec->gen.beep_nid = 0x19; /* digital beep */
45814629
spec->pwr_nids = stac92hd95_pwr_nids;
45824630
spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids);
4583-
spec->default_polarity = -1; /* no default cfg */
4631+
spec->default_polarity = 0;
45844632

45854633
codec->patch_ops = stac_patch_ops;
45864634

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+
45874641
err = stac_parse_auto_config(codec);
45884642
if (err < 0) {
45894643
stac_free(codec);
@@ -4592,6 +4646,8 @@ static int patch_stac92hd95(struct hda_codec *codec)
45924646

45934647
codec->proc_widget_hook = stac92hd_proc_hook;
45944648

4649+
snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4650+
45954651
return 0;
45964652
}
45974653

0 commit comments

Comments
 (0)