diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-09 08:21:17 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:45:58 -0400 |
commit | b5786e85cb2ffd0b07e86dec38a442bd20765ad8 (patch) | |
tree | b274f05600ab04ad189f48e342d02ebebc412140 /sound/pci/hda/hda_codec.c | |
parent | 6cb3b707f95954ac18f19b4b3919af235738371a (diff) |
ALSA: hda - Keep char arrays in input_mux items
Keep char array in the input_mux item itself instead of pointing to
an external string. This is a preliminary work for improving the
input-mux name based on the pin role.
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.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index bfdde7b0bafb..4348c33c6b85 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4662,17 +4662,8 @@ const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { | |||
4662 | }; | 4662 | }; |
4663 | EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); | 4663 | EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); |
4664 | 4664 | ||
4665 | static const char *input_labels[AUTO_PIN_LAST][4] = { | 4665 | void snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg, |
4666 | { "Mic", "Mic 2", "Mic 3", "Mic 4" }, | 4666 | int input, char *str) |
4667 | { "Front Mic", "Front Mic 2", "Front Mic 3", "Front Mic 4" }, | ||
4668 | { "Line", "Line 2", "Line 3", "Line 4" }, | ||
4669 | { "Front Line", "Front Line 2", "Front Line 3", "Front Line 4" }, | ||
4670 | { "CD", "CD 2", "CD 3", "CD 4" }, | ||
4671 | { "Aux", "Aux 2", "Aux 3", "Aux 4" }, | ||
4672 | }; | ||
4673 | |||
4674 | const char *snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg, | ||
4675 | int input) | ||
4676 | { | 4667 | { |
4677 | int type = cfg->inputs[input].type; | 4668 | int type = cfg->inputs[input].type; |
4678 | int idx; | 4669 | int idx; |
@@ -4681,7 +4672,10 @@ const char *snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg, | |||
4681 | if (type != cfg->inputs[input].type) | 4672 | if (type != cfg->inputs[input].type) |
4682 | break; | 4673 | break; |
4683 | } | 4674 | } |
4684 | return input_labels[type][idx]; | 4675 | if (idx > 0) |
4676 | sprintf(str, "%s %d", auto_pin_cfg_labels[type], idx); | ||
4677 | else | ||
4678 | strcpy(str, auto_pin_cfg_labels[type]); | ||
4685 | } | 4679 | } |
4686 | EXPORT_SYMBOL_HDA(snd_hda_get_input_pin_label); | 4680 | EXPORT_SYMBOL_HDA(snd_hda_get_input_pin_label); |
4687 | 4681 | ||