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.c56
1 files changed, 36 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index c39deebb588f..b787b3cc096f 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,
@@ -2536,6 +2539,8 @@ static int stac92xx_build_pcms(struct hda_codec *codec)
2536 2539
2537 info->name = "STAC92xx Analog"; 2540 info->name = "STAC92xx Analog";
2538 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_analog_playback; 2541 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_analog_playback;
2542 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
2543 spec->multiout.dac_nids[0];
2539 info->stream[SNDRV_PCM_STREAM_CAPTURE] = stac92xx_pcm_analog_capture; 2544 info->stream[SNDRV_PCM_STREAM_CAPTURE] = stac92xx_pcm_analog_capture;
2540 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0]; 2545 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
2541 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adcs; 2546 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adcs;
@@ -3573,13 +3578,12 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3573 err = stac92xx_auto_fill_dac_nids(codec); 3578 err = stac92xx_auto_fill_dac_nids(codec);
3574 if (err < 0) 3579 if (err < 0)
3575 return err; 3580 return err;
3581 err = stac92xx_auto_create_multi_out_ctls(codec,
3582 &spec->autocfg);
3583 if (err < 0)
3584 return err;
3576 } 3585 }
3577 3586
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 */ 3587 /* setup analog beep controls */
3584 if (spec->anabeep_nid > 0) { 3588 if (spec->anabeep_nid > 0) {
3585 err = stac92xx_auto_create_beep_ctls(codec, 3589 err = stac92xx_auto_create_beep_ctls(codec,
@@ -4753,7 +4757,9 @@ static struct hda_input_mux stac92hd83xxx_dmux = {
4753static int patch_stac92hd83xxx(struct hda_codec *codec) 4757static int patch_stac92hd83xxx(struct hda_codec *codec)
4754{ 4758{
4755 struct sigmatel_spec *spec; 4759 struct sigmatel_spec *spec;
4760 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1];
4756 int err; 4761 int err;
4762 int num_dacs;
4757 4763
4758 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 4764 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4759 if (spec == NULL) 4765 if (spec == NULL)
@@ -4772,15 +4778,16 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
4772 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids); 4778 spec->num_pwrs = ARRAY_SIZE(stac92hd83xxx_pwr_nids);
4773 spec->multiout.dac_nids = spec->dac_nids; 4779 spec->multiout.dac_nids = spec->dac_nids;
4774 4780
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 4781
4782 /* set port 0xe to select the last DAC
4783 */
4784 num_dacs = snd_hda_get_connections(codec, 0x0e,
4785 conn, STAC92HD83_DAC_COUNT + 1) - 1;
4786
4787 snd_hda_codec_write_cache(codec, 0xe, 0,
4788 AC_VERB_SET_CONNECT_SEL, num_dacs);
4789
4790 spec->init = stac92hd83xxx_core_init;
4784 spec->mixer = stac92hd83xxx_mixer; 4791 spec->mixer = stac92hd83xxx_mixer;
4785 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids); 4792 spec->num_pins = ARRAY_SIZE(stac92hd83xxx_pin_nids);
4786 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids); 4793 spec->num_dmuxes = ARRAY_SIZE(stac92hd83xxx_dmux_nids);
@@ -4806,6 +4813,15 @@ again:
4806 return err; 4813 return err;
4807 } 4814 }
4808 4815
4816 switch (codec->vendor_id) {
4817 case 0x111d7604:
4818 case 0x111d7605:
4819 if (spec->board_config == STAC_92HD83XXX_PWR_REF)
4820 break;
4821 spec->num_pwrs = 0;
4822 break;
4823 }
4824
4809 err = stac92xx_parse_auto_config(codec, 0x1d, 0); 4825 err = stac92xx_parse_auto_config(codec, 0x1d, 0);
4810 if (!err) { 4826 if (!err) {
4811 if (spec->board_config < 0) { 4827 if (spec->board_config < 0) {