summaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu/motu.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-03-22 21:30:14 +0900
committerTakashi Iwai <tiwai@suse.de>2017-03-28 12:33:23 +0200
commit59f6482c2183fc3b3e42e0e2ae83a347ee6346c5 (patch)
treef3e2f8a42f7f1dfb586821b7b58a0ea6829a4cb7 /sound/firewire/motu/motu.c
parent5e03c33e3d8973e2c10abbf13f8f24779babafeb (diff)
downloadlinux-59f6482c2183fc3b3e42e0e2ae83a347ee6346c5.tar.bz2
ALSA: firewire-motu: add an abstraction layer for three types of protocols
In an aspect of used protocols to communicate, models of MOTU FireWire units are categorized to three generations. This commit adds an abstraction layer of the protocols for features related to packet streaming functionality. This layer includes 5 operations. When configuring packet streaming functionality with sampling rate and sampling transmission frequency, .get_clock_rate and .set_clock_rate are called with proper arguments. MOTU FireWire series supports up to 192.0kHz. When checking current source of sampling clock (not clock for packetization layer), .get_clock_source is used. Enumeration is added to represent the sources supported by this series. This operation can be used to expose available sampling rate to user space applications when the unit is configured to use any input signal as source of clock instead of crystal clock. In the protocols, the path between packet processing layer and digital signal processing layer can be controlled. This looks a functionality to 'mute' the unit. For this feature, .switch_fetching_mode is added. This can be used to suppress noises every time packet streaming starts/stops. In a point of the size of data blocks at a certain sampling transmission frequency, the most units accept several modes. This is due to usage of optical interfaces. The size differs depending on which modes are configured to the interfaces; None, S/PDIF and ADAT. Additionally, format of packet is different depending on protocols. To cache current size of data blocks and its format, .cache_packet_formats is added. This is used by PCM functionality, packet streaming functionality and data block processing layer. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu.c')
-rw-r--r--sound/firewire/motu/motu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index e69aa7b5dcde..1e6fc74a6458 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -14,6 +14,18 @@ MODULE_DESCRIPTION("MOTU FireWire driver");
MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>");
MODULE_LICENSE("GPL v2");
+const unsigned int snd_motu_clock_rates[SND_MOTU_CLOCK_RATE_COUNT] = {
+ /* mode 0 */
+ [0] = 44100,
+ [1] = 48000,
+ /* mode 1 */
+ [2] = 88200,
+ [3] = 96000,
+ /* mode 2 */
+ [4] = 176400,
+ [5] = 192000,
+};
+
static void name_card(struct snd_motu *motu)
{
struct fw_device *fw_dev = fw_parent_device(motu->unit);