aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_sigmatel.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 9563b5bbb272..2b52a4056a9b 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -84,6 +84,7 @@ enum {
84 STAC_92HD71BXX_REF, 84 STAC_92HD71BXX_REF,
85 STAC_DELL_M4_1, 85 STAC_DELL_M4_1,
86 STAC_DELL_M4_2, 86 STAC_DELL_M4_2,
87 STAC_DELL_M4_3,
87 STAC_HP_M4, 88 STAC_HP_M4,
88 STAC_92HD71BXX_MODELS 89 STAC_92HD71BXX_MODELS
89}; 90};
@@ -137,6 +138,7 @@ struct sigmatel_spec {
137 unsigned int num_mixers; 138 unsigned int num_mixers;
138 139
139 int board_config; 140 int board_config;
141 unsigned int eapd_switch: 1;
140 unsigned int surr_switch: 1; 142 unsigned int surr_switch: 1;
141 unsigned int line_switch: 1; 143 unsigned int line_switch: 1;
142 unsigned int mic_switch: 1; 144 unsigned int mic_switch: 1;
@@ -1628,6 +1630,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1628 "unknown Dell", STAC_DELL_M6), 1630 "unknown Dell", STAC_DELL_M6),
1629 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271, 1631 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271,
1630 "unknown Dell", STAC_DELL_M6), 1632 "unknown Dell", STAC_DELL_M6),
1633 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
1634 "Dell Studio 15", STAC_DELL_M6),
1631 {} /* terminator */ 1635 {} /* terminator */
1632}; 1636};
1633 1637
@@ -1670,10 +1674,17 @@ static unsigned int dell_m4_2_pin_configs[11] = {
1670 0x40f000f0, 0x044413b0, 0x044413b0, 1674 0x40f000f0, 0x044413b0, 0x044413b0,
1671}; 1675};
1672 1676
1677static unsigned int dell_m4_3_pin_configs[11] = {
1678 0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
1679 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a000f0,
1680 0x40f000f0, 0x044413b0, 0x044413b0,
1681};
1682
1673static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { 1683static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1674 [STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs, 1684 [STAC_92HD71BXX_REF] = ref92hd71bxx_pin_configs,
1675 [STAC_DELL_M4_1] = dell_m4_1_pin_configs, 1685 [STAC_DELL_M4_1] = dell_m4_1_pin_configs,
1676 [STAC_DELL_M4_2] = dell_m4_2_pin_configs, 1686 [STAC_DELL_M4_2] = dell_m4_2_pin_configs,
1687 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1677 [STAC_HP_M4] = NULL, 1688 [STAC_HP_M4] = NULL,
1678}; 1689};
1679 1690
@@ -1681,6 +1692,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1681 [STAC_92HD71BXX_REF] = "ref", 1692 [STAC_92HD71BXX_REF] = "ref",
1682 [STAC_DELL_M4_1] = "dell-m4-1", 1693 [STAC_DELL_M4_1] = "dell-m4-1",
1683 [STAC_DELL_M4_2] = "dell-m4-2", 1694 [STAC_DELL_M4_2] = "dell-m4-2",
1695 [STAC_DELL_M4_3] = "dell-m4-3",
1684 [STAC_HP_M4] = "hp-m4", 1696 [STAC_HP_M4] = "hp-m4",
1685}; 1697};
1686 1698
@@ -1716,6 +1728,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1716 "unknown Dell", STAC_DELL_M4_2), 1728 "unknown Dell", STAC_DELL_M4_2),
1717 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264, 1729 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0264,
1718 "unknown Dell", STAC_DELL_M4_2), 1730 "unknown Dell", STAC_DELL_M4_2),
1731 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02aa,
1732 "unknown Dell", STAC_DELL_M4_3),
1719 {} /* terminator */ 1733 {} /* terminator */
1720}; 1734};
1721 1735
@@ -3901,7 +3915,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3901 for (i = 0; i < cfg->speaker_outs; i++) 3915 for (i = 0; i < cfg->speaker_outs; i++)
3902 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], 3916 stac92xx_reset_pinctl(codec, cfg->speaker_pins[i],
3903 AC_PINCTL_OUT_EN); 3917 AC_PINCTL_OUT_EN);
3904 if (spec->eapd_mask) 3918 if (spec->eapd_mask && spec->eapd_switch)
3905 stac_gpio_set(codec, spec->gpio_mask, 3919 stac_gpio_set(codec, spec->gpio_mask,
3906 spec->gpio_dir, spec->gpio_data & 3920 spec->gpio_dir, spec->gpio_data &
3907 ~spec->eapd_mask); 3921 ~spec->eapd_mask);
@@ -3916,7 +3930,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
3916 for (i = 0; i < cfg->speaker_outs; i++) 3930 for (i = 0; i < cfg->speaker_outs; i++)
3917 stac92xx_set_pinctl(codec, cfg->speaker_pins[i], 3931 stac92xx_set_pinctl(codec, cfg->speaker_pins[i],
3918 AC_PINCTL_OUT_EN); 3932 AC_PINCTL_OUT_EN);
3919 if (spec->eapd_mask) 3933 if (spec->eapd_mask && spec->eapd_switch)
3920 stac_gpio_set(codec, spec->gpio_mask, 3934 stac_gpio_set(codec, spec->gpio_mask,
3921 spec->gpio_dir, spec->gpio_data | 3935 spec->gpio_dir, spec->gpio_data |
3922 spec->eapd_mask); 3936 spec->eapd_mask);
@@ -4243,6 +4257,7 @@ again:
4243 spec->num_smuxes = 0; 4257 spec->num_smuxes = 0;
4244 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; 4258 spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER];
4245 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; 4259 spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP];
4260 spec->eapd_switch = 0;
4246 spec->num_amps = 1; 4261 spec->num_amps = 1;
4247 4262
4248 if (!spec->init) 4263 if (!spec->init)
@@ -4274,6 +4289,7 @@ again:
4274 default: 4289 default:
4275 spec->num_dmics = STAC92HD73XX_NUM_DMICS; 4290 spec->num_dmics = STAC92HD73XX_NUM_DMICS;
4276 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids); 4291 spec->num_smuxes = ARRAY_SIZE(stac92hd73xx_smux_nids);
4292 spec->eapd_switch = 1;
4277 } 4293 }
4278 if (spec->board_config > STAC_92HD73XX_REF) { 4294 if (spec->board_config > STAC_92HD73XX_REF) {
4279 /* GPIO0 High = Enable EAPD */ 4295 /* GPIO0 High = Enable EAPD */
@@ -4419,7 +4435,13 @@ static int stac92hd71xx_resume(struct hda_codec *codec)
4419 4435
4420static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state) 4436static int stac92hd71xx_suspend(struct hda_codec *codec, pm_message_t state)
4421{ 4437{
4438 struct sigmatel_spec *spec = codec->spec;
4439
4422 stac92hd71xx_set_power_state(codec, AC_PWRST_D3); 4440 stac92hd71xx_set_power_state(codec, AC_PWRST_D3);
4441 if (spec->eapd_mask)
4442 stac_gpio_set(codec, spec->gpio_mask,
4443 spec->gpio_dir, spec->gpio_data &
4444 ~spec->eapd_mask);
4423 return 0; 4445 return 0;
4424}; 4446};
4425 4447
@@ -4562,14 +4584,21 @@ again:
4562 4584
4563 switch (spec->board_config) { 4585 switch (spec->board_config) {
4564 case STAC_HP_M4: 4586 case STAC_HP_M4:
4565 spec->num_dmics = 0;
4566 spec->num_smuxes = 0;
4567 spec->num_dmuxes = 0;
4568
4569 /* enable internal microphone */ 4587 /* enable internal microphone */
4570 stac92xx_set_config_reg(codec, 0x0e, 0x01813040); 4588 stac92xx_set_config_reg(codec, 0x0e, 0x01813040);
4571 stac92xx_auto_set_pinctl(codec, 0x0e, 4589 stac92xx_auto_set_pinctl(codec, 0x0e,
4572 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80); 4590 AC_PINCTL_IN_EN | AC_PINCTL_VREF_80);
4591 /* fallthru */
4592 case STAC_DELL_M4_2:
4593 spec->num_dmics = 0;
4594 spec->num_smuxes = 0;
4595 spec->num_dmuxes = 0;
4596 break;
4597 case STAC_DELL_M4_1:
4598 case STAC_DELL_M4_3:
4599 spec->num_dmics = 1;
4600 spec->num_smuxes = 0;
4601 spec->num_dmuxes = 0;
4573 break; 4602 break;
4574 default: 4603 default:
4575 spec->num_dmics = STAC92HD71BXX_NUM_DMICS; 4604 spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
@@ -4806,6 +4835,7 @@ static int patch_stac927x(struct hda_codec *codec)
4806 spec->num_pwrs = 0; 4835 spec->num_pwrs = 0;
4807 spec->aloopback_mask = 0x40; 4836 spec->aloopback_mask = 0x40;
4808 spec->aloopback_shift = 0; 4837 spec->aloopback_shift = 0;
4838 spec->eapd_switch = 1;
4809 4839
4810 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20); 4840 err = stac92xx_parse_auto_config(codec, 0x1e, 0x20);
4811 if (!err) { 4841 if (!err) {
@@ -4886,6 +4916,7 @@ static int patch_stac9205(struct hda_codec *codec)
4886 4916
4887 spec->aloopback_mask = 0x40; 4917 spec->aloopback_mask = 0x40;
4888 spec->aloopback_shift = 0; 4918 spec->aloopback_shift = 0;
4919 spec->eapd_switch = 1;
4889 spec->multiout.dac_nids = spec->dac_nids; 4920 spec->multiout.dac_nids = spec->dac_nids;
4890 4921
4891 switch (spec->board_config){ 4922 switch (spec->board_config){