summaryrefslogtreecommitdiff
path: root/sound/firewire/bebob/bebob_terratec.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
commite5fd91f1ef340da553f7a79da9540c3db711c937 (patch)
treeb11842027dc6641da63f4bcc524f8678263304a3 /sound/firewire/bebob/bebob_terratec.c
parent2a9b0348e685a63d97486f6749622b61e9e3292f (diff)
Linux-libre 4.2-gnu
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 ad635004d..9242e33d2 100644
--- a/sound/firewire/bebob/bebob_terratec.c
+++ b/sound/firewire/bebob/bebob_terratec.c
@@ -8,8 +8,10 @@
#include "./bebob.h"
-static const char *const phase88_rack_clk_src_labels[] = {
- SND_BEBOB_CLOCK_INTERNAL, "Digital In", "Word Clock"
+static enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
+ SND_BEBOB_CLOCK_TYPE_INTERNAL,
+ SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */
+ SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */
};
static int
phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
@@ -34,13 +36,23 @@ end:
return err;
}
-static const char *const phase24_series_clk_src_labels[] = {
- SND_BEBOB_CLOCK_INTERNAL, "Digital In"
+static enum snd_bebob_clock_type phase24_series_clk_src_types[] = {
+ SND_BEBOB_CLOCK_TYPE_INTERNAL,
+ SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */
};
static int
phase24_series_clk_src_get(struct snd_bebob *bebob, unsigned int *id)
{
- return avc_audio_get_selector(bebob->unit, 0, 4, id);
+ int err;
+
+ err = avc_audio_get_selector(bebob->unit, 0, 4, id);
+ if (err < 0)
+ return err;
+
+ if (*id >= ARRAY_SIZE(phase24_series_clk_src_types))
+ return -EIO;
+
+ return 0;
}
static struct snd_bebob_rate_spec phase_series_rate_spec = {
@@ -50,8 +62,8 @@ static struct snd_bebob_rate_spec phase_series_rate_spec = {
/* PHASE 88 Rack FW */
static struct snd_bebob_clock_spec phase88_rack_clk = {
- .num = ARRAY_SIZE(phase88_rack_clk_src_labels),
- .labels = phase88_rack_clk_src_labels,
+ .num = ARRAY_SIZE(phase88_rack_clk_src_types),
+ .types = phase88_rack_clk_src_types,
.get = &phase88_rack_clk_src_get,
};
struct snd_bebob_spec phase88_rack_spec = {
@@ -62,8 +74,8 @@ struct snd_bebob_spec phase88_rack_spec = {
/* 'PHASE 24 FW' and 'PHASE X24 FW' */
static struct snd_bebob_clock_spec phase24_series_clk = {
- .num = ARRAY_SIZE(phase24_series_clk_src_labels),
- .labels = phase24_series_clk_src_labels,
+ .num = ARRAY_SIZE(phase24_series_clk_src_types),
+ .types = phase24_series_clk_src_types,
.get = &phase24_series_clk_src_get,
};
struct snd_bebob_spec phase24_series_spec = {