aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c50
1 files changed, 6 insertions, 44 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 4348c33c6b85..0ee4439c68ca 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4396,7 +4396,7 @@ static void add_auto_cfg_input_pin(struct auto_pin_cfg *cfg, hda_nid_t nid,
4396 * output, i.e. to line_out_pins[0]. So, line_outs is always positive 4396 * output, i.e. to line_out_pins[0]. So, line_outs is always positive
4397 * if any analog output exists. 4397 * if any analog output exists.
4398 * 4398 *
4399 * The analog input pins are assigned to input_pins array. 4399 * The analog input pins are assigned to inputs array.
4400 * The digital input/output pins are assigned to dig_in_pin and dig_out_pin, 4400 * The digital input/output pins are assigned to dig_in_pin and dig_out_pin,
4401 * respectively. 4401 * respectively.
4402 */ 4402 */
@@ -4480,39 +4480,16 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4480 sequences_hp[cfg->hp_outs] = (assoc << 4) | seq; 4480 sequences_hp[cfg->hp_outs] = (assoc << 4) | seq;
4481 cfg->hp_outs++; 4481 cfg->hp_outs++;
4482 break; 4482 break;
4483 case AC_JACK_MIC_IN: { 4483 case AC_JACK_MIC_IN:
4484 int preferred, alt; 4484 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_MIC);
4485 if (loc == AC_JACK_LOC_FRONT ||
4486 (loc & 0x30) == AC_JACK_LOC_INTERNAL) {
4487 preferred = AUTO_PIN_FRONT_MIC;
4488 alt = AUTO_PIN_MIC;
4489 } else {
4490 preferred = AUTO_PIN_MIC;
4491 alt = AUTO_PIN_FRONT_MIC;
4492 }
4493 if (!cfg->input_pins[preferred])
4494 cfg->input_pins[preferred] = nid;
4495 else if (!cfg->input_pins[alt])
4496 cfg->input_pins[alt] = nid;
4497 add_auto_cfg_input_pin(cfg, nid, preferred);
4498 break; 4485 break;
4499 } 4486 case AC_JACK_LINE_IN:
4500 case AC_JACK_LINE_IN: { 4487 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_LINE_IN);
4501 int type;
4502 if (loc == AC_JACK_LOC_FRONT)
4503 type = AUTO_PIN_FRONT_LINE;
4504 else
4505 type = AUTO_PIN_LINE;
4506 cfg->input_pins[type] = nid;
4507 add_auto_cfg_input_pin(cfg, nid, type);
4508 break; 4488 break;
4509 }
4510 case AC_JACK_CD: 4489 case AC_JACK_CD:
4511 cfg->input_pins[AUTO_PIN_CD] = nid;
4512 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_CD); 4490 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_CD);
4513 break; 4491 break;
4514 case AC_JACK_AUX: 4492 case AC_JACK_AUX:
4515 cfg->input_pins[AUTO_PIN_AUX] = nid;
4516 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_AUX); 4493 add_auto_cfg_input_pin(cfg, nid, AUTO_PIN_AUX);
4517 break; 4494 break;
4518 case AC_JACK_SPDIF_OUT: 4495 case AC_JACK_SPDIF_OUT:
@@ -4570,21 +4547,6 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4570 sort_pins_by_sequence(cfg->hp_pins, sequences_hp, 4547 sort_pins_by_sequence(cfg->hp_pins, sequences_hp,
4571 cfg->hp_outs); 4548 cfg->hp_outs);
4572 4549
4573 /* if we have only one mic, make it AUTO_PIN_MIC */
4574 if (!cfg->input_pins[AUTO_PIN_MIC] &&
4575 cfg->input_pins[AUTO_PIN_FRONT_MIC]) {
4576 cfg->input_pins[AUTO_PIN_MIC] =
4577 cfg->input_pins[AUTO_PIN_FRONT_MIC];
4578 cfg->input_pins[AUTO_PIN_FRONT_MIC] = 0;
4579 }
4580 /* ditto for line-in */
4581 if (!cfg->input_pins[AUTO_PIN_LINE] &&
4582 cfg->input_pins[AUTO_PIN_FRONT_LINE]) {
4583 cfg->input_pins[AUTO_PIN_LINE] =
4584 cfg->input_pins[AUTO_PIN_FRONT_LINE];
4585 cfg->input_pins[AUTO_PIN_FRONT_LINE] = 0;
4586 }
4587
4588 /* 4550 /*
4589 * FIX-UP: if no line-outs are detected, try to use speaker or HP pin 4551 * FIX-UP: if no line-outs are detected, try to use speaker or HP pin
4590 * as a primary output 4552 * as a primary output
@@ -4658,7 +4620,7 @@ EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config);
4658 4620
4659/* labels for input pins - for obsoleted config stuff */ 4621/* labels for input pins - for obsoleted config stuff */
4660const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { 4622const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = {
4661 "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" 4623 "Mic", "Line", "CD", "Aux"
4662}; 4624};
4663EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); 4625EXPORT_SYMBOL_HDA(auto_pin_cfg_labels);
4664 4626