aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_conexant.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 19f0daf6497d..9867afc7895e 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -85,6 +85,7 @@ struct conexant_spec {
85 unsigned int auto_mic; 85 unsigned int auto_mic;
86 int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ 86 int auto_mic_ext; /* autocfg.inputs[] index for ext mic */
87 unsigned int need_dac_fix; 87 unsigned int need_dac_fix;
88 hda_nid_t slave_dig_outs[2];
88 89
89 /* capture */ 90 /* capture */
90 unsigned int num_adc_nids; 91 unsigned int num_adc_nids;
@@ -353,6 +354,8 @@ static int conexant_build_pcms(struct hda_codec *codec)
353 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = 354 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid =
354 spec->dig_in_nid; 355 spec->dig_in_nid;
355 } 356 }
357 if (spec->slave_dig_outs[0])
358 codec->slave_dig_outs = spec->slave_dig_outs;
356 } 359 }
357 360
358 return 0; 361 return 0;
@@ -2101,7 +2104,7 @@ static int patch_cxt5051(struct hda_codec *codec)
2101static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; 2104static hda_nid_t cxt5066_dac_nids[1] = { 0x10 };
2102static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; 2105static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 };
2103static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; 2106static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 };
2104#define CXT5066_SPDIF_OUT 0x21 2107static hda_nid_t cxt5066_digout_pin_nids[2] = { 0x20, 0x22 };
2105 2108
2106/* OLPC's microphone port is DC coupled for use with external sensors, 2109/* OLPC's microphone port is DC coupled for use with external sensors,
2107 * therefore we use a 50% mic bias in order to center the input signal with 2110 * therefore we use a 50% mic bias in order to center the input signal with
@@ -2623,6 +2626,27 @@ static void cxt5066_olpc_capture_cleanup(struct hda_codec *codec)
2623 spec->recording = 0; 2626 spec->recording = 0;
2624} 2627}
2625 2628
2629static void conexant_check_dig_outs(struct hda_codec *codec,
2630 hda_nid_t *dig_pins,
2631 int num_pins)
2632{
2633 struct conexant_spec *spec = codec->spec;
2634 hda_nid_t *nid_loc = &spec->multiout.dig_out_nid;
2635 int i;
2636
2637 for (i = 0; i < num_pins; i++, dig_pins++) {
2638 unsigned int cfg = snd_hda_codec_get_pincfg(codec, *dig_pins);
2639 if (get_defcfg_connect(cfg) == AC_JACK_PORT_NONE)
2640 continue;
2641 if (snd_hda_get_connections(codec, *dig_pins, nid_loc, 1) != 1)
2642 continue;
2643 if (spec->slave_dig_outs[0])
2644 nid_loc++;
2645 else
2646 nid_loc = spec->slave_dig_outs;
2647 }
2648}
2649
2626static struct hda_input_mux cxt5066_capture_source = { 2650static struct hda_input_mux cxt5066_capture_source = {
2627 .num_items = 4, 2651 .num_items = 4,
2628 .items = { 2652 .items = {
@@ -3085,8 +3109,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3085 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), 3109 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
3086 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3110 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
3087 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 3111 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
3088 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), 3112 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS),
3089 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), 3113 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS),
3114 SND_PCI_QUIRK(0x1043, 0x1993, "Asus U50F", CXT5066_ASUS),
3090 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), 3115 SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD),
3091 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), 3116 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
3092 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), 3117 SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5),
@@ -3118,7 +3143,8 @@ static int patch_cxt5066(struct hda_codec *codec)
3118 spec->multiout.max_channels = 2; 3143 spec->multiout.max_channels = 2;
3119 spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); 3144 spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids);
3120 spec->multiout.dac_nids = cxt5066_dac_nids; 3145 spec->multiout.dac_nids = cxt5066_dac_nids;
3121 spec->multiout.dig_out_nid = CXT5066_SPDIF_OUT; 3146 conexant_check_dig_outs(codec, cxt5066_digout_pin_nids,
3147 ARRAY_SIZE(cxt5066_digout_pin_nids));
3122 spec->num_adc_nids = 1; 3148 spec->num_adc_nids = 1;
3123 spec->adc_nids = cxt5066_adc_nids; 3149 spec->adc_nids = cxt5066_adc_nids;
3124 spec->capsrc_nids = cxt5066_capsrc_nids; 3150 spec->capsrc_nids = cxt5066_capsrc_nids;
@@ -3164,7 +3190,8 @@ static int patch_cxt5066(struct hda_codec *codec)
3164 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 3190 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master;
3165 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 3191 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
3166 /* no S/PDIF out */ 3192 /* no S/PDIF out */
3167 spec->multiout.dig_out_nid = 0; 3193 if (board_config == CXT5066_HP_LAPTOP)
3194 spec->multiout.dig_out_nid = 0;
3168 /* input source automatically selected */ 3195 /* input source automatically selected */
3169 spec->input_mux = NULL; 3196 spec->input_mux = NULL;
3170 spec->port_d_mode = 0; 3197 spec->port_d_mode = 0;