Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353019
b: refs/heads/master
c: 8dd4867
h: refs/heads/master
i:
  353017: 7bc365b
  353015: ddf3355
v: v3
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent 2dacae4 commit 9234d55
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 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: 3ebf1e940a3ffb05b6bd78190d6dc8389d1082ef
refs/heads/master: 8dd48678584c4cf2588335f9ee816a5747980cf6
23 changes: 17 additions & 6 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ struct alc_multi_io {

#define MAX_NID_PATH_DEPTH 5

enum {
NID_PATH_VOL_CTL,
NID_PATH_MUTE_CTL,
NID_PATH_BOOST_CTL,
NID_PATH_NUM_CTLS
};

/* Widget connection path
*
* For output, stored in the order of DAC -> ... -> pin,
Expand All @@ -111,12 +118,10 @@ struct nid_path {
hda_nid_t path[MAX_NID_PATH_DEPTH];
unsigned char idx[MAX_NID_PATH_DEPTH];
unsigned char multi[MAX_NID_PATH_DEPTH];
unsigned int ctls[2]; /* 0 = volume, 1 = mute */
unsigned int ctls[NID_PATH_NUM_CTLS]; /* NID_PATH_XXX_CTL */
bool active;
};

enum { NID_PATH_VOL_CTL = 0, NID_PATH_MUTE_CTL = 1 };

struct alc_spec {
struct hda_gen_spec gen;

Expand Down Expand Up @@ -3809,7 +3814,7 @@ static bool is_ctl_associated(struct hda_codec *codec, hda_nid_t nid,
struct nid_path *p = snd_array_elem(&spec->paths, i);
if (p->depth <= 0)
continue;
for (type = 0; type < 2; type++) {
for (type = 0; type < NID_PATH_NUM_CTLS; type++) {
unsigned int val = p->ctls[type];
if (get_amp_nid_(val) == nid &&
get_amp_direction_(val) == dir &&
Expand Down Expand Up @@ -4388,6 +4393,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)
if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) {
const char *label;
char boost_label[32];
struct nid_path *path;
unsigned int val;

label = hda_get_autocfg_input_label(codec, cfg, i);
if (spec->shared_mic_hp && !strcmp(label, "Misc"))
Expand All @@ -4400,11 +4407,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)

snprintf(boost_label, sizeof(boost_label),
"%s Boost Volume", label);
val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT);
err = add_control(spec, ALC_CTL_WIDGET_VOL,
boost_label, type_idx,
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
boost_label, type_idx, val);
if (err < 0)
return err;

path = get_nid_path(codec, nid, 0);
if (path)
path->ctls[NID_PATH_BOOST_CTL] = val;
}
}
return 0;
Expand Down

0 comments on commit 9234d55

Please sign in to comment.