18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * motu-protocol-v2.c - a part of driver for MOTU FireWire series 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2015-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#include "motu.h" 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#define V2_CLOCK_STATUS_OFFSET 0x0b14 118c2ecf20Sopenharmony_ci#define V2_CLOCK_RATE_MASK 0x00000038 128c2ecf20Sopenharmony_ci#define V2_CLOCK_RATE_SHIFT 3 138c2ecf20Sopenharmony_ci#define V2_CLOCK_SRC_MASK 0x00000007 148c2ecf20Sopenharmony_ci#define V2_CLOCK_SRC_SHIFT 0 158c2ecf20Sopenharmony_ci#define V2_CLOCK_FETCH_ENABLE 0x02000000 168c2ecf20Sopenharmony_ci#define V2_CLOCK_MODEL_SPECIFIC 0x04000000 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#define V2_IN_OUT_CONF_OFFSET 0x0c04 198c2ecf20Sopenharmony_ci#define V2_OPT_OUT_IFACE_MASK 0x00000c00 208c2ecf20Sopenharmony_ci#define V2_OPT_OUT_IFACE_SHIFT 10 218c2ecf20Sopenharmony_ci#define V2_OPT_IN_IFACE_MASK 0x00000300 228c2ecf20Sopenharmony_ci#define V2_OPT_IN_IFACE_SHIFT 8 238c2ecf20Sopenharmony_ci#define V2_OPT_IFACE_MODE_NONE 0 248c2ecf20Sopenharmony_ci#define V2_OPT_IFACE_MODE_ADAT 1 258c2ecf20Sopenharmony_ci#define V2_OPT_IFACE_MODE_SPDIF 2 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistatic int get_clock_rate(u32 data, unsigned int *rate) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci unsigned int index = (data & V2_CLOCK_RATE_MASK) >> V2_CLOCK_RATE_SHIFT; 308c2ecf20Sopenharmony_ci if (index >= ARRAY_SIZE(snd_motu_clock_rates)) 318c2ecf20Sopenharmony_ci return -EIO; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci *rate = snd_motu_clock_rates[index]; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci return 0; 368c2ecf20Sopenharmony_ci} 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciint snd_motu_protocol_v2_get_clock_rate(struct snd_motu *motu, 398c2ecf20Sopenharmony_ci unsigned int *rate) 408c2ecf20Sopenharmony_ci{ 418c2ecf20Sopenharmony_ci __be32 reg; 428c2ecf20Sopenharmony_ci int err; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, 458c2ecf20Sopenharmony_ci sizeof(reg)); 468c2ecf20Sopenharmony_ci if (err < 0) 478c2ecf20Sopenharmony_ci return err; 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci return get_clock_rate(be32_to_cpu(reg), rate); 508c2ecf20Sopenharmony_ci} 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ciint snd_motu_protocol_v2_set_clock_rate(struct snd_motu *motu, 538c2ecf20Sopenharmony_ci unsigned int rate) 548c2ecf20Sopenharmony_ci{ 558c2ecf20Sopenharmony_ci __be32 reg; 568c2ecf20Sopenharmony_ci u32 data; 578c2ecf20Sopenharmony_ci int i; 588c2ecf20Sopenharmony_ci int err; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci for (i = 0; i < ARRAY_SIZE(snd_motu_clock_rates); ++i) { 618c2ecf20Sopenharmony_ci if (snd_motu_clock_rates[i] == rate) 628c2ecf20Sopenharmony_ci break; 638c2ecf20Sopenharmony_ci } 648c2ecf20Sopenharmony_ci if (i == ARRAY_SIZE(snd_motu_clock_rates)) 658c2ecf20Sopenharmony_ci return -EINVAL; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, 688c2ecf20Sopenharmony_ci sizeof(reg)); 698c2ecf20Sopenharmony_ci if (err < 0) 708c2ecf20Sopenharmony_ci return err; 718c2ecf20Sopenharmony_ci data = be32_to_cpu(reg); 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci data &= ~V2_CLOCK_RATE_MASK; 748c2ecf20Sopenharmony_ci data |= i << V2_CLOCK_RATE_SHIFT; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci reg = cpu_to_be32(data); 778c2ecf20Sopenharmony_ci return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, ®, 788c2ecf20Sopenharmony_ci sizeof(reg)); 798c2ecf20Sopenharmony_ci} 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_cistatic int detect_clock_source_optical_model(struct snd_motu *motu, u32 data, 828c2ecf20Sopenharmony_ci enum snd_motu_clock_source *src) 838c2ecf20Sopenharmony_ci{ 848c2ecf20Sopenharmony_ci switch (data) { 858c2ecf20Sopenharmony_ci case 0: 868c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_INTERNAL; 878c2ecf20Sopenharmony_ci break; 888c2ecf20Sopenharmony_ci case 1: 898c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_OPT; 908c2ecf20Sopenharmony_ci break; 918c2ecf20Sopenharmony_ci case 2: 928c2ecf20Sopenharmony_ci { 938c2ecf20Sopenharmony_ci __be32 reg; 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci // To check the configuration of optical interface. 968c2ecf20Sopenharmony_ci int err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, ®, sizeof(reg)); 978c2ecf20Sopenharmony_ci if (err < 0) 988c2ecf20Sopenharmony_ci return err; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci if (((data & V2_OPT_IN_IFACE_MASK) >> V2_OPT_IN_IFACE_SHIFT) == V2_OPT_IFACE_MODE_SPDIF) 1018c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_OPT; 1028c2ecf20Sopenharmony_ci else 1038c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX; 1048c2ecf20Sopenharmony_ci break; 1058c2ecf20Sopenharmony_ci } 1068c2ecf20Sopenharmony_ci case 3: 1078c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_SPH; 1088c2ecf20Sopenharmony_ci break; 1098c2ecf20Sopenharmony_ci case 4: 1108c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC; 1118c2ecf20Sopenharmony_ci break; 1128c2ecf20Sopenharmony_ci case 5: 1138c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_DSUB; 1148c2ecf20Sopenharmony_ci break; 1158c2ecf20Sopenharmony_ci default: 1168c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_UNKNOWN; 1178c2ecf20Sopenharmony_ci break; 1188c2ecf20Sopenharmony_ci } 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci return 0; 1218c2ecf20Sopenharmony_ci} 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_cistatic int v2_detect_clock_source(struct snd_motu *motu, u32 data, 1248c2ecf20Sopenharmony_ci enum snd_motu_clock_source *src) 1258c2ecf20Sopenharmony_ci{ 1268c2ecf20Sopenharmony_ci switch (data) { 1278c2ecf20Sopenharmony_ci case 0: 1288c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_INTERNAL; 1298c2ecf20Sopenharmony_ci break; 1308c2ecf20Sopenharmony_ci case 2: 1318c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX; 1328c2ecf20Sopenharmony_ci break; 1338c2ecf20Sopenharmony_ci case 3: 1348c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_SPH; 1358c2ecf20Sopenharmony_ci break; 1368c2ecf20Sopenharmony_ci case 4: 1378c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_WORD_ON_BNC; 1388c2ecf20Sopenharmony_ci break; 1398c2ecf20Sopenharmony_ci default: 1408c2ecf20Sopenharmony_ci *src = SND_MOTU_CLOCK_SOURCE_UNKNOWN; 1418c2ecf20Sopenharmony_ci break; 1428c2ecf20Sopenharmony_ci } 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci return 0; 1458c2ecf20Sopenharmony_ci} 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_cistatic int get_clock_source(struct snd_motu *motu, u32 data, 1488c2ecf20Sopenharmony_ci enum snd_motu_clock_source *src) 1498c2ecf20Sopenharmony_ci{ 1508c2ecf20Sopenharmony_ci data &= V2_CLOCK_SRC_MASK; 1518c2ecf20Sopenharmony_ci if (motu->spec == &snd_motu_spec_828mk2 || 1528c2ecf20Sopenharmony_ci motu->spec == &snd_motu_spec_traveler) 1538c2ecf20Sopenharmony_ci return detect_clock_source_optical_model(motu, data, src); 1548c2ecf20Sopenharmony_ci else 1558c2ecf20Sopenharmony_ci return v2_detect_clock_source(motu, data, src); 1568c2ecf20Sopenharmony_ci} 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ciint snd_motu_protocol_v2_get_clock_source(struct snd_motu *motu, 1598c2ecf20Sopenharmony_ci enum snd_motu_clock_source *src) 1608c2ecf20Sopenharmony_ci{ 1618c2ecf20Sopenharmony_ci __be32 reg; 1628c2ecf20Sopenharmony_ci int err; 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, 1658c2ecf20Sopenharmony_ci sizeof(reg)); 1668c2ecf20Sopenharmony_ci if (err < 0) 1678c2ecf20Sopenharmony_ci return err; 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci return get_clock_source(motu, be32_to_cpu(reg), src); 1708c2ecf20Sopenharmony_ci} 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci// Expected for Traveler and 896HD, which implements Altera Cyclone EP1C3. 1738c2ecf20Sopenharmony_cistatic int switch_fetching_mode_cyclone(struct snd_motu *motu, u32 *data, 1748c2ecf20Sopenharmony_ci bool enable) 1758c2ecf20Sopenharmony_ci{ 1768c2ecf20Sopenharmony_ci *data |= V2_CLOCK_MODEL_SPECIFIC; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci return 0; 1798c2ecf20Sopenharmony_ci} 1808c2ecf20Sopenharmony_ci 1818c2ecf20Sopenharmony_ci// For UltraLite and 8pre, which implements Xilinx Spartan XC3S200. 1828c2ecf20Sopenharmony_cistatic int switch_fetching_mode_spartan(struct snd_motu *motu, u32 *data, 1838c2ecf20Sopenharmony_ci bool enable) 1848c2ecf20Sopenharmony_ci{ 1858c2ecf20Sopenharmony_ci unsigned int rate; 1868c2ecf20Sopenharmony_ci enum snd_motu_clock_source src; 1878c2ecf20Sopenharmony_ci int err; 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ci err = get_clock_source(motu, *data, &src); 1908c2ecf20Sopenharmony_ci if (err < 0) 1918c2ecf20Sopenharmony_ci return err; 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci err = get_clock_rate(*data, &rate); 1948c2ecf20Sopenharmony_ci if (err < 0) 1958c2ecf20Sopenharmony_ci return err; 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_ci if (src == SND_MOTU_CLOCK_SOURCE_SPH && rate > 48000) 1988c2ecf20Sopenharmony_ci *data |= V2_CLOCK_MODEL_SPECIFIC; 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci return 0; 2018c2ecf20Sopenharmony_ci} 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ciint snd_motu_protocol_v2_switch_fetching_mode(struct snd_motu *motu, 2048c2ecf20Sopenharmony_ci bool enable) 2058c2ecf20Sopenharmony_ci{ 2068c2ecf20Sopenharmony_ci if (motu->spec == &snd_motu_spec_828mk2) { 2078c2ecf20Sopenharmony_ci // 828mkII implements Altera ACEX 1K EP1K30. Nothing to do. 2088c2ecf20Sopenharmony_ci return 0; 2098c2ecf20Sopenharmony_ci } else { 2108c2ecf20Sopenharmony_ci __be32 reg; 2118c2ecf20Sopenharmony_ci u32 data; 2128c2ecf20Sopenharmony_ci int err; 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ci err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, 2158c2ecf20Sopenharmony_ci ®, sizeof(reg)); 2168c2ecf20Sopenharmony_ci if (err < 0) 2178c2ecf20Sopenharmony_ci return err; 2188c2ecf20Sopenharmony_ci data = be32_to_cpu(reg); 2198c2ecf20Sopenharmony_ci 2208c2ecf20Sopenharmony_ci data &= ~(V2_CLOCK_FETCH_ENABLE | V2_CLOCK_MODEL_SPECIFIC); 2218c2ecf20Sopenharmony_ci if (enable) 2228c2ecf20Sopenharmony_ci data |= V2_CLOCK_FETCH_ENABLE; 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci if (motu->spec == &snd_motu_spec_traveler) 2258c2ecf20Sopenharmony_ci err = switch_fetching_mode_cyclone(motu, &data, enable); 2268c2ecf20Sopenharmony_ci else 2278c2ecf20Sopenharmony_ci err = switch_fetching_mode_spartan(motu, &data, enable); 2288c2ecf20Sopenharmony_ci if (err < 0) 2298c2ecf20Sopenharmony_ci return err; 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci reg = cpu_to_be32(data); 2328c2ecf20Sopenharmony_ci return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, 2338c2ecf20Sopenharmony_ci ®, sizeof(reg)); 2348c2ecf20Sopenharmony_ci } 2358c2ecf20Sopenharmony_ci} 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_cistatic int detect_packet_formats_828mk2(struct snd_motu *motu, u32 data) 2388c2ecf20Sopenharmony_ci{ 2398c2ecf20Sopenharmony_ci if (((data & V2_OPT_IN_IFACE_MASK) >> V2_OPT_IN_IFACE_SHIFT) == 2408c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2418c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[0] += 8; 2428c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[1] += 4; 2438c2ecf20Sopenharmony_ci } 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_ci if (((data & V2_OPT_OUT_IFACE_MASK) >> V2_OPT_OUT_IFACE_SHIFT) == 2468c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2478c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[0] += 8; 2488c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[1] += 4; 2498c2ecf20Sopenharmony_ci } 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ci return 0; 2528c2ecf20Sopenharmony_ci} 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_cistatic int detect_packet_formats_traveler(struct snd_motu *motu, u32 data) 2558c2ecf20Sopenharmony_ci{ 2568c2ecf20Sopenharmony_ci if (((data & V2_OPT_IN_IFACE_MASK) >> V2_OPT_IN_IFACE_SHIFT) == 2578c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2588c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[0] += 8; 2598c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[1] += 4; 2608c2ecf20Sopenharmony_ci } 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ci if (((data & V2_OPT_OUT_IFACE_MASK) >> V2_OPT_OUT_IFACE_SHIFT) == 2638c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2648c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[0] += 8; 2658c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[1] += 4; 2668c2ecf20Sopenharmony_ci } 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ci return 0; 2698c2ecf20Sopenharmony_ci} 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_cistatic int detect_packet_formats_8pre(struct snd_motu *motu, u32 data) 2728c2ecf20Sopenharmony_ci{ 2738c2ecf20Sopenharmony_ci if (((data & V2_OPT_IN_IFACE_MASK) >> V2_OPT_IN_IFACE_SHIFT) == 2748c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2758c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[0] += 8; 2768c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_chunks[1] += 8; 2778c2ecf20Sopenharmony_ci } 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ci if (((data & V2_OPT_OUT_IFACE_MASK) >> V2_OPT_OUT_IFACE_SHIFT) == 2808c2ecf20Sopenharmony_ci V2_OPT_IFACE_MODE_ADAT) { 2818c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[0] += 8; 2828c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_chunks[1] += 8; 2838c2ecf20Sopenharmony_ci } 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci return 0; 2868c2ecf20Sopenharmony_ci} 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_ciint snd_motu_protocol_v2_cache_packet_formats(struct snd_motu *motu) 2898c2ecf20Sopenharmony_ci{ 2908c2ecf20Sopenharmony_ci __be32 reg; 2918c2ecf20Sopenharmony_ci u32 data; 2928c2ecf20Sopenharmony_ci int err; 2938c2ecf20Sopenharmony_ci 2948c2ecf20Sopenharmony_ci motu->tx_packet_formats.pcm_byte_offset = 10; 2958c2ecf20Sopenharmony_ci motu->rx_packet_formats.pcm_byte_offset = 10; 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ci motu->tx_packet_formats.msg_chunks = 2; 2988c2ecf20Sopenharmony_ci motu->rx_packet_formats.msg_chunks = 2; 2998c2ecf20Sopenharmony_ci 3008c2ecf20Sopenharmony_ci err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, ®, 3018c2ecf20Sopenharmony_ci sizeof(reg)); 3028c2ecf20Sopenharmony_ci if (err < 0) 3038c2ecf20Sopenharmony_ci return err; 3048c2ecf20Sopenharmony_ci data = be32_to_cpu(reg); 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ci memcpy(motu->tx_packet_formats.pcm_chunks, 3078c2ecf20Sopenharmony_ci motu->spec->tx_fixed_pcm_chunks, 3088c2ecf20Sopenharmony_ci sizeof(motu->tx_packet_formats.pcm_chunks)); 3098c2ecf20Sopenharmony_ci memcpy(motu->rx_packet_formats.pcm_chunks, 3108c2ecf20Sopenharmony_ci motu->spec->rx_fixed_pcm_chunks, 3118c2ecf20Sopenharmony_ci sizeof(motu->rx_packet_formats.pcm_chunks)); 3128c2ecf20Sopenharmony_ci 3138c2ecf20Sopenharmony_ci if (motu->spec == &snd_motu_spec_828mk2) 3148c2ecf20Sopenharmony_ci return detect_packet_formats_828mk2(motu, data); 3158c2ecf20Sopenharmony_ci else if (motu->spec == &snd_motu_spec_traveler) 3168c2ecf20Sopenharmony_ci return detect_packet_formats_traveler(motu, data); 3178c2ecf20Sopenharmony_ci else if (motu->spec == &snd_motu_spec_8pre) 3188c2ecf20Sopenharmony_ci return detect_packet_formats_8pre(motu, data); 3198c2ecf20Sopenharmony_ci else 3208c2ecf20Sopenharmony_ci return 0; 3218c2ecf20Sopenharmony_ci} 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ciconst struct snd_motu_spec snd_motu_spec_828mk2 = { 3248c2ecf20Sopenharmony_ci .name = "828mk2", 3258c2ecf20Sopenharmony_ci .protocol_version = SND_MOTU_PROTOCOL_V2, 3268c2ecf20Sopenharmony_ci .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q | 3278c2ecf20Sopenharmony_ci SND_MOTU_SPEC_TX_MIDI_2ND_Q, 3288c2ecf20Sopenharmony_ci .tx_fixed_pcm_chunks = {14, 14, 0}, 3298c2ecf20Sopenharmony_ci .rx_fixed_pcm_chunks = {14, 14, 0}, 3308c2ecf20Sopenharmony_ci}; 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ciconst struct snd_motu_spec snd_motu_spec_traveler = { 3338c2ecf20Sopenharmony_ci .name = "Traveler", 3348c2ecf20Sopenharmony_ci .protocol_version = SND_MOTU_PROTOCOL_V2, 3358c2ecf20Sopenharmony_ci .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q | 3368c2ecf20Sopenharmony_ci SND_MOTU_SPEC_TX_MIDI_2ND_Q, 3378c2ecf20Sopenharmony_ci .tx_fixed_pcm_chunks = {14, 14, 8}, 3388c2ecf20Sopenharmony_ci .rx_fixed_pcm_chunks = {14, 14, 8}, 3398c2ecf20Sopenharmony_ci}; 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ciconst struct snd_motu_spec snd_motu_spec_ultralite = { 3428c2ecf20Sopenharmony_ci .name = "UltraLite", 3438c2ecf20Sopenharmony_ci .protocol_version = SND_MOTU_PROTOCOL_V2, 3448c2ecf20Sopenharmony_ci .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q | 3458c2ecf20Sopenharmony_ci SND_MOTU_SPEC_TX_MIDI_2ND_Q, 3468c2ecf20Sopenharmony_ci .tx_fixed_pcm_chunks = {14, 14, 0}, 3478c2ecf20Sopenharmony_ci .rx_fixed_pcm_chunks = {14, 14, 0}, 3488c2ecf20Sopenharmony_ci}; 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ciconst struct snd_motu_spec snd_motu_spec_8pre = { 3518c2ecf20Sopenharmony_ci .name = "8pre", 3528c2ecf20Sopenharmony_ci .protocol_version = SND_MOTU_PROTOCOL_V2, 3538c2ecf20Sopenharmony_ci .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q | 3548c2ecf20Sopenharmony_ci SND_MOTU_SPEC_TX_MIDI_2ND_Q, 3558c2ecf20Sopenharmony_ci // Two dummy chunks always in the end of data block. 3568c2ecf20Sopenharmony_ci .tx_fixed_pcm_chunks = {10, 10, 0}, 3578c2ecf20Sopenharmony_ci .rx_fixed_pcm_chunks = {6, 6, 0}, 3588c2ecf20Sopenharmony_ci}; 359