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.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index c39deebb588f..3dd4eee70b7c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -81,6 +81,7 @@ enum {
81 81
82enum { 82enum {
83 STAC_92HD83XXX_REF, 83 STAC_92HD83XXX_REF,
84 STAC_92HD83XXX_PWR_REF,
84 STAC_92HD83XXX_MODELS 85 STAC_92HD83XXX_MODELS
85}; 86};
86 87
@@ -334,7 +335,7 @@ static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
334}; 335};
335 336
336static unsigned int stac92hd83xxx_pwr_mapping[4] = { 337static unsigned int stac92hd83xxx_pwr_mapping[4] = {
337 0x03, 0x0c, 0x10, 0x40, 338 0x03, 0x0c, 0x20, 0x40,
338}; 339};
339 340
340static hda_nid_t stac92hd83xxx_amp_nids[1] = { 341static hda_nid_t stac92hd83xxx_amp_nids[1] = {
@@ -841,10 +842,6 @@ static struct hda_verb stac92hd73xx_10ch_core_init[] = {
841}; 842};
842 843
843static struct hda_verb stac92hd83xxx_core_init[] = { 844static struct hda_verb stac92hd83xxx_core_init[] = {
844 /* start of config #1 */
845 { 0xe, AC_VERB_SET_CONNECT_SEL, 0x3},
846
847 /* start of config #2 */
848 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0}, 845 { 0xa, AC_VERB_SET_CONNECT_SEL, 0x0},
849 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0}, 846 { 0xb, AC_VERB_SET_CONNECT_SEL, 0x0},
850 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1}, 847 { 0xd, AC_VERB_SET_CONNECT_SEL, 0x1},
@@ -885,8 +882,8 @@ static struct hda_verb stac92hd71bxx_analog_core_init[] = {
885static struct hda_verb stac925x_core_init[] = { 882static struct hda_verb stac925x_core_init[] = {
886 /* set dac0mux for dac converter */ 883 /* set dac0mux for dac converter */
887 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00}, 884 { 0x06, AC_VERB_SET_CONNECT_SEL, 0x00},
888 /* unmute and set max the selector */ 885 /* mute the master volume */
889 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f }, 886 { 0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
890 {} 887 {}
891}; 888};
892 889
@@ -1138,6 +1135,8 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = {
1138}; 1135};
1139 1136
1140static struct snd_kcontrol_new stac925x_mixer[] = { 1137static struct snd_kcontrol_new stac925x_mixer[] = {
1138 HDA_CODEC_VOLUME("Master Playback Volume", 0x0e, 0, HDA_OUTPUT),
1139 HDA_CODEC_MUTE("Master Playback Switch", 0x0e, 0, HDA_OUTPUT),
1141 STAC_INPUT_SOURCE(1), 1140 STAC_INPUT_SOURCE(1),
1142 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), 1141 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT),
1143 HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT), 1142 HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT),
@@ -1736,10 +1735,12 @@ static unsigned int ref92hd83xxx_pin_configs[14] = {
1736 1735
1737static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { 1736static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
1738 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs, 1737 [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
1738 [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
1739}; 1739};
1740 1740
1741static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { 1741static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
1742 [STAC_92HD83XXX_REF] = "ref", 1742 [STAC_92HD83XXX_REF] = "ref",
1743 [STAC_92HD83XXX_PWR_REF] = "mic-ref",
1743}; 1744};
1744 1745
1745static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = { 1746static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
@@ -1799,6 +1800,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1799 "HP dv5", STAC_HP_M4), 1800 "HP dv5", STAC_HP_M4),
1800 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4, 1801 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
1801 "HP dv7", STAC_HP_M4), 1802 "HP dv7", STAC_HP_M4),
1803 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7,
1804 "HP dv4", STAC_HP_DV5),
1802 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc, 1805 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
1803 "HP dv7", STAC_HP_M4), 1806 "HP dv7", STAC_HP_M4),
1804 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603, 1807 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
@@ -3573,13 +3576,12 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3573 err = stac92xx_auto_fill_dac_nids(codec); 3576 err = stac92xx_auto_fill_dac_nids(codec);
3574 if (err < 0) 3577 if (err < 0)
3575 return err; 3578 return err;
3579 err = stac92xx_auto_create_multi_out_ctls(codec,
3580 &spec->autocfg);
3581 if (err < 0)
3582 return err;
3576 } 3583 }
3577 3584
3578 err = stac92xx_auto_create_multi_out_ctls(codec, &spec->autocfg);
3579
3580 if (err < 0)
3581 return err;
3582
3583 /* setup analog beep controls */ 3585 /* setup analog beep controls */
3584 if (spec->anabeep_nid > 0) { 3586 if (spec->anabeep_nid > 0) {
3585 err = stac92xx_auto_create_beep_ctls(codec, 3587 err = stac92xx_auto_create_beep_ctls(codec,
@@ -4753,7 +4755,9 @@ static struct hda_input_mux stac92hd83xxx_dmux = {
4753static int patch_stac92hd83xxx(struct hda_codec *codec) 4755static int patch_stac92hd83xxx(struct hda_codec *codec)
4754{ 4756{
4755 struct sigmatel_spec *spec; 4757 struct sigmatel_spec *spec;
4758 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1];
4756 int err; 4759 int err;
4760 int num_dacs;
4757 4761
4758 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 4762 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4759 if (spec == NULL) 4763 if (spec == NULL)
@@ -4772,15 +4776,16 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4772 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 4776 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4773 spec->multiout.dac_nids = spec->dac_nids; 4777 spec->multiout.dac_nids = spec->dac_nids;
4774 4778
4775 spec->init = stac92hd83xxx_core_init;
4776 switch (codec->vendor_id) {
4777 case 0x111d7605:
4778 break;
4779 default:
4780 spec->num_pwrs--;
4781 spec->init++; /* switch to config #2 */
4782 }
4783 4779
4780 /* set port 0xe to select the last DAC
4781 */
4782 num_dacs = snd_hda_get_connections(codec, 0x0e,
4783 conn, STAC92HD83_DAC_COUNT + 1) - 1;
4784
4785 snd_hda_codec_write_cache(codec, 0xe, 0,
4786 AC_VERB_SET_CONNECT_SEL, num_dacs);
4787
4788 spec->init = stac92hd83xxx_core_init;
4784 spec->mixer = stac92hd83xxx_mixer; 4789 spec->mixer = stac92hd83xxx_mixer;
4785 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); 4790 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
4786 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); 4791 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids);
@@ -4806,6 +4811,15 @@ again:
4806 return err; 4811 return err;
4807 } 4812 }
4808 4813
4814 switch (codec->vendor_id) {
4815 case 0x111d7604:
4816 case 0x111d7605:
4817 if (spec->board_config == STAC_92HD83XXX_PWR_REF)
4818 break;
4819 spec->num_pwrs = 0;
4820 break;
4821 }
4822
4809 err = stac92xx_parse_auto_config(codec, 0x1d, 0); 4823 err = stac92xx_parse_auto_config(codec, 0x1d, 0);
4810 if (!err) { 4824 if (!err) {
4811 if (spec->board_config < 0) { 4825 if (spec->board_config < 0) {