aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-11-18 11:20:24 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-18 11:22:07 -0500
commitb4e818768d50a5b7aa1635676839682bcf0691b6 (patch)
tree3f61e8abf70ea82d9cfadc475366f7b23987b125
parent8af3aeb498197f6fdf5acc913ffe8a392cb921c9 (diff)
ALSA: hda - Fix mute-LED sync on HP laptops with IDT92HD83xxx codecs
The mute-LED isn't synchronized with the actual mute state on some HP laptops with IDT 92HD83xxx codecs. A similar hack using check_power_status callback is added for this codec, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt1
-rw-r--r--sound/pci/hda/patch_sigmatel.c39
2 files changed, 38 insertions, 2 deletions
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index 4c7f9aee5c4e..9000cd84d076 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -391,6 +391,7 @@ STAC92HD83*
391 ref Reference board 391 ref Reference board
392 mic-ref Reference board with power management for ports 392 mic-ref Reference board with power management for ports
393 dell-s14 Dell laptop 393 dell-s14 Dell laptop
394 hp HP laptops with (inverted) mute-LED
394 auto BIOS setup (default) 395 auto BIOS setup (default)
395 396
396STAC9872 397STAC9872
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 39001c47e627..2a45375d79f8 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -93,6 +93,7 @@ enum {
93 STAC_92HD83XXX_REF, 93 STAC_92HD83XXX_REF,
94 STAC_92HD83XXX_PWR_REF, 94 STAC_92HD83XXX_PWR_REF,
95 STAC_DELL_S14, 95 STAC_DELL_S14,
96 STAC_92HD83XXX_HP,
96 STAC_92HD83XXX_MODELS 97 STAC_92HD83XXX_MODELS
97}; 98};
98 99
@@ -1624,6 +1625,7 @@ static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1624 [STAC_92HD83XXX_REF] = "ref", 1625 [STAC_92HD83XXX_REF] = "ref",
1625 [STAC_92HD83XXX_PWR_REF] = "mic-ref", 1626 [STAC_92HD83XXX_PWR_REF] = "mic-ref",
1626 [STAC_DELL_S14] = "dell-s14", 1627 [STAC_DELL_S14] = "dell-s14",
1628 [STAC_92HD83XXX_HP] = "hp",
1627}; 1629};
1628 1630
1629static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1631static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
@@ -1634,6 +1636,8 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1634 "DFI LanParty", STAC_92HD83XXX_REF), 1636 "DFI LanParty", STAC_92HD83XXX_REF),
1635 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba, 1637 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
1636 "unknown Dell", STAC_DELL_S14), 1638 "unknown Dell", STAC_DELL_S14),
1639 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x3600,
1640 "HP", STAC_92HD83XXX_HP),
1637 {} /* terminator */ 1641 {} /* terminator */
1638}; 1642};
1639 1643
@@ -4834,6 +4838,23 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
4834 4838
4835 return 0; 4839 return 0;
4836} 4840}
4841
4842static int idt92hd83xxx_hp_check_power_status(struct hda_codec *codec,
4843 hda_nid_t nid)
4844{
4845 struct sigmatel_spec *spec = codec->spec;
4846
4847 if (nid != 0x13)
4848 return 0;
4849 if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & HDA_AMP_MUTE)
4850 spec->gpio_data |= spec->gpio_led; /* mute LED on */
4851 else
4852 spec->gpio_data &= ~spec->gpio_led; /* mute LED off */
4853 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data);
4854
4855 return 0;
4856}
4857
4837#endif 4858#endif
4838 4859
4839static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) 4860static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
@@ -5199,6 +5220,22 @@ again:
5199 break; 5220 break;
5200 } 5221 }
5201 5222
5223 codec->patch_ops = stac92xx_patch_ops;
5224
5225 if (spec->board_config == STAC_92HD83XXX_HP)
5226 spec->gpio_led = 0x01;
5227
5228#ifdef CONFIG_SND_HDA_POWER_SAVE
5229 if (spec->gpio_led) {
5230 spec->gpio_mask |= spec->gpio_led;
5231 spec->gpio_dir |= spec->gpio_led;
5232 spec->gpio_data |= spec->gpio_led;
5233 /* register check_power_status callback. */
5234 codec->patch_ops.check_power_status =
5235 idt92hd83xxx_hp_check_power_status;
5236 }
5237#endif
5238
5202 err = stac92xx_parse_auto_config(codec, 0x1d, 0); 5239 err = stac92xx_parse_auto_config(codec, 0x1d, 0);
5203 if (!err) { 5240 if (!err) {
5204 if (spec->board_config < 0) { 5241 if (spec->board_config < 0) {
@@ -5234,8 +5271,6 @@ again:
5234 snd_hda_codec_write_cache(codec, nid, 0, 5271 snd_hda_codec_write_cache(codec, nid, 0,
5235 AC_VERB_SET_CONNECT_SEL, num_dacs); 5272 AC_VERB_SET_CONNECT_SEL, num_dacs);
5236 5273
5237 codec->patch_ops = stac92xx_patch_ops;
5238
5239 codec->proc_widget_hook = stac92hd_proc_hook; 5274 codec->proc_widget_hook = stac92hd_proc_hook;
5240 5275
5241 return 0; 5276 return 0;