aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-05-17 06:29:09 -0400
committerTakashi Iwai <tiwai@suse.de>2011-05-17 06:35:03 -0400
commit1f83ac5ac9fb3e8b2e053de380f55ba412228577 (patch)
treef5fa010dd530fe02d298bcbaaa397640bc64b669 /sound
parent8ed99d976812d1e14a254b9ac1fe6255af8270ff (diff)
ALSA: hda - Handle dock line-in as auto-detectable for IDT codecs
When a docking-station has a line-in jack, we can handle it also as a detectable jack just like mic-in. This will improve the usability of HP laptops with a docking-station. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 8d26a5102b09..7f81cc2274f3 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -3520,14 +3520,18 @@ static int check_mic_pin(struct hda_codec *codec, hda_nid_t nid,
3520 hda_nid_t *fixed, hda_nid_t *ext, hda_nid_t *dock) 3520 hda_nid_t *fixed, hda_nid_t *ext, hda_nid_t *dock)
3521{ 3521{
3522 unsigned int cfg; 3522 unsigned int cfg;
3523 unsigned int type;
3523 3524
3524 if (!nid) 3525 if (!nid)
3525 return 0; 3526 return 0;
3526 cfg = snd_hda_codec_get_pincfg(codec, nid); 3527 cfg = snd_hda_codec_get_pincfg(codec, nid);
3528 type = get_defcfg_device(cfg);
3527 switch (snd_hda_get_input_pin_attr(cfg)) { 3529 switch (snd_hda_get_input_pin_attr(cfg)) {
3528 case INPUT_PIN_ATTR_INT: 3530 case INPUT_PIN_ATTR_INT:
3529 if (*fixed) 3531 if (*fixed)
3530 return 1; /* already occupied */ 3532 return 1; /* already occupied */
3533 if (type != AC_JACK_MIC_IN)
3534 return 1; /* invalid type */
3531 *fixed = nid; 3535 *fixed = nid;
3532 break; 3536 break;
3533 case INPUT_PIN_ATTR_UNUSED: 3537 case INPUT_PIN_ATTR_UNUSED:
@@ -3535,11 +3539,15 @@ static int check_mic_pin(struct hda_codec *codec, hda_nid_t nid,
3535 case INPUT_PIN_ATTR_DOCK: 3539 case INPUT_PIN_ATTR_DOCK:
3536 if (*dock) 3540 if (*dock)
3537 return 1; /* already occupied */ 3541 return 1; /* already occupied */
3542 if (type != AC_JACK_MIC_IN && type != AC_JACK_LINE_IN)
3543 return 1; /* invalid type */
3538 *dock = nid; 3544 *dock = nid;
3539 break; 3545 break;
3540 default: 3546 default:
3541 if (*ext) 3547 if (*ext)
3542 return 1; /* already occupied */ 3548 return 1; /* already occupied */
3549 if (type != AC_JACK_MIC_IN)
3550 return 1; /* invalid type */
3543 *ext = nid; 3551 *ext = nid;
3544 break; 3552 break;
3545 } 3553 }
@@ -3595,10 +3603,6 @@ static int stac_check_auto_mic(struct hda_codec *codec)
3595 hda_nid_t fixed, ext, dock; 3603 hda_nid_t fixed, ext, dock;
3596 int i; 3604 int i;
3597 3605
3598 for (i = 0; i < cfg->num_inputs; i++) {
3599 if (cfg->inputs[i].type >= AUTO_PIN_LINE_IN)
3600 return 0; /* must be exclusively mics */
3601 }
3602 fixed = ext = dock = 0; 3606 fixed = ext = dock = 0;
3603 for (i = 0; i < cfg->num_inputs; i++) 3607 for (i = 0; i < cfg->num_inputs; i++)
3604 if (check_mic_pin(codec, cfg->inputs[i].pin, 3608 if (check_mic_pin(codec, cfg->inputs[i].pin,