summaryrefslogtreecommitdiff
path: root/sound/pci/hda/patch_cirrus.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-09 16:28:02 +0200
committerTakashi Iwai <tiwai@suse.de>2010-09-09 16:46:03 +0200
commit10a20af7c944649dc6d1ffa06bc759f5f3a16cd9 (patch)
tree322ad916b8d909e3bdc3c51eb63ccecbdd1ae16a /sound/pci/hda/patch_cirrus.c
parent86e2959a10828dd2614e037fb2502bc833adca52 (diff)
ALSA: hda - Improve the input source name labels
This patch improves the input-source label strings to be generated from the pin information instead of fixed strings per AUTO_PIN_* type. This gives more suitable labels, especially for mic and line-in pins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_cirrus.c')
-rw-r--r--sound/pci/hda/patch_cirrus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index adb5ec50252a..ae75283a5583 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -673,6 +673,7 @@ static int cs_capture_source_info(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct cs_spec *spec = codec->spec;
+ struct auto_pin_cfg *cfg = &spec->autocfg;
unsigned int idx;
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
@@ -681,7 +682,8 @@ 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, auto_pin_cfg_labels[idx]);
+ strcpy(uinfo->value.enumerated.name,
+ hda_get_input_pin_label(codec, cfg->inputs[idx].pin, 1));
return 0;
}