aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-09-20 03:14:04 -0400
committerTakashi Iwai <tiwai@suse.de>2011-09-20 03:14:04 -0400
commit290b421f699463478d215c17cd6be52d78e16976 (patch)
tree27a2a4555feed1adc9b0ada4e746b13298f3ce67 /sound/pci/hda/patch_conexant.c
parent356aab7d419822f413af5fe1bc47af40957a23fb (diff)
parent46724c2e023cb7ba5cd5000dee6481f0a15ebed9 (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 197ad936c84d..aa0e4b95c26c 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3329,18 +3329,26 @@ static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs)
3329/* fill pin_dac_pair list from the pin and dac list */ 3329/* fill pin_dac_pair list from the pin and dac list */
3330static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins, 3330static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins,
3331 int num_pins, hda_nid_t *dacs, int *rest, 3331 int num_pins, hda_nid_t *dacs, int *rest,
3332 struct pin_dac_pair *filled, int type) 3332 struct pin_dac_pair *filled, int nums,
3333 int type)
3333{ 3334{
3334 int i, nums; 3335 int i, start = nums;
3335 3336
3336 nums = 0; 3337 for (i = 0; i < num_pins; i++, nums++) {
3337 for (i = 0; i < num_pins; i++) {
3338 filled[nums].pin = pins[i]; 3338 filled[nums].pin = pins[i];
3339 filled[nums].type = type; 3339 filled[nums].type = type;
3340 filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest); 3340 filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest);
3341 if (!filled[nums].dac && i > 0 && filled[0].dac) 3341 if (filled[nums].dac)
3342 continue;
3343 if (filled[start].dac && get_connection_index(codec, pins[i], filled[start].dac) >= 0) {
3344 filled[nums].dac = filled[start].dac | DAC_SLAVE_FLAG;
3345 continue;
3346 }
3347 if (filled[0].dac && get_connection_index(codec, pins[i], filled[0].dac) >= 0) {
3342 filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG; 3348 filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG;
3343 nums++; 3349 continue;
3350 }
3351 snd_printdd("Failed to find a DAC for pin 0x%x", pins[i]);
3344 } 3352 }
3345 return nums; 3353 return nums;
3346} 3354}
@@ -3356,14 +3364,14 @@ static void cx_auto_parse_output(struct hda_codec *codec)
3356 rest = fill_cx_auto_dacs(codec, dacs); 3364 rest = fill_cx_auto_dacs(codec, dacs);
3357 /* parse all analog output pins */ 3365 /* parse all analog output pins */
3358 nums = fill_dacs_for_pins(codec, cfg->line_out_pins, cfg->line_outs, 3366 nums = fill_dacs_for_pins(codec, cfg->line_out_pins, cfg->line_outs,
3359 dacs, &rest, spec->dac_info, 3367 dacs, &rest, spec->dac_info, 0,
3360 AUTO_PIN_LINE_OUT); 3368 AUTO_PIN_LINE_OUT);
3361 nums += fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs, 3369 nums = fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs,
3362 dacs, &rest, spec->dac_info + nums, 3370 dacs, &rest, spec->dac_info, nums,
3363 AUTO_PIN_HP_OUT); 3371 AUTO_PIN_HP_OUT);
3364 nums += fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs, 3372 nums = fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs,
3365 dacs, &rest, spec->dac_info + nums, 3373 dacs, &rest, spec->dac_info, nums,
3366 AUTO_PIN_SPEAKER_OUT); 3374 AUTO_PIN_SPEAKER_OUT);
3367 spec->dac_info_filled = nums; 3375 spec->dac_info_filled = nums;
3368 /* fill multiout struct */ 3376 /* fill multiout struct */
3369 for (i = 0; i < nums; i++) { 3377 for (i = 0; i < nums; i++) {
@@ -4130,9 +4138,11 @@ static int try_add_pb_volume(struct hda_codec *codec, hda_nid_t dac,
4130 hda_nid_t pin, const char *name, int idx) 4138 hda_nid_t pin, const char *name, int idx)
4131{ 4139{
4132 unsigned int caps; 4140 unsigned int caps;
4133 caps = query_amp_caps(codec, dac, HDA_OUTPUT); 4141 if (dac && !(dac & DAC_SLAVE_FLAG)) {
4134 if (caps & AC_AMPCAP_NUM_STEPS) 4142 caps = query_amp_caps(codec, dac, HDA_OUTPUT);
4135 return cx_auto_add_pb_volume(codec, dac, name, idx); 4143 if (caps & AC_AMPCAP_NUM_STEPS)
4144 return cx_auto_add_pb_volume(codec, dac, name, idx);
4145 }
4136 caps = query_amp_caps(codec, pin, HDA_OUTPUT); 4146 caps = query_amp_caps(codec, pin, HDA_OUTPUT);
4137 if (caps & AC_AMPCAP_NUM_STEPS) 4147 if (caps & AC_AMPCAP_NUM_STEPS)
4138 return cx_auto_add_pb_volume(codec, pin, name, idx); 4148 return cx_auto_add_pb_volume(codec, pin, name, idx);
@@ -4155,8 +4165,6 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
4155 const char *label; 4165 const char *label;
4156 int idx, type; 4166 int idx, type;
4157 hda_nid_t dac = spec->dac_info[i].dac; 4167 hda_nid_t dac = spec->dac_info[i].dac;
4158 if (!dac || (dac & DAC_SLAVE_FLAG))
4159 continue;
4160 type = spec->dac_info[i].type; 4168 type = spec->dac_info[i].type;
4161 if (type == AUTO_PIN_LINE_OUT) 4169 if (type == AUTO_PIN_LINE_OUT)
4162 type = spec->autocfg.line_out_type; 4170 type = spec->autocfg.line_out_type;