diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-01-20 17:25:52 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-01-21 15:12:23 +0100 |
commit | 4c4871a8055a1ff95fbd415d426d7e1d4b763edb (patch) | |
tree | d151627408a8f756df3bb6cc1db72fc71434ac05 /sound/firewire/fireface/ff-proc.c | |
parent | 22f745871408a58223e2f87e3d4e43d10229e61a (diff) |
ALSA: fireface: code refactoring to parse of clock configuration
A procedure to retrieve clock configuration is used by two callers.
Each of caller has duplicated code to parse bits.
This commit adds refactoring to remove the duplicated code.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff-proc.c')
-rw-r--r-- | sound/firewire/fireface/ff-proc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/firewire/fireface/ff-proc.c b/sound/firewire/fireface/ff-proc.c index 8a7cfb6ccce6..a55e68ec1832 100644 --- a/sound/firewire/fireface/ff-proc.c +++ b/sound/firewire/fireface/ff-proc.c @@ -8,6 +8,23 @@ #include "./ff.h" +const char *snd_ff_proc_get_clk_label(enum snd_ff_clock_src src) +{ + static const char *const labels[] = { + "Internal", + "S/PDIF", + "ADAT1", + "ADAT2", + "Word", + "LTC", + }; + + if (src >= ARRAY_SIZE(labels)) + return NULL; + + return labels[src]; +} + static void proc_dump_status(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { |