ALSA: hda - Give more unique names by snd_hda_get_pin_label()

The function now gives more unique names for the output pins by adding
some prefix and suffix for the location and the channels.  Otherwise, it
can pass the index number.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2011-11-16 15:33:26 +01:00
parent bf815bf0a3
commit 201e06ffa9
6 changed files with 135 additions and 54 deletions

View File

@@ -711,8 +711,9 @@ static int cs_capture_source_info(struct snd_kcontrol *kcontrol,
if (uinfo->value.enumerated.item >= spec->num_inputs)
uinfo->value.enumerated.item = spec->num_inputs - 1;
idx = spec->input_idx[uinfo->value.enumerated.item];
strcpy(uinfo->value.enumerated.name,
snd_hda_get_pin_label(codec, cfg->inputs[idx].pin, NULL));
snd_hda_get_pin_label(codec, cfg->inputs[idx].pin, cfg,
uinfo->value.enumerated.name,
sizeof(uinfo->value.enumerated.name), NULL);
return 0;
}