diff --git a/sound/firewire/motu/amdtp-motu.c b/sound/firewire/motu/amdtp-motu.c index 6c9b743ea74b..cb0c967dea63 100644 --- a/sound/firewire/motu/amdtp-motu.c +++ b/sound/firewire/motu/amdtp-motu.c @@ -412,6 +412,12 @@ int amdtp_motu_init(struct amdtp_stream *s, struct fw_unit *unit, CIP_HEADER_WITHOUT_EOH; fmt = CIP_FMT_MOTU_TX_V3; } + + if (protocol == &snd_motu_protocol_v2) { + // 8pre has some quirks. + flags |= CIP_WRONG_DBS | + CIP_SKIP_DBC_ZERO_CHECK; + } } else { process_data_blocks = process_rx_data_blocks; flags |= CIP_DBC_IS_END_EVENT; diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c index 453fc29fade7..848fffe7387e 100644 --- a/sound/firewire/motu/motu-protocol-v2.c +++ b/sound/firewire/motu/motu-protocol-v2.c @@ -15,6 +15,8 @@ #define V2_CLOCK_SRC_SHIFT 0 #define V2_CLOCK_TRAVELER_FETCH_DISABLE 0x04000000 #define V2_CLOCK_TRAVELER_FETCH_ENABLE 0x03000000 +#define V2_CLOCK_8PRE_FETCH_DISABLE 0x02000000 +#define V2_CLOCK_8PRE_FETCH_ENABLE 0x00000000 #define V2_IN_OUT_CONF_OFFSET 0x0c04 #define V2_OPT_OUT_IFACE_MASK 0x00000c00 @@ -132,20 +134,31 @@ static int v2_switch_fetching_mode(struct snd_motu *motu, bool enable) u32 data; int err = 0; - if (motu->spec == &snd_motu_spec_traveler) { + if (motu->spec == &snd_motu_spec_traveler || + motu->spec == &snd_motu_spec_8pre) { err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, sizeof(reg)); if (err < 0) return err; data = be32_to_cpu(reg); - data &= ~(V2_CLOCK_TRAVELER_FETCH_DISABLE | - V2_CLOCK_TRAVELER_FETCH_ENABLE); + if (motu->spec == &snd_motu_spec_traveler) { + data &= ~(V2_CLOCK_TRAVELER_FETCH_DISABLE | + V2_CLOCK_TRAVELER_FETCH_ENABLE); - if (enable) - data |= V2_CLOCK_TRAVELER_FETCH_ENABLE; - else - data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; + if (enable) + data |= V2_CLOCK_TRAVELER_FETCH_ENABLE; + else + data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; + } else if (motu->spec == &snd_motu_spec_8pre) { + data &= ~(V2_CLOCK_8PRE_FETCH_DISABLE | + V2_CLOCK_8PRE_FETCH_ENABLE); + + if (enable) + data |= V2_CLOCK_8PRE_FETCH_DISABLE; + else + data |= V2_CLOCK_8PRE_FETCH_ENABLE; + } reg = cpu_to_be32(data); err = snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, @@ -220,10 +233,16 @@ static void calculate_differed_part(struct snd_motu_packet_format *formats, * interfaces. */ data = (data & mask) >> shift; - if ((flags & SND_MOTU_SPEC_HAS_OPT_IFACE_A) && - data == V2_OPT_IFACE_MODE_ADAT) { - pcm_chunks[0] += 8; - pcm_chunks[1] += 4; + if (data == V2_OPT_IFACE_MODE_ADAT) { + if (flags & SND_MOTU_SPEC_HAS_OPT_IFACE_A) { + pcm_chunks[0] += 8; + pcm_chunks[1] += 4; + } + // 8pre has two sets of optical interface and doesn't reduce + // chunks for ADAT signals. + if (flags & SND_MOTU_SPEC_HAS_OPT_IFACE_B) { + pcm_chunks[1] += 4; + } } /* At mode x4, no data chunks are supported in this part. */ diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 513291ba0ab0..201539d4488c 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -203,6 +203,20 @@ const struct snd_motu_spec snd_motu_spec_traveler = { .analog_out_ports = 8, }; +const struct snd_motu_spec snd_motu_spec_8pre = { + .name = "8pre", + .protocol = &snd_motu_protocol_v2, + // In tx, use coax chunks for mix-return 1/2. In rx, use coax chunks for + // dummy 1/2. + .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | + SND_MOTU_SPEC_HAS_OPT_IFACE_A | + SND_MOTU_SPEC_HAS_OPT_IFACE_B | + SND_MOTU_SPEC_RX_MIDI_2ND_Q | + SND_MOTU_SPEC_TX_MIDI_2ND_Q, + .analog_in_ports = 8, + .analog_out_ports = 2, +}; + static const struct snd_motu_spec motu_828mk3 = { .name = "828mk3", .protocol = &snd_motu_protocol_v3, @@ -248,6 +262,7 @@ static const struct snd_motu_spec motu_audio_express = { static const struct ieee1394_device_id motu_id_table[] = { SND_MOTU_DEV_ENTRY(0x000003, &motu_828mk2), SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler), + SND_MOTU_DEV_ENTRY(0x00000f, &snd_motu_spec_8pre), SND_MOTU_DEV_ENTRY(0x000015, &motu_828mk3), /* FireWire only. */ SND_MOTU_DEV_ENTRY(0x000035, &motu_828mk3), /* Hybrid. */ SND_MOTU_DEV_ENTRY(0x000033, &motu_audio_express), diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h index fd5327d30ab1..1cd112be7dad 100644 --- a/sound/firewire/motu/motu.h +++ b/sound/firewire/motu/motu.h @@ -130,6 +130,7 @@ extern const struct snd_motu_protocol snd_motu_protocol_v2; extern const struct snd_motu_protocol snd_motu_protocol_v3; extern const struct snd_motu_spec snd_motu_spec_traveler; +extern const struct snd_motu_spec snd_motu_spec_8pre; int amdtp_motu_init(struct amdtp_stream *s, struct fw_unit *unit, enum amdtp_stream_direction dir,