1 // SPDX-License-Identifier: GPL-2.0-only
3 * bebob_terratec.c - a part of driver for BeBoB based devices
5 * Copyright (c) 2013-2014 Takashi Sakamoto
10 static const enum snd_bebob_clock_type phase88_rack_clk_src_types
[] = {
11 SND_BEBOB_CLOCK_TYPE_INTERNAL
,
12 SND_BEBOB_CLOCK_TYPE_EXTERNAL
, /* S/PDIF */
13 SND_BEBOB_CLOCK_TYPE_EXTERNAL
, /* Word Clock */
16 phase88_rack_clk_src_get(struct snd_bebob
*bebob
, unsigned int *id
)
18 unsigned int enable_ext
, enable_word
;
21 err
= avc_audio_get_selector(bebob
->unit
, 0, 9, &enable_ext
);
24 err
= avc_audio_get_selector(bebob
->unit
, 0, 8, &enable_word
);
30 else if (enable_word
== 0)
38 static const struct snd_bebob_rate_spec phase_series_rate_spec
= {
39 .get
= &snd_bebob_stream_get_rate
,
40 .set
= &snd_bebob_stream_set_rate
,
43 /* PHASE 88 Rack FW */
44 static const struct snd_bebob_clock_spec phase88_rack_clk
= {
45 .num
= ARRAY_SIZE(phase88_rack_clk_src_types
),
46 .types
= phase88_rack_clk_src_types
,
47 .get
= &phase88_rack_clk_src_get
,
49 const struct snd_bebob_spec phase88_rack_spec
= {
50 .clock
= &phase88_rack_clk
,
51 .rate
= &phase_series_rate_spec
,