Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353157
b: refs/heads/master
c: 99a5592
h: refs/heads/master
i:
  353155: 6fd8ba8
v: v3
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Jan 16, 2013
1 parent 04a41f8 commit fab13f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 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: 02aba550537a666b8d09346f39d6372c78b115a5
refs/heads/master: 99a5592d6a897eed447df1fac6b591c06c891858
24 changes: 21 additions & 3 deletions trunk/sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,15 @@ static bool check_amp_caps(struct hda_codec *codec, hda_nid_t nid,
return false;
}

static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1,
hda_nid_t nid2, int dir)
{
if (!(get_wcaps(codec, nid1) & (1 << (dir + 1))))
return !(get_wcaps(codec, nid2) & (1 << (dir + 1)));
return (query_amp_caps(codec, nid1, dir) ==
query_amp_caps(codec, nid2, dir));
}

#define nid_has_mute(codec, nid, dir) \
check_amp_caps(codec, nid, dir, AC_AMPCAP_MUTE)
#define nid_has_volume(codec, nid, dir) \
Expand Down Expand Up @@ -2768,6 +2777,7 @@ static int create_capture_mixers(struct hda_codec *codec)

for (n = 0; n < nums; n++) {
bool multi = false;
bool multi_cap_vol = spec->multi_cap_vol;
bool inv_dmic = false;
int vol, sw;

Expand All @@ -2780,20 +2790,28 @@ static int create_capture_mixers(struct hda_codec *codec)
parse_capvol_in_path(codec, path);
if (!vol)
vol = path->ctls[NID_PATH_VOL_CTL];
else if (vol != path->ctls[NID_PATH_VOL_CTL])
else if (vol != path->ctls[NID_PATH_VOL_CTL]) {
multi = true;
if (!same_amp_caps(codec, vol,
path->ctls[NID_PATH_VOL_CTL], HDA_INPUT))
multi_cap_vol = true;
}
if (!sw)
sw = path->ctls[NID_PATH_MUTE_CTL];
else if (sw != path->ctls[NID_PATH_MUTE_CTL])
else if (sw != path->ctls[NID_PATH_MUTE_CTL]) {
multi = true;
if (!same_amp_caps(codec, sw,
path->ctls[NID_PATH_MUTE_CTL], HDA_INPUT))
multi_cap_vol = true;
}
if (is_inv_dmic_pin(codec, spec->imux_pins[i]))
inv_dmic = true;
}

if (!multi)
err = create_single_cap_vol_ctl(codec, n, vol, sw,
inv_dmic);
else if (!spec->multi_cap_vol)
else if (!multi_cap_vol)
err = create_bind_cap_vol_ctl(codec, n, vol, sw);
else
err = create_multi_cap_vol_ctl(codec);
Expand Down

0 comments on commit fab13f2

Please sign in to comment.