diff options
author | James Gardiner <renidragsemaj@yahoo.com> | 2009-05-03 04:00:44 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-04 03:06:19 -0400 |
commit | 514bf54cd8c7f172816d3c003a6d022e9165a29b (patch) | |
tree | 65b9318f7ea6d6782e5b04ba3062017f4248b672 /sound | |
parent | cb6605c1e4d2a2eaffdde433fbfe1567ca688458 (diff) |
ALSA: hda - Addition for HP dv4-1222nr laptop support
Signed-off-by: James Gardiner <renidragsemaj@yahoo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 917bc5d3ac2c..76487de33c84 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -100,6 +100,7 @@ enum { | |||
100 | STAC_HP_M4, | 100 | STAC_HP_M4, |
101 | STAC_HP_DV5, | 101 | STAC_HP_DV5, |
102 | STAC_HP_HDX, | 102 | STAC_HP_HDX, |
103 | STAC_HP_DV4_1222NR, | ||
103 | STAC_92HD71BXX_MODELS | 104 | STAC_92HD71BXX_MODELS |
104 | }; | 105 | }; |
105 | 106 | ||
@@ -1836,6 +1837,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { | |||
1836 | [STAC_HP_M4] = NULL, | 1837 | [STAC_HP_M4] = NULL, |
1837 | [STAC_HP_DV5] = NULL, | 1838 | [STAC_HP_DV5] = NULL, |
1838 | [STAC_HP_HDX] = NULL, | 1839 | [STAC_HP_HDX] = NULL, |
1840 | [STAC_HP_DV4_1222NR] = NULL, | ||
1839 | }; | 1841 | }; |
1840 | 1842 | ||
1841 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | 1843 | static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { |
@@ -1847,6 +1849,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { | |||
1847 | [STAC_HP_M4] = "hp-m4", | 1849 | [STAC_HP_M4] = "hp-m4", |
1848 | [STAC_HP_DV5] = "hp-dv5", | 1850 | [STAC_HP_DV5] = "hp-dv5", |
1849 | [STAC_HP_HDX] = "hp-hdx", | 1851 | [STAC_HP_HDX] = "hp-hdx", |
1852 | [STAC_HP_DV4_1222NR] = "hp-dv4-1222nr", | ||
1850 | }; | 1853 | }; |
1851 | 1854 | ||
1852 | static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | 1855 | static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { |
@@ -1855,6 +1858,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | |||
1855 | "DFI LanParty", STAC_92HD71BXX_REF), | 1858 | "DFI LanParty", STAC_92HD71BXX_REF), |
1856 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, | 1859 | SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101, |
1857 | "DFI LanParty", STAC_92HD71BXX_REF), | 1860 | "DFI LanParty", STAC_92HD71BXX_REF), |
1861 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb, | ||
1862 | "HP dv4-1222nr", STAC_HP_DV4_1222NR), | ||
1858 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, | 1863 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, |
1859 | "HP", STAC_HP_DV5), | 1864 | "HP", STAC_HP_DV5), |
1860 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, | 1865 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, |
@@ -4520,27 +4525,38 @@ static int stac92xx_resume(struct hda_codec *codec) | |||
4520 | return 0; | 4525 | return 0; |
4521 | } | 4526 | } |
4522 | 4527 | ||
4523 | |||
4524 | /* | 4528 | /* |
4525 | * using power check for controlling mute led of HP HDX notebooks | 4529 | * using power check for controlling mute led of HP notebooks |
4526 | * check for mute state only on Speakers (nid = 0x10) | 4530 | * check for mute state only on Speakers (nid = 0x10) |
4527 | * | 4531 | * |
4528 | * For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise | 4532 | * For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise |
4529 | * the LED is NOT working properly ! | 4533 | * the LED is NOT working properly ! |
4534 | * | ||
4535 | * Changed name to reflect that it now works for any designated | ||
4536 | * model, not just HP HDX. | ||
4530 | */ | 4537 | */ |
4531 | 4538 | ||
4532 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 4539 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
4533 | static int stac92xx_hp_hdx_check_power_status(struct hda_codec *codec, | 4540 | static int stac92xx_hp_check_power_status(struct hda_codec *codec, |
4534 | hda_nid_t nid) | 4541 | hda_nid_t nid) |
4535 | { | 4542 | { |
4536 | struct sigmatel_spec *spec = codec->spec; | 4543 | struct sigmatel_spec *spec = codec->spec; |
4544 | unsigned int gpio_bit = 0; /* gets rid of compiler warning */ | ||
4545 | |||
4546 | switch (spec->board_config) { | ||
4547 | case STAC_HP_DV4_1222NR: | ||
4548 | gpio_bit = 0x01; | ||
4549 | break; | ||
4550 | case STAC_HP_HDX: | ||
4551 | gpio_bit = 0x08; | ||
4552 | } | ||
4537 | 4553 | ||
4538 | if (nid == 0x10) { | 4554 | if (nid == 0x10) { |
4539 | if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & | 4555 | if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & |
4540 | HDA_AMP_MUTE) | 4556 | HDA_AMP_MUTE) |
4541 | spec->gpio_data &= ~0x08; /* orange */ | 4557 | spec->gpio_data &= ~gpio_bit; /* orange */ |
4542 | else | 4558 | else |
4543 | spec->gpio_data |= 0x08; /* white */ | 4559 | spec->gpio_data |= gpio_bit; /* white */ |
4544 | 4560 | ||
4545 | stac_gpio_set(codec, spec->gpio_mask, | 4561 | stac_gpio_set(codec, spec->gpio_mask, |
4546 | spec->gpio_dir, | 4562 | spec->gpio_dir, |
@@ -5219,6 +5235,22 @@ again: | |||
5219 | spec->num_smuxes = 0; | 5235 | spec->num_smuxes = 0; |
5220 | spec->num_dmuxes = 1; | 5236 | spec->num_dmuxes = 1; |
5221 | break; | 5237 | break; |
5238 | case STAC_HP_DV4_1222NR: | ||
5239 | spec->num_dmics = 1; | ||
5240 | /* I don't know if it needs 1 or 2 smuxes - will wait for | ||
5241 | * bug reports to fix if needed | ||
5242 | */ | ||
5243 | spec->num_smuxes = 1; | ||
5244 | spec->num_dmuxes = 1; | ||
5245 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
5246 | /* This controls MUTE LED */ | ||
5247 | spec->gpio_mask |= 0x01; | ||
5248 | spec->gpio_dir |= 0x01; | ||
5249 | spec->gpio_data |= 0x01; | ||
5250 | codec->patch_ops.check_power_status = | ||
5251 | stac92xx_hp_check_power_status; | ||
5252 | #endif | ||
5253 | /* fallthrough */ | ||
5222 | case STAC_HP_DV5: | 5254 | case STAC_HP_DV5: |
5223 | snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); | 5255 | snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); |
5224 | stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN); | 5256 | stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN); |
@@ -5239,7 +5271,7 @@ again: | |||
5239 | 5271 | ||
5240 | /* register check_power_status callback. */ | 5272 | /* register check_power_status callback. */ |
5241 | codec->patch_ops.check_power_status = | 5273 | codec->patch_ops.check_power_status = |
5242 | stac92xx_hp_hdx_check_power_status; | 5274 | stac92xx_hp_check_power_status; |
5243 | #endif | 5275 | #endif |
5244 | break; | 5276 | break; |
5245 | }; | 5277 | }; |