aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/bebob/bebob_terratec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/bebob/bebob_terratec.c')
-rw-r--r--sound/firewire/bebob/bebob_terratec.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/sound/firewire/bebob/bebob_terratec.c b/sound/firewire/bebob/bebob_terratec.c
index ad635004d699..9242e33d2cf1 100644
--- a/sound/firewire/bebob/bebob_terratec.c
+++ b/sound/firewire/bebob/bebob_terratec.c
@@ -8,8 +8,10 @@
8 8
9#include "./bebob.h" 9#include "./bebob.h"
10 10
11static const char *const phase88_rack_clk_src_labels[] = { 11static enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
12 SND_BEBOB_CLOCK_INTERNAL, "Digital In", "Word Clock" 12 SND_BEBOB_CLOCK_TYPE_INTERNAL,
13 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */
14 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */
13}; 15};
14static int 16static int
15phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id) 17phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
@@ -34,13 +36,23 @@ end:
34 return err; 36 return err;
35} 37}
36 38
37static const char *const phase24_series_clk_src_labels[] = { 39static enum snd_bebob_clock_type phase24_series_clk_src_types[] = {
38 SND_BEBOB_CLOCK_INTERNAL, "Digital In" 40 SND_BEBOB_CLOCK_TYPE_INTERNAL,
41 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */
39}; 42};
40static int 43static int
41phase24_series_clk_src_get(struct snd_bebob *bebob, unsigned int *id) 44phase24_series_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
42{ 45{
43 return avc_audio_get_selector(bebob->unit, 0, 4, id); 46 int err;
47
48 err = avc_audio_get_selector(bebob->unit, 0, 4, id);
49 if (err < 0)
50 return err;
51
52 if (*id >= ARRAY_SIZE(phase24_series_clk_src_types))
53 return -EIO;
54
55 return 0;
44} 56}
45 57
46static struct snd_bebob_rate_spec phase_series_rate_spec = { 58static struct snd_bebob_rate_spec phase_series_rate_spec = {
@@ -50,8 +62,8 @@ static struct snd_bebob_rate_spec phase_series_rate_spec = {
50 62
51/* PHASE 88 Rack FW */ 63/* PHASE 88 Rack FW */
52static struct snd_bebob_clock_spec phase88_rack_clk = { 64static struct snd_bebob_clock_spec phase88_rack_clk = {
53 .num = ARRAY_SIZE(phase88_rack_clk_src_labels), 65 .num = ARRAY_SIZE(phase88_rack_clk_src_types),
54 .labels = phase88_rack_clk_src_labels, 66 .types = phase88_rack_clk_src_types,
55 .get = &phase88_rack_clk_src_get, 67 .get = &phase88_rack_clk_src_get,
56}; 68};
57struct snd_bebob_spec phase88_rack_spec = { 69struct snd_bebob_spec phase88_rack_spec = {
@@ -62,8 +74,8 @@ struct snd_bebob_spec phase88_rack_spec = {
62 74
63/* 'PHASE 24 FW' and 'PHASE X24 FW' */ 75/* 'PHASE 24 FW' and 'PHASE X24 FW' */
64static struct snd_bebob_clock_spec phase24_series_clk = { 76static struct snd_bebob_clock_spec phase24_series_clk = {
65 .num = ARRAY_SIZE(phase24_series_clk_src_labels), 77 .num = ARRAY_SIZE(phase24_series_clk_src_types),
66 .labels = phase24_series_clk_src_labels, 78 .types = phase24_series_clk_src_types,
67 .get = &phase24_series_clk_src_get, 79 .get = &phase24_series_clk_src_get,
68}; 80};
69struct snd_bebob_spec phase24_series_spec = { 81struct snd_bebob_spec phase24_series_spec = {