aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-06-24 07:55:25 -0400
committerTakashi Iwai <tiwai@suse.de>2014-06-25 11:50:24 -0400
commit8b3dfdaf0c25a584cb31d04d2574115cf2d422ab (patch)
treed8e04396b7d16db17fb6de493d814477673ef31d /sound
parent76c2132ec9805120eb724cae4d2a8d30af27b3fd (diff)
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7f40a150899c..3744ea4e843d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -122,6 +122,12 @@ enum {
122}; 122};
123 123
124enum { 124enum {
125 STAC_92HD95_HP_LED,
126 STAC_92HD95_HP_BASS,
127 STAC_92HD95_MODELS
128};
129
130enum {
125 STAC_925x_REF, 131 STAC_925x_REF,
126 STAC_M1, 132 STAC_M1,
127 STAC_M1_2, 133 STAC_M1_2,
@@ -4128,6 +4134,48 @@ static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
4128 {} /* terminator */ 4134 {} /* terminator */
4129}; 4135};
4130 4136
4137static 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
4151static 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
4167static 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
4172static 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
4131static int stac_parse_auto_config(struct hda_codec *codec) 4179static int stac_parse_auto_config(struct hda_codec *codec)
4132{ 4180{
4133 struct sigmatel_spec *spec = codec->spec; 4181 struct sigmatel_spec *spec = codec->spec;
@@ -4580,10 +4628,16 @@ static int patch_stac92hd95(struct hda_codec *codec)
4580 spec->gen.beep_nid = 0x19; /* digital beep */ 4628 spec->gen.beep_nid = 0x19; /* digital beep */
4581 spec->pwr_nids = stac92hd95_pwr_nids; 4629 spec->pwr_nids = stac92hd95_pwr_nids;
4582 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); 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 codec->patch_ops = stac_patch_ops; 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 err = stac_parse_auto_config(codec); 4641 err = stac_parse_auto_config(codec);
4588 if (err < 0) { 4642 if (err < 0) {
4589 stac_free(codec); 4643 stac_free(codec);
@@ -4592,6 +4646,8 @@ static int patch_stac92hd95(struct hda_codec *codec)
4592 4646
4593 codec->proc_widget_hook = stac92hd_proc_hook; 4647 codec->proc_widget_hook = stac92hd_proc_hook;
4594 4648
4649 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4650
4595 return 0; 4651 return 0;
4596} 4652}
4597 4653