aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-08-30 07:00:16 -0400
committerTakashi Iwai <tiwai@suse.de>2010-08-30 07:00:16 -0400
commitd7b1ae9d8851bd247590cf7ab53248a2dac0419f (patch)
tree7d1a2a6ecf9767f65866d5903345e10bc97ae276 /sound/pci/hda/hda_codec.c
parent75e0eb24ee3ec3549c2e53707dcc87e5f7a2c791 (diff)
ALSA: hda - Add snd_hda_get_input_pin_label() helper function
Added snd_hda_get_input_pin_label() helper function to return the string that can be used for control or capture-source ids. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 280a739c2a99..72334b7f60e5 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4654,12 +4654,35 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4654} 4654}
4655EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config); 4655EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config);
4656 4656
4657/* labels for input pins */ 4657/* labels for input pins - for obsoleted config stuff */
4658const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { 4658const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = {
4659 "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" 4659 "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux"
4660}; 4660};
4661EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); 4661EXPORT_SYMBOL_HDA(auto_pin_cfg_labels);
4662 4662
4663static const char *input_labels[AUTO_PIN_LAST][4] = {
4664 { "Mic", "Mic 2", "Mic 3", "Mic 4" },
4665 { "Front Mic", "Front Mic 2", "Front Mic 3", "Front Mic 4" },
4666 { "Line", "Line 2", "Line 3", "Line 4" },
4667 { "Front Line", "Front Line 2", "Front Line 3", "Front Line 4" },
4668 { "CD", "CD 2", "CD 3", "CD 4" },
4669 { "Aux", "Aux 2", "Aux 3", "Aux 4" },
4670};
4671
4672const char *snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg,
4673 int input)
4674{
4675 int type = cfg->inputs[input].type;
4676 int idx;
4677
4678 for (idx = 0; idx < 3 && --input >= 0; idx++) {
4679 if (type != cfg->inputs[input].type)
4680 break;
4681 }
4682 return input_labels[type][idx];
4683}
4684EXPORT_SYMBOL_HDA(snd_hda_get_input_pin_label);
4685
4663 4686
4664#ifdef CONFIG_PM 4687#ifdef CONFIG_PM
4665/* 4688/*