aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorChristoph Plattner <christoph.plattner@gmx.at>2009-03-08 18:19:05 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-10 02:35:20 -0400
commitae6241fbf5c8863631532e8069037bae460607be (patch)
treed1f6ee59ef1ead2461d383c132a716af95096c8e /sound/pci
parent139e071b0ff37800ed0a68b10c4bb325f51786eb (diff)
ALSA: hda - Added HP HDX16/HDX18 notebook support for HDA codecs (82HD71)
Added codec recognition of HP HDX platforms and added support of the MUTE LED (orange/white). For this feature the CONFIG_SND_HDA_POWER_SAVE is needed to use event handling for mute control. Signed-off-by: Christoph Plattner <christoph.plattner@gmx.at> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 123bcf7c3b24..fb9f4ccba885 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -99,6 +99,7 @@ enum {
99 STAC_DELL_M4_3, 99 STAC_DELL_M4_3,
100 STAC_HP_M4, 100 STAC_HP_M4,
101 STAC_HP_DV5, 101 STAC_HP_DV5,
102 STAC_HP_HDX,
102 STAC_92HD71BXX_MODELS 103 STAC_92HD71BXX_MODELS
103}; 104};
104 105
@@ -1828,6 +1829,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1828 [STAC_DELL_M4_3] = dell_m4_3_pin_configs, 1829 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1829 [STAC_HP_M4] = NULL, 1830 [STAC_HP_M4] = NULL,
1830 [STAC_HP_DV5] = NULL, 1831 [STAC_HP_DV5] = NULL,
1832 [STAC_HP_HDX] = NULL,
1831}; 1833};
1832 1834
1833static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { 1835static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
@@ -1838,6 +1840,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1838 [STAC_DELL_M4_3] = "dell-m4-3", 1840 [STAC_DELL_M4_3] = "dell-m4-3",
1839 [STAC_HP_M4] = "hp-m4", 1841 [STAC_HP_M4] = "hp-m4",
1840 [STAC_HP_DV5] = "hp-dv5", 1842 [STAC_HP_DV5] = "hp-dv5",
1843 [STAC_HP_HDX] = "hp-hdx",
1841}; 1844};
1842 1845
1843static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { 1846static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
@@ -1852,6 +1855,10 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1852 "HP dv4-7", STAC_HP_DV5), 1855 "HP dv4-7", STAC_HP_DV5),
1853 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a, 1856 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1854 "HP mini 1000", STAC_HP_M4), 1857 "HP mini 1000", STAC_HP_M4),
1858 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b,
1859 "HP HDX", STAC_HP_HDX), /* HDX16 */
1860 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3610,
1861 "HP HDX", STAC_HP_HDX), /* HDX18 */
1855 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1862 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
1856 "unknown Dell", STAC_DELL_M4_1), 1863 "unknown Dell", STAC_DELL_M4_1),
1857 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234, 1864 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0234,
@@ -4472,6 +4479,41 @@ static int stac92xx_resume(struct hda_codec *codec)
4472 return 0; 4479 return 0;
4473} 4480}
4474 4481
4482
4483/*
4484 * using power check for controlling mute led of HP HDX notebooks
4485 * check for mute state only on Speakers (nid = 0x10)
4486 *
4487 * For this feature CONFIG_SND_HDA_POWER_SAVE is needed, otherwise
4488 * the LED is NOT working properly !
4489 */
4490
4491#ifdef CONFIG_SND_HDA_POWER_SAVE
4492static int stac92xx_check_power_status (struct hda_codec * codec, hda_nid_t nid)
4493{
4494 struct sigmatel_spec *spec = codec->spec;
4495
4496 /* only handle on HP HDX */
4497 if (spec->board_config != STAC_HP_HDX)
4498 return 0;
4499
4500 if (nid == 0x10)
4501 {
4502 if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
4503 HDA_AMP_MUTE)
4504 spec->gpio_data &= ~0x08; /* orange */
4505 else
4506 spec->gpio_data |= 0x08; /* white */
4507
4508 stac_gpio_set(codec, spec->gpio_mask,
4509 spec->gpio_dir,
4510 spec->gpio_data);
4511 }
4512
4513 return 0;
4514}
4515#endif
4516
4475static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) 4517static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state)
4476{ 4518{
4477 struct sigmatel_spec *spec = codec->spec; 4519 struct sigmatel_spec *spec = codec->spec;
@@ -4493,6 +4535,9 @@ static struct hda_codec_ops stac92xx_patch_ops = {
4493 .suspend = stac92xx_suspend, 4535 .suspend = stac92xx_suspend,
4494 .resume = stac92xx_resume, 4536 .resume = stac92xx_resume,
4495#endif 4537#endif
4538#ifdef CONFIG_SND_HDA_POWER_SAVE
4539 .check_power_status = stac92xx_check_power_status,
4540#endif
4496}; 4541};
4497 4542
4498static int patch_stac9200(struct hda_codec *codec) 4543static int patch_stac9200(struct hda_codec *codec)
@@ -5089,6 +5134,13 @@ again:
5089 /* no output amps */ 5134 /* no output amps */
5090 spec->num_pwrs = 0; 5135 spec->num_pwrs = 0;
5091 /* fallthru */ 5136 /* fallthru */
5137 case 0x111d76b2: /* Codec of HP HDX16/HDX18 */
5138
5139 /* orange/white mute led on GPIO3, orange=0, white=1 */
5140 spec->gpio_mask |= 0x08;
5141 spec->gpio_dir |= 0x08;
5142 spec->gpio_data |= 0x08; /* set to white */
5143 /* fallthru */
5092 default: 5144 default:
5093 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer, 5145 memcpy(&spec->private_dimux, &stac92hd71bxx_dmux_amixer,
5094 sizeof(stac92hd71bxx_dmux_amixer)); 5146 sizeof(stac92hd71bxx_dmux_amixer));
@@ -5143,6 +5195,11 @@ again:
5143 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); 5195 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
5144 stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN); 5196 stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN);
5145 break; 5197 break;
5198 case STAC_HP_HDX:
5199 spec->num_dmics = 1;
5200 spec->num_dmuxes = 1;
5201 spec->num_smuxes = 1;
5202 break;
5146 }; 5203 };
5147 5204
5148 spec->multiout.dac_nids = spec->dac_nids; 5205 spec->multiout.dac_nids = spec->dac_nids;