Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353173
b: refs/heads/master
c: 9dba205
h: refs/heads/master
i:
  353171: d6a263d
v: v3
  • Loading branch information
Takashi Iwai committed Jan 18, 2013
1 parent ac96c3c commit 103540b
Show file tree
Hide file tree
Showing 2 changed files with 15 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: 8a6c21aee8ab94c35e9db7a4ad35cfeb94f57d59
refs/heads/master: 9dba205b486152e3d31ab04f3b60efeef035cec5
20 changes: 14 additions & 6 deletions trunk/sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,7 +2478,8 @@ static int check_dyn_adc_switch(struct hda_codec *codec)

/* parse capture source paths from the given pin and create imux items */
static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
int num_adcs, const char *label, int anchor)
int cfg_idx, int num_adcs,
const char *label, int anchor)
{
struct hda_gen_spec *spec = codec->spec;
struct hda_input_mux *imux = &spec->input_mux;
Expand All @@ -2501,8 +2502,7 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,

if (!imux_added) {
spec->imux_pins[imux->num_items] = pin;
snd_hda_add_imux_item(imux, label,
imux->num_items, NULL);
snd_hda_add_imux_item(imux, label, cfg_idx, NULL);
imux_added = true;
}
}
Expand All @@ -2513,6 +2513,9 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
/*
* create playback/capture controls for input pins
*/

#define CFG_IDX_MIX 99 /* a dummy cfg->input idx for stereo mix */

static int create_input_ctls(struct hda_codec *codec)
{
struct hda_gen_spec *spec = codec->spec;
Expand Down Expand Up @@ -2556,7 +2559,8 @@ static int create_input_ctls(struct hda_codec *codec)
}
}

err = parse_capture_source(codec, pin, num_adcs, label, -mixer);
err = parse_capture_source(codec, pin, i,
num_adcs, label, -mixer);
if (err < 0)
return err;

Expand All @@ -2568,7 +2572,7 @@ static int create_input_ctls(struct hda_codec *codec)
}

if (mixer && spec->add_stereo_mix_input) {
err = parse_capture_source(codec, mixer, num_adcs,
err = parse_capture_source(codec, mixer, CFG_IDX_MIX, num_adcs,
"Stereo Mix", 0);
if (err < 0)
return err;
Expand Down Expand Up @@ -2909,7 +2913,11 @@ static int create_multi_cap_vol_ctl(struct hda_codec *codec)
for (i = 0; i < imux->num_items; i++) {
const char *label;
bool inv_dmic;
label = hda_get_autocfg_input_label(codec, &spec->autocfg, i);

if (imux->items[i].index >= spec->autocfg.num_inputs)
continue;
label = hda_get_autocfg_input_label(codec, &spec->autocfg,
imux->items[i].index);
if (prev_label && !strcmp(label, prev_label))
type_idx++;
else
Expand Down

0 comments on commit 103540b

Please sign in to comment.