Path: blob/master/sound/firewire/bebob/bebob_terratec.c
26469 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* bebob_terratec.c - a part of driver for BeBoB based devices3*4* Copyright (c) 2013-2014 Takashi Sakamoto5*/67#include "./bebob.h"89static const enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {10SND_BEBOB_CLOCK_TYPE_INTERNAL,11SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */12SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */13};14static int15phase88_rack_clk_src_get(struct snd_bebob *bebob, unsigned int *id)16{17unsigned int enable_ext, enable_word;18int err;1920err = avc_audio_get_selector(bebob->unit, 0, 9, &enable_ext);21if (err < 0)22goto end;23err = avc_audio_get_selector(bebob->unit, 0, 8, &enable_word);24if (err < 0)25goto end;2627if (enable_ext == 0)28*id = 0;29else if (enable_word == 0)30*id = 1;31else32*id = 2;33end:34return err;35}3637static const struct snd_bebob_rate_spec phase_series_rate_spec = {38.get = &snd_bebob_stream_get_rate,39.set = &snd_bebob_stream_set_rate,40};4142/* PHASE 88 Rack FW */43static const struct snd_bebob_clock_spec phase88_rack_clk = {44.num = ARRAY_SIZE(phase88_rack_clk_src_types),45.types = phase88_rack_clk_src_types,46.get = &phase88_rack_clk_src_get,47};48const struct snd_bebob_spec phase88_rack_spec = {49.clock = &phase88_rack_clk,50.rate = &phase_series_rate_spec,51.meter = NULL52};535455