aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu/motu-protocol-v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/motu/motu-protocol-v2.c')
-rw-r--r--sound/firewire/motu/motu-protocol-v2.c43
1 files changed, 31 insertions, 12 deletions
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,
&reg, sizeof(reg));
if (err < 0)
return err;
data = be32_to_cpu(reg);
- 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 (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;
+ } 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. */