diff options
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 15f1e7b37c9f..b271853e2e52 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -2221,16 +2221,22 @@ static int hdspm_get_s1_sample_rate(struct hdspm *hdspm, unsigned int idx) | |||
2221 | return (status >> (idx*4)) & 0xF; | 2221 | return (status >> (idx*4)) & 0xF; |
2222 | } | 2222 | } |
2223 | 2223 | ||
2224 | #define ENUMERATED_CTL_INFO(info, texts) \ | 2224 | static void snd_hdspm_set_infotext(struct snd_ctl_elem_info *uinfo, |
2225 | { \ | 2225 | char **texts, const int count) |
2226 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; \ | 2226 | { |
2227 | uinfo->count = 1; \ | 2227 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
2228 | uinfo->value.enumerated.items = ARRAY_SIZE(texts); \ | 2228 | uinfo->count = 1; |
2229 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) \ | 2229 | uinfo->value.enumerated.items = count; |
2230 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; \ | 2230 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
2231 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); \ | 2231 | uinfo->value.enumerated.item = |
2232 | uinfo->value.enumerated.items - 1; | ||
2233 | strcpy(uinfo->value.enumerated.name, | ||
2234 | texts[uinfo->value.enumerated.item]); | ||
2232 | } | 2235 | } |
2233 | 2236 | ||
2237 | #define ENUMERATED_CTL_INFO(info, texts) \ | ||
2238 | snd_hdspm_set_infotext(info, texts, ARRAY_SIZE(texts)) | ||
2239 | |||
2234 | 2240 | ||
2235 | 2241 | ||
2236 | #define HDSPM_AUTOSYNC_SAMPLE_RATE(xname, xindex) \ | 2242 | #define HDSPM_AUTOSYNC_SAMPLE_RATE(xname, xindex) \ |