Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182643
b: refs/heads/master
c: 21949f0
h: refs/heads/master
i:
  182641: 711c56c
  182639: 00be9a1
v: v3
  • Loading branch information
Takashi Iwai committed Dec 23, 2009
1 parent cee3abf commit 9a5de0e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 41 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: 524027916e5763a0c9a7da80aa8dd013a14a0440
refs/heads/master: 21949f00a022e090a7e8bc9a01dfca88273c6146
26 changes: 0 additions & 26 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3537,32 +3537,6 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew)
}
EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls);

/**
* snd_hda_add_nids - assign nids to controls from the array
* @codec: the HDA codec
* @kctl: struct snd_kcontrol
* @index: index to kctl
* @nids: the array of hda_nid_t
* @size: count of hda_nid_t items
*
* This helper function assigns NIDs in the given array to a control element.
*
* Returns 0 if successful, or a negative error code.
*/
int snd_hda_add_nids(struct hda_codec *codec, struct snd_kcontrol *kctl,
unsigned int index, hda_nid_t *nids, unsigned int size)
{
int err;

for ( ; size > 0; size--, nids++) {
err = snd_hda_add_nid(codec, kctl, index, *nids);
if (err < 0)
return err;
}
return 0;
}
EXPORT_SYMBOL_HDA(snd_hda_add_nids);

#ifdef CONFIG_SND_HDA_POWER_SAVE
static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state);
Expand Down
2 changes: 0 additions & 2 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
const struct snd_pci_quirk *tbl);
int snd_hda_add_new_ctls(struct hda_codec *codec,
struct snd_kcontrol_new *knew);
int snd_hda_add_nids(struct hda_codec *codec, struct snd_kcontrol *kctl,
unsigned int index, hda_nid_t *nids, unsigned int size);

/*
* unsolicited event handler
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
if (!kctl)
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids,
spec->input_mux->num_items);
err = snd_hda_add_nid(codec, kctl, i, spec->capsrc_nids[i]);
if (err < 0)
return err;
}
Expand Down
12 changes: 8 additions & 4 deletions trunk/sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ static int build_input(struct hda_codec *codec)
spec->capture_bind[1] = make_bind_capture(codec, &snd_hda_bind_vol);
for (i = 0; i < 2; i++) {
struct snd_kcontrol *kctl;
int n;
if (!spec->capture_bind[i])
return -ENOMEM;
kctl = snd_ctl_new1(&cs_capture_ctls[i], codec);
Expand All @@ -762,10 +763,13 @@ static int build_input(struct hda_codec *codec)
err = snd_hda_ctl_add(codec, 0, kctl);
if (err < 0)
return err;
err = snd_hda_add_nids(codec, kctl, 0, spec->adc_nid,
spec->num_inputs);
if (err < 0)
return err;
for (n = 0; n < AUTO_PIN_LAST; n++) {
if (!spec->adc_nid[n])
continue;
err = snd_hda_add_nid(codec, kctl, 0, spec->adc_nid[i]);
if (err < 0)
return err;
}
}

if (spec->num_inputs > 1 && !spec->mic_detect) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/pci/hda/patch_cmedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ static int cmi9880_build_controls(struct hda_codec *codec)
/* assign Capture Source enums to NID */
kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
for (i = 0; kctl && i < kctl->count; i++) {
err = snd_hda_add_nids(codec, kctl, i, spec->adc_nids,
spec->input_mux->num_items);
err = snd_hda_add_nid(codec, kctl, i, spec->adc_nids[i]);
if (err < 0)
return err;
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -2551,8 +2551,7 @@ static int alc_build_controls(struct hda_codec *codec)
hda_nid_t *nids = spec->capsrc_nids;
if (!nids)
nids = spec->adc_nids;
err = snd_hda_add_nids(codec, kctl, i, nids,
spec->input_mux->num_items);
err = snd_hda_add_nid(codec, kctl, i, nids[i]);
if (err < 0)
return err;
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,8 +1907,7 @@ static int via_build_controls(struct hda_codec *codec)
/* assign Capture Source enums to NID */
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
err = snd_hda_add_nids(codec, kctl, i, spec->mux_nids,
spec->input_mux->num_items);
err = snd_hda_add_nid(codec, kctl, i, spec->mux_nids[i]);
if (err < 0)
return err;
}
Expand Down

0 comments on commit 9a5de0e

Please sign in to comment.