summaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2018-06-18 08:07:52 -0400
committerTakashi Iwai <tiwai@suse.de>2018-06-19 14:44:47 -0400
commit81720c6d49b7932d642e7dca736bef9a40c9b5f7 (patch)
treeed4aeeb3129fe4f819b2fd3fd78116789ed45369 /sound/firewire/motu
parent6c1549c4cc3c1b0d8623cde00e28f094b2db0d41 (diff)
ALSA: firewire-motu: add a flag for chunks for main 1/2 out
This driver explicitly assumes that all of supported models have main data chunk separated from chunk for analog ports. However, MOTU Traveler doesn't support the separated main data chunk. This commit adds a flag for the separated main data chunk. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu')
-rw-r--r--sound/firewire/motu/motu-protocol-v2.c14
-rw-r--r--sound/firewire/motu/motu-protocol-v3.c14
-rw-r--r--sound/firewire/motu/motu.c3
-rw-r--r--sound/firewire/motu/motu.h1
4 files changed, 22 insertions, 10 deletions
diff --git a/sound/firewire/motu/motu-protocol-v2.c b/sound/firewire/motu/motu-protocol-v2.c
index a51fd196d884..614f9b11e010 100644
--- a/sound/firewire/motu/motu-protocol-v2.c
+++ b/sound/firewire/motu/motu-protocol-v2.c
@@ -149,11 +149,15 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats,
149 pcm_chunks[1] += 2; 149 pcm_chunks[1] += 2;
150 } 150 }
151 } else { 151 } else {
152 /* 152 if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) {
153 * Packets to v2 units transfer main-out-1/2 and phone-out-1/2. 153 pcm_chunks[0] += 2;
154 */ 154 pcm_chunks[1] += 2;
155 pcm_chunks[0] += 4; 155 }
156 pcm_chunks[1] += 4; 156
157 // Packets to v2 units include 2 chunks for phone 1/2, except
158 // for 176.4/192.0 kHz.
159 pcm_chunks[0] += 2;
160 pcm_chunks[1] += 2;
157 } 161 }
158 162
159 /* 163 /*
diff --git a/sound/firewire/motu/motu-protocol-v3.c b/sound/firewire/motu/motu-protocol-v3.c
index c7cd9864dc4d..293353991591 100644
--- a/sound/firewire/motu/motu-protocol-v3.c
+++ b/sound/firewire/motu/motu-protocol-v3.c
@@ -188,11 +188,15 @@ static void calculate_fixed_part(struct snd_motu_packet_format *formats,
188 pcm_chunks[1] += 2; 188 pcm_chunks[1] += 2;
189 } 189 }
190 } else { 190 } else {
191 /* 191 if (flags & SND_MOTU_SPEC_RX_SEPARETED_MAIN) {
192 * Packets to v2 units transfer main-out-1/2 and phone-out-1/2. 192 pcm_chunks[0] += 2;
193 */ 193 pcm_chunks[1] += 2;
194 pcm_chunks[0] += 4; 194 }
195 pcm_chunks[1] += 4; 195
196 // Packets to v3 units include 2 chunks for phone 1/2, except
197 // for 176.4/192.0 kHz.
198 pcm_chunks[0] += 2;
199 pcm_chunks[1] += 2;
196 } 200 }
197 201
198 /* 202 /*
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index 0d6b526105ab..445aa589582d 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -200,6 +200,7 @@ static const struct snd_motu_spec motu_828mk2 = {
200 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | 200 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
201 SND_MOTU_SPEC_TX_MICINST_CHUNK | 201 SND_MOTU_SPEC_TX_MICINST_CHUNK |
202 SND_MOTU_SPEC_TX_RETURN_CHUNK | 202 SND_MOTU_SPEC_TX_RETURN_CHUNK |
203 SND_MOTU_SPEC_RX_SEPARETED_MAIN |
203 SND_MOTU_SPEC_HAS_OPT_IFACE_A | 204 SND_MOTU_SPEC_HAS_OPT_IFACE_A |
204 SND_MOTU_SPEC_RX_MIDI_2ND_Q | 205 SND_MOTU_SPEC_RX_MIDI_2ND_Q |
205 SND_MOTU_SPEC_TX_MIDI_2ND_Q, 206 SND_MOTU_SPEC_TX_MIDI_2ND_Q,
@@ -216,6 +217,7 @@ static const struct snd_motu_spec motu_828mk3 = {
216 SND_MOTU_SPEC_TX_MICINST_CHUNK | 217 SND_MOTU_SPEC_TX_MICINST_CHUNK |
217 SND_MOTU_SPEC_TX_RETURN_CHUNK | 218 SND_MOTU_SPEC_TX_RETURN_CHUNK |
218 SND_MOTU_SPEC_TX_REVERB_CHUNK | 219 SND_MOTU_SPEC_TX_REVERB_CHUNK |
220 SND_MOTU_SPEC_RX_SEPARETED_MAIN |
219 SND_MOTU_SPEC_HAS_OPT_IFACE_A | 221 SND_MOTU_SPEC_HAS_OPT_IFACE_A |
220 SND_MOTU_SPEC_HAS_OPT_IFACE_B | 222 SND_MOTU_SPEC_HAS_OPT_IFACE_B |
221 SND_MOTU_SPEC_RX_MIDI_3RD_Q | 223 SND_MOTU_SPEC_RX_MIDI_3RD_Q |
@@ -231,6 +233,7 @@ static const struct snd_motu_spec motu_audio_express = {
231 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | 233 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
232 SND_MOTU_SPEC_TX_MICINST_CHUNK | 234 SND_MOTU_SPEC_TX_MICINST_CHUNK |
233 SND_MOTU_SPEC_TX_RETURN_CHUNK | 235 SND_MOTU_SPEC_TX_RETURN_CHUNK |
236 SND_MOTU_SPEC_RX_SEPARETED_MAIN |
234 SND_MOTU_SPEC_RX_MIDI_2ND_Q | 237 SND_MOTU_SPEC_RX_MIDI_2ND_Q |
235 SND_MOTU_SPEC_TX_MIDI_3RD_Q, 238 SND_MOTU_SPEC_TX_MIDI_3RD_Q,
236 .analog_in_ports = 2, 239 .analog_in_ports = 2,
diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h
index 4b23cf337c4b..bced0407179e 100644
--- a/sound/firewire/motu/motu.h
+++ b/sound/firewire/motu/motu.h
@@ -86,6 +86,7 @@ enum snd_motu_spec_flags {
86 SND_MOTU_SPEC_RX_MIDI_3RD_Q = 0x0200, 86 SND_MOTU_SPEC_RX_MIDI_3RD_Q = 0x0200,
87 SND_MOTU_SPEC_TX_MIDI_2ND_Q = 0x0400, 87 SND_MOTU_SPEC_TX_MIDI_2ND_Q = 0x0400,
88 SND_MOTU_SPEC_TX_MIDI_3RD_Q = 0x0800, 88 SND_MOTU_SPEC_TX_MIDI_3RD_Q = 0x0800,
89 SND_MOTU_SPEC_RX_SEPARETED_MAIN = 0x1000,
89}; 90};
90 91
91#define SND_MOTU_CLOCK_RATE_COUNT 6 92#define SND_MOTU_CLOCK_RATE_COUNT 6