diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2013-07-05 05:28:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-07-05 08:53:32 -0400 |
commit | 04659f9e9e6f2493d0e2dc52c72c4f20c22d9c61 (patch) | |
tree | 0637af0b578484e164dc879b91da7cf14440d05f /sound | |
parent | eb0d4dbf3d7f503f435022da46ef1495ca570d85 (diff) |
ALSA: hdspm - Use snd_ctl_enum_info() in snd_hdspm_info_autosync_ref
Also use snd_ctl_enum_info() to fill the autosync text fields on AES32
and MADI cards (only users of snd_hdspm_info_autosync_ref).
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index ffd5d7c08a4b..7a09b2de907b 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -2983,31 +2983,15 @@ static int snd_hdspm_info_autosync_ref(struct snd_kcontrol *kcontrol, | |||
2983 | struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); | 2983 | struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); |
2984 | 2984 | ||
2985 | if (AES32 == hdspm->io_type) { | 2985 | if (AES32 == hdspm->io_type) { |
2986 | static char *texts[] = { "WordClock", "AES1", "AES2", "AES3", | 2986 | static const char *const texts[] = { "WordClock", "AES1", "AES2", "AES3", |
2987 | "AES4", "AES5", "AES6", "AES7", "AES8", "TCO", "Sync In", "None"}; | 2987 | "AES4", "AES5", "AES6", "AES7", "AES8", "TCO", "Sync In", "None"}; |
2988 | 2988 | ||
2989 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2989 | ENUMERATED_CTL_INFO(uinfo, texts); |
2990 | uinfo->count = 1; | ||
2991 | uinfo->value.enumerated.items = ARRAY_SIZE(texts); | ||
2992 | if (uinfo->value.enumerated.item >= | ||
2993 | uinfo->value.enumerated.items) | ||
2994 | uinfo->value.enumerated.item = | ||
2995 | uinfo->value.enumerated.items - 1; | ||
2996 | strcpy(uinfo->value.enumerated.name, | ||
2997 | texts[uinfo->value.enumerated.item]); | ||
2998 | } else if (MADI == hdspm->io_type) { | 2990 | } else if (MADI == hdspm->io_type) { |
2999 | static char *texts[] = {"Word Clock", "MADI", "TCO", | 2991 | static const char *const texts[] = {"Word Clock", "MADI", "TCO", |
3000 | "Sync In", "None" }; | 2992 | "Sync In", "None" }; |
3001 | 2993 | ||
3002 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 2994 | ENUMERATED_CTL_INFO(uinfo, texts); |
3003 | uinfo->count = 1; | ||
3004 | uinfo->value.enumerated.items = 5; | ||
3005 | if (uinfo->value.enumerated.item >= | ||
3006 | uinfo->value.enumerated.items) | ||
3007 | uinfo->value.enumerated.item = | ||
3008 | uinfo->value.enumerated.items - 1; | ||
3009 | strcpy(uinfo->value.enumerated.name, | ||
3010 | texts[uinfo->value.enumerated.item]); | ||
3011 | } | 2995 | } |
3012 | return 0; | 2996 | return 0; |
3013 | } | 2997 | } |