Lines Matching +full:quad +full:- +full:channel
1 // SPDX-License-Identifier: GPL-2.0
2 // ff-protocol-former.c - a part of driver for RME Fireface series
48 if ((data & 0x0000001e) == rate_entry->mask) { in parse_clock_bits()
49 *rate = rate_entry->rate; in parse_clock_bits()
54 return -EIO; in parse_clock_bits()
61 if ((data & 0x00001c00) == clk_entry->mask) { in parse_clock_bits()
62 *src = clk_entry->src; in parse_clock_bits()
67 return -EIO; in parse_clock_bits()
80 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in former_get_clock()
98 count = max(count, ff->spec->pcm_playback_channels[i]); in former_switch_fetching_mode()
102 return -ENOMEM; in former_switch_fetching_mode()
116 err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, in former_switch_fetching_mode()
132 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_clock_config()
202 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_sync_status()
215 if (data[0] & clk_entry->locked_mask) { in dump_sync_status()
216 if (data[0] & clk_entry->synced_mask) in dump_sync_status()
224 snd_iprintf(buffer, "%s: %s\n", clk_entry->label, state); in dump_sync_status()
237 if ((data[0] & 0x1e0000) == referred_entry->mask) { in dump_sync_status()
238 label = referred_entry->label; in dump_sync_status()
247 if ((data[0] & 0x1e000000) == rate_entry->mask) { in dump_sync_status()
248 rate = rate_entry->rate; in dump_sync_status()
270 u8 *buf = (u8 *)ff->msg_buf[port]; in former_fill_midi_msg()
280 for (i = len - 1; i >= 0; --i) in former_fill_midi_msg()
281 ff->msg_buf[port][i] = cpu_to_le32(buf[i]); in former_fill_midi_msg()
282 ff->rx_bytes[port] = len; in former_fill_midi_msg()
303 reg = cpu_to_le32(ff->tx_stream.data_block_quadlets); in allocate_tx_resources()
304 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in allocate_tx_resources()
313 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in allocate_tx_resources()
327 return -ETIMEDOUT; in allocate_tx_resources()
330 // channel. On the other hand, 'struct fw_iso_resources.allocated' is in allocate_tx_resources()
332 ff->tx_resources.channel = tx_isoc_channel; in allocate_tx_resources()
344 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
355 err = fw_iso_resources_allocate(&ff->rx_resources, in ff800_allocate_resources()
356 amdtp_stream_get_max_payload(&ff->rx_stream), in ff800_allocate_resources()
357 fw_parent_device(ff->unit)->max_speed); in ff800_allocate_resources()
361 // Set isochronous channel and the number of quadlets of rx packets. in ff800_allocate_resources()
364 data = ff->rx_stream.data_block_quadlets << 3; in ff800_allocate_resources()
365 data = (data << 8) | ff->rx_resources.channel; in ff800_allocate_resources()
367 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
377 unsigned int generation = ff->rx_resources.generation; in ff800_begin_session()
380 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff800_begin_session()
381 int err = fw_iso_resources_update(&ff->rx_resources); in ff800_begin_session()
387 reg |= cpu_to_le32(ff->tx_stream.data_block_quadlets); in ff800_begin_session()
388 if (fw_parent_device(ff->unit)->max_speed == SCODE_800) in ff800_begin_session()
390 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_begin_session()
399 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_finish_session()
416 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff800_handle_midi_msg()
439 // Fireface 400 manages isochronous channel number in 3 bit field. Therefore,
440 // we can allocate between 0 and 7 channel.
454 return -EINVAL; in ff400_allocate_resources()
458 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_allocate_resources()
469 // Keep resources for in-stream. in ff400_allocate_resources()
470 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
471 err = fw_iso_resources_allocate(&ff->tx_resources, in ff400_allocate_resources()
472 amdtp_stream_get_max_payload(&ff->tx_stream), in ff400_allocate_resources()
473 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
477 // Keep resources for out-stream. in ff400_allocate_resources()
478 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
479 err = fw_iso_resources_allocate(&ff->rx_resources, in ff400_allocate_resources()
480 amdtp_stream_get_max_payload(&ff->rx_stream), in ff400_allocate_resources()
481 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
483 fw_iso_resources_free(&ff->tx_resources); in ff400_allocate_resources()
490 unsigned int generation = ff->rx_resources.generation; in ff400_begin_session()
494 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff400_begin_session()
495 err = fw_iso_resources_update(&ff->tx_resources); in ff400_begin_session()
499 err = fw_iso_resources_update(&ff->rx_resources); in ff400_begin_session()
504 // Set isochronous channel and the number of quadlets of received in ff400_begin_session()
506 reg = cpu_to_le32(((ff->rx_stream.data_block_quadlets << 3) << 8) | in ff400_begin_session()
507 ff->rx_resources.channel); in ff400_begin_session()
508 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
513 // Set isochronous channel and the number of quadlets of transmitted in ff400_begin_session()
517 (ff->tx_resources.channel << 5) | in ff400_begin_session()
518 (ff->tx_stream.data_block_quadlets)); in ff400_begin_session()
519 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
526 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
535 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_finish_session()
544 // - 0x04000000: 0x'....'....'0000'0000
545 // - 0x08000000: 0x'....'....'0000'0080
546 // - 0x10000000: 0x'....'....'0000'0100
547 // - 0x20000000: 0x'....'....'0000'0180
551 // - 0x01000000: suppress transmission
552 // - 0x02000000: suppress transmission
554 // Actually, the register is write-only and includes the other options such as
564 u32 quad = le32_to_cpu(buf[i]); in ff400_handle_midi_msg() local
575 index = (quad >> 8) & 0xff; in ff400_handle_midi_msg()
577 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff400_handle_midi_msg()
579 byte = quad & 0xff; in ff400_handle_midi_msg()
585 index = (quad >> 24) & 0xff; in ff400_handle_midi_msg()
587 substream = READ_ONCE(ff->tx_midi_substreams[1]); in ff400_handle_midi_msg()
589 byte = (quad >> 16) & 0xff; in ff400_handle_midi_msg()