aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 07675282015a..3d4722f0a1ca 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -101,6 +101,8 @@ enum {
101 STAC_92HD83XXX_HP_cNB11_INTQUAD, 101 STAC_92HD83XXX_HP_cNB11_INTQUAD,
102 STAC_HP_DV7_4000, 102 STAC_HP_DV7_4000,
103 STAC_HP_ZEPHYR, 103 STAC_HP_ZEPHYR,
104 STAC_92HD83XXX_HP_LED,
105 STAC_92HD83XXX_HP_INV_LED,
104 STAC_92HD83XXX_MODELS 106 STAC_92HD83XXX_MODELS
105}; 107};
106 108
@@ -1073,7 +1075,7 @@ static struct snd_kcontrol_new stac_smux_mixer = {
1073 1075
1074static const char * const slave_pfxs[] = { 1076static const char * const slave_pfxs[] = {
1075 "Front", "Surround", "Center", "LFE", "Side", 1077 "Front", "Surround", "Center", "LFE", "Side",
1076 "Headphone", "Speaker", "IEC958", 1078 "Headphone", "Speaker", "IEC958", "PCM",
1077 NULL 1079 NULL
1078}; 1080};
1079 1081
@@ -1675,6 +1677,8 @@ static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1675 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = "hp_cNB11_intquad", 1677 [STAC_92HD83XXX_HP_cNB11_INTQUAD] = "hp_cNB11_intquad",
1676 [STAC_HP_DV7_4000] = "hp-dv7-4000", 1678 [STAC_HP_DV7_4000] = "hp-dv7-4000",
1677 [STAC_HP_ZEPHYR] = "hp-zephyr", 1679 [STAC_HP_ZEPHYR] = "hp-zephyr",
1680 [STAC_92HD83XXX_HP_LED] = "hp-led",
1681 [STAC_92HD83XXX_HP_INV_LED] = "hp-inv-led",
1678}; 1682};
1679 1683
1680static const struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1684static const struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
@@ -1729,6 +1733,8 @@ static const struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
1729 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD), 1733 "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
1730 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3561, 1734 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3561,
1731 "HP", STAC_HP_ZEPHYR), 1735 "HP", STAC_HP_ZEPHYR),
1736 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3660,
1737 "HP Mini", STAC_92HD83XXX_HP_LED),
1732 {} /* terminator */ 1738 {} /* terminator */
1733}; 1739};
1734 1740
@@ -4266,7 +4272,8 @@ static int stac92xx_init(struct hda_codec *codec)
4266 unsigned int gpio; 4272 unsigned int gpio;
4267 int i; 4273 int i;
4268 4274
4269 snd_hda_sequence_write(codec, spec->init); 4275 if (spec->init)
4276 snd_hda_sequence_write(codec, spec->init);
4270 4277
4271 /* power down adcs initially */ 4278 /* power down adcs initially */
4272 if (spec->powerdown_adcs) 4279 if (spec->powerdown_adcs)
@@ -4414,7 +4421,12 @@ static int stac92xx_init(struct hda_codec *codec)
4414 snd_hda_jack_report_sync(codec); 4421 snd_hda_jack_report_sync(codec);
4415 4422
4416 /* sync mute LED */ 4423 /* sync mute LED */
4417 snd_hda_sync_vmaster_hook(&spec->vmaster_mute); 4424 if (spec->gpio_led) {
4425 if (spec->vmaster_mute.hook)
4426 snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
4427 else /* the very first init call doesn't have vmaster yet */
4428 stac92xx_update_led_status(codec, false);
4429 }
4418 4430
4419 /* sync the power-map */ 4431 /* sync the power-map */
4420 if (spec->num_pwrs) 4432 if (spec->num_pwrs)
@@ -4531,6 +4543,9 @@ static void stac92xx_line_out_detect(struct hda_codec *codec,
4531 struct auto_pin_cfg *cfg = &spec->autocfg; 4543 struct auto_pin_cfg *cfg = &spec->autocfg;
4532 int i; 4544 int i;
4533 4545
4546 if (cfg->speaker_outs == 0)
4547 return;
4548
4534 for (i = 0; i < cfg->line_outs; i++) { 4549 for (i = 0; i < cfg->line_outs; i++) {
4535 if (presence) 4550 if (presence)
4536 break; 4551 break;
@@ -4997,7 +5012,7 @@ static int stac92xx_resume(struct hda_codec *codec)
4997 return 0; 5012 return 0;
4998} 5013}
4999 5014
5000static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) 5015static int stac92xx_suspend(struct hda_codec *codec)
5001{ 5016{
5002 stac92xx_shutup(codec); 5017 stac92xx_shutup(codec);
5003 return 0; 5018 return 0;
@@ -5507,6 +5522,7 @@ static void stac92hd8x_fill_auto_spec(struct hda_codec *codec)
5507static int patch_stac92hd83xxx(struct hda_codec *codec) 5522static int patch_stac92hd83xxx(struct hda_codec *codec)
5508{ 5523{
5509 struct sigmatel_spec *spec; 5524 struct sigmatel_spec *spec;
5525 int default_polarity = -1; /* no default cfg */
5510 int err; 5526 int err;
5511 5527
5512 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5528 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -5518,6 +5534,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
5518 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e); 5534 snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
5519 } 5535 }
5520 5536
5537 codec->epss = 0; /* longer delay needed for D3 */
5521 codec->no_trigger_sense = 1; 5538 codec->no_trigger_sense = 1;
5522 codec->spec = spec; 5539 codec->spec = spec;
5523 5540
@@ -5555,9 +5572,15 @@ again:
5555 case STAC_HP_ZEPHYR: 5572 case STAC_HP_ZEPHYR:
5556 spec->init = stac92hd83xxx_hp_zephyr_init; 5573 spec->init = stac92hd83xxx_hp_zephyr_init;
5557 break; 5574 break;
5575 case STAC_92HD83XXX_HP_LED:
5576 default_polarity = 0;
5577 break;
5578 case STAC_92HD83XXX_HP_INV_LED:
5579 default_polarity = 1;
5580 break;
5558 } 5581 }
5559 5582
5560 if (find_mute_led_cfg(codec, -1/*no default cfg*/)) 5583 if (find_mute_led_cfg(codec, default_polarity))
5561 snd_printd("mute LED gpio %d polarity %d\n", 5584 snd_printd("mute LED gpio %d polarity %d\n",
5562 spec->gpio_led, 5585 spec->gpio_led,
5563 spec->gpio_led_polarity); 5586 spec->gpio_led_polarity);
@@ -5730,7 +5753,6 @@ again:
5730 /* fallthru */ 5753 /* fallthru */
5731 case 0x111d76b4: /* 6 Port without Analog Mixer */ 5754 case 0x111d76b4: /* 6 Port without Analog Mixer */
5732 case 0x111d76b5: 5755 case 0x111d76b5:
5733 spec->init = stac92hd71bxx_core_init;
5734 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5756 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5735 spec->num_dmics = stac92xx_connected_ports(codec, 5757 spec->num_dmics = stac92xx_connected_ports(codec,
5736 stac92hd71bxx_dmic_nids, 5758 stac92hd71bxx_dmic_nids,
@@ -5755,7 +5777,6 @@ again:
5755 spec->stream_delay = 40; /* 40 milliseconds */ 5777 spec->stream_delay = 40; /* 40 milliseconds */
5756 5778
5757 /* disable VSW */ 5779 /* disable VSW */
5758 spec->init = stac92hd71bxx_core_init;
5759 unmute_init++; 5780 unmute_init++;
5760 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); 5781 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
5761 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); 5782 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
@@ -5770,7 +5791,6 @@ again:
5770 5791
5771 /* fallthru */ 5792 /* fallthru */
5772 default: 5793 default:
5773 spec->init = stac92hd71bxx_core_init;
5774 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5794 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5775 spec->num_dmics = stac92xx_connected_ports(codec, 5795 spec->num_dmics = stac92xx_connected_ports(codec,
5776 stac92hd71bxx_dmic_nids, 5796 stac92hd71bxx_dmic_nids,
@@ -5778,6 +5798,9 @@ again:
5778 break; 5798 break;
5779 } 5799 }
5780 5800
5801 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
5802 spec->init = stac92hd71bxx_core_init;
5803
5781 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) 5804 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
5782 snd_hda_sequence_write_cache(codec, unmute_init); 5805 snd_hda_sequence_write_cache(codec, unmute_init);
5783 5806