Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248488
b: refs/heads/master
c: 1f83ac5
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed May 17, 2011
1 parent 173d598 commit 87ae76a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ed99d976812d1e14a254b9ac1fe6255af8270ff
refs/heads/master: 1f83ac5ac9fb3e8b2e053de380f55ba412228577
12 changes: 8 additions & 4 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3520,26 +3520,34 @@ static int check_mic_pin(struct hda_codec *codec, hda_nid_t nid,
hda_nid_t *fixed, hda_nid_t *ext, hda_nid_t *dock)
{
unsigned int cfg;
unsigned int type;

if (!nid)
return 0;
cfg = snd_hda_codec_get_pincfg(codec, nid);
type = get_defcfg_device(cfg);
switch (snd_hda_get_input_pin_attr(cfg)) {
case INPUT_PIN_ATTR_INT:
if (*fixed)
return 1; /* already occupied */
if (type != AC_JACK_MIC_IN)
return 1; /* invalid type */
*fixed = nid;
break;
case INPUT_PIN_ATTR_UNUSED:
break;
case INPUT_PIN_ATTR_DOCK:
if (*dock)
return 1; /* already occupied */
if (type != AC_JACK_MIC_IN && type != AC_JACK_LINE_IN)
return 1; /* invalid type */
*dock = nid;
break;
default:
if (*ext)
return 1; /* already occupied */
if (type != AC_JACK_MIC_IN)
return 1; /* invalid type */
*ext = nid;
break;
}
Expand Down Expand Up @@ -3595,10 +3603,6 @@ static int stac_check_auto_mic(struct hda_codec *codec)
hda_nid_t fixed, ext, dock;
int i;

for (i = 0; i < cfg->num_inputs; i++) {
if (cfg->inputs[i].type >= AUTO_PIN_LINE_IN)
return 0; /* must be exclusively mics */
}
fixed = ext = dock = 0;
for (i = 0; i < cfg->num_inputs; i++)
if (check_mic_pin(codec, cfg->inputs[i].pin,
Expand Down

0 comments on commit 87ae76a

Please sign in to comment.