From 10a20af7c944649dc6d1ffa06bc759f5f3a16cd9 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 9 Sep 2010 16:28:02 +0200 Subject: 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 --- sound/pci/hda/patch_cirrus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound/pci/hda/patch_cirrus.c') diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index adb5ec50252..ae75283a558 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; } -- cgit v1.2.3