@@ -186,86 +186,6 @@ int snd_motu_protocol_v2_switch_fetching_mode(struct snd_motu *motu,
186
186
sizeof (reg ));
187
187
}
188
188
189
- static void calculate_fixed_part (struct snd_motu_packet_format * formats ,
190
- enum amdtp_stream_direction dir ,
191
- enum snd_motu_spec_flags flags ,
192
- unsigned char analog_ports )
193
- {
194
- unsigned char pcm_chunks [3 ] = {0 , 0 , 0 };
195
-
196
- pcm_chunks [0 ] = analog_ports ;
197
- pcm_chunks [1 ] = analog_ports ;
198
- if (flags & SND_MOTU_SPEC_SUPPORT_CLOCK_X4 )
199
- pcm_chunks [2 ] = analog_ports ;
200
-
201
- if (dir == AMDTP_IN_STREAM ) {
202
- if (flags & SND_MOTU_SPEC_TX_MICINST_CHUNK ) {
203
- pcm_chunks [0 ] += 2 ;
204
- pcm_chunks [1 ] += 2 ;
205
- }
206
- if (flags & SND_MOTU_SPEC_TX_RETURN_CHUNK ) {
207
- pcm_chunks [0 ] += 2 ;
208
- pcm_chunks [1 ] += 2 ;
209
- }
210
- } else {
211
- if (flags & SND_MOTU_SPEC_RX_SEPARATED_MAIN ) {
212
- pcm_chunks [0 ] += 2 ;
213
- pcm_chunks [1 ] += 2 ;
214
- }
215
-
216
- // Packets to v2 units include 2 chunks for phone 1/2, except
217
- // for 176.4/192.0 kHz.
218
- pcm_chunks [0 ] += 2 ;
219
- pcm_chunks [1 ] += 2 ;
220
- }
221
-
222
- if (flags & SND_MOTU_SPEC_HAS_AESEBU_IFACE ) {
223
- pcm_chunks [0 ] += 2 ;
224
- pcm_chunks [1 ] += 2 ;
225
- }
226
-
227
- /*
228
- * All of v2 models have a pair of coaxial interfaces for digital in/out
229
- * port. At 44.1/48.0/88.2/96.0 kHz, packets includes PCM from these
230
- * ports.
231
- */
232
- pcm_chunks [0 ] += 2 ;
233
- pcm_chunks [1 ] += 2 ;
234
-
235
- formats -> fixed_part_pcm_chunks [0 ] = pcm_chunks [0 ];
236
- formats -> fixed_part_pcm_chunks [1 ] = pcm_chunks [1 ];
237
- formats -> fixed_part_pcm_chunks [2 ] = pcm_chunks [2 ];
238
- }
239
-
240
- static void calculate_differed_part (struct snd_motu_packet_format * formats ,
241
- enum snd_motu_spec_flags flags ,
242
- u32 data , u32 mask , u32 shift )
243
- {
244
- unsigned char pcm_chunks [2 ] = {0 , 0 };
245
-
246
- /*
247
- * When optical interfaces are configured for S/PDIF (TOSLINK),
248
- * the above PCM frames come from them, instead of coaxial
249
- * interfaces.
250
- */
251
- data = (data & mask ) >> shift ;
252
- if (data == V2_OPT_IFACE_MODE_ADAT ) {
253
- if (flags & SND_MOTU_SPEC_HAS_OPT_IFACE_A ) {
254
- pcm_chunks [0 ] += 8 ;
255
- pcm_chunks [1 ] += 4 ;
256
- }
257
- // 8pre has two sets of optical interface and doesn't reduce
258
- // chunks for ADAT signals.
259
- if (flags & SND_MOTU_SPEC_HAS_OPT_IFACE_B ) {
260
- pcm_chunks [1 ] += 4 ;
261
- }
262
- }
263
-
264
- /* At mode x4, no data chunks are supported in this part. */
265
- formats -> differed_part_pcm_chunks [0 ] = pcm_chunks [0 ];
266
- formats -> differed_part_pcm_chunks [1 ] = pcm_chunks [1 ];
267
- }
268
-
269
189
static int detect_packet_formats_828mk2 (struct snd_motu * motu , u32 data )
270
190
{
271
191
if (((data & V2_OPT_IN_IFACE_MASK ) >> V2_OPT_IN_IFACE_SHIFT ) ==
@@ -335,16 +255,6 @@ int snd_motu_protocol_v2_cache_packet_formats(struct snd_motu *motu)
335
255
return err ;
336
256
data = be32_to_cpu (reg );
337
257
338
- calculate_fixed_part (& motu -> tx_packet_formats , AMDTP_IN_STREAM ,
339
- motu -> spec -> flags , motu -> spec -> analog_in_ports );
340
- calculate_differed_part (& motu -> tx_packet_formats , motu -> spec -> flags ,
341
- data , V2_OPT_IN_IFACE_MASK , V2_OPT_IN_IFACE_SHIFT );
342
-
343
- calculate_fixed_part (& motu -> rx_packet_formats , AMDTP_OUT_STREAM ,
344
- motu -> spec -> flags , motu -> spec -> analog_out_ports );
345
- calculate_differed_part (& motu -> rx_packet_formats , motu -> spec -> flags ,
346
- data , V2_OPT_OUT_IFACE_MASK , V2_OPT_OUT_IFACE_SHIFT );
347
-
348
258
memcpy (motu -> tx_packet_formats .pcm_chunks ,
349
259
motu -> spec -> tx_fixed_pcm_chunks ,
350
260
sizeof (motu -> tx_packet_formats .pcm_chunks ));
@@ -365,62 +275,35 @@ int snd_motu_protocol_v2_cache_packet_formats(struct snd_motu *motu)
365
275
const struct snd_motu_spec snd_motu_spec_828mk2 = {
366
276
.name = "828mk2" ,
367
277
.protocol_version = SND_MOTU_PROTOCOL_V2 ,
368
- .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
369
- SND_MOTU_SPEC_TX_MICINST_CHUNK |
370
- SND_MOTU_SPEC_TX_RETURN_CHUNK |
371
- SND_MOTU_SPEC_RX_SEPARATED_MAIN |
372
- SND_MOTU_SPEC_HAS_OPT_IFACE_A |
373
- SND_MOTU_SPEC_RX_MIDI_2ND_Q |
278
+ .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q |
374
279
SND_MOTU_SPEC_TX_MIDI_2ND_Q ,
375
280
.tx_fixed_pcm_chunks = {14 , 14 , 0 },
376
281
.rx_fixed_pcm_chunks = {14 , 14 , 0 },
377
- .analog_in_ports = 8 ,
378
- .analog_out_ports = 8 ,
379
282
};
380
283
381
284
const struct snd_motu_spec snd_motu_spec_traveler = {
382
285
.name = "Traveler" ,
383
286
.protocol_version = SND_MOTU_PROTOCOL_V2 ,
384
- .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
385
- SND_MOTU_SPEC_SUPPORT_CLOCK_X4 |
386
- SND_MOTU_SPEC_TX_RETURN_CHUNK |
387
- SND_MOTU_SPEC_HAS_AESEBU_IFACE |
388
- SND_MOTU_SPEC_HAS_OPT_IFACE_A |
389
- SND_MOTU_SPEC_RX_MIDI_2ND_Q |
287
+ .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q |
390
288
SND_MOTU_SPEC_TX_MIDI_2ND_Q ,
391
289
.tx_fixed_pcm_chunks = {14 , 14 , 8 },
392
290
.rx_fixed_pcm_chunks = {14 , 14 , 8 },
393
- .analog_in_ports = 8 ,
394
- .analog_out_ports = 8 ,
395
291
};
396
292
397
293
const struct snd_motu_spec snd_motu_spec_ultralite = {
398
294
.name = "UltraLite" ,
399
295
.protocol_version = SND_MOTU_PROTOCOL_V2 ,
400
- .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
401
- SND_MOTU_SPEC_TX_MICINST_CHUNK | // padding.
402
- SND_MOTU_SPEC_TX_RETURN_CHUNK |
403
- SND_MOTU_SPEC_RX_MIDI_2ND_Q |
404
- SND_MOTU_SPEC_TX_MIDI_2ND_Q |
405
- SND_MOTU_SPEC_RX_SEPARATED_MAIN ,
296
+ .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q |
297
+ SND_MOTU_SPEC_TX_MIDI_2ND_Q ,
406
298
.tx_fixed_pcm_chunks = {14 , 14 , 0 },
407
299
.rx_fixed_pcm_chunks = {14 , 14 , 0 },
408
- .analog_in_ports = 8 ,
409
- .analog_out_ports = 8 ,
410
300
};
411
301
412
302
const struct snd_motu_spec snd_motu_spec_8pre = {
413
303
.name = "8pre" ,
414
304
.protocol_version = SND_MOTU_PROTOCOL_V2 ,
415
- // In tx, use coax chunks for mix-return 1/2. In rx, use coax chunks for
416
- // dummy 1/2.
417
- .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
418
- SND_MOTU_SPEC_HAS_OPT_IFACE_A |
419
- SND_MOTU_SPEC_HAS_OPT_IFACE_B |
420
- SND_MOTU_SPEC_RX_MIDI_2ND_Q |
305
+ .flags = SND_MOTU_SPEC_RX_MIDI_2ND_Q |
421
306
SND_MOTU_SPEC_TX_MIDI_2ND_Q ,
422
307
.tx_fixed_pcm_chunks = {10 , 6 , 0 },
423
308
.rx_fixed_pcm_chunks = {10 , 6 , 0 },
424
- .analog_in_ports = 8 ,
425
- .analog_out_ports = 2 ,
426
309
};
0 commit comments