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
46 if ((data & 0x0000001e) == rate_entry->mask) { in parse_clock_bits()
47 *rate = rate_entry->rate; in parse_clock_bits()
52 return -EIO; in parse_clock_bits()
59 if ((data & 0x00001c00) == clk_entry->mask) { in parse_clock_bits()
60 *src = clk_entry->src; in parse_clock_bits()
65 return -EIO; in parse_clock_bits()
78 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in former_get_clock()
96 count = max(count, ff->spec->pcm_playback_channels[i]); in former_switch_fetching_mode()
100 return -ENOMEM; in former_switch_fetching_mode()
114 err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, in former_switch_fetching_mode()
130 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_clock_config()
200 err = snd_fw_transaction(ff->unit, TCODE_READ_BLOCK_REQUEST, in dump_sync_status()
213 if (data[0] & clk_entry->locked_mask) { in dump_sync_status()
214 if (data[0] & clk_entry->synced_mask) in dump_sync_status()
222 snd_iprintf(buffer, "%s: %s\n", clk_entry->label, state); in dump_sync_status()
235 if ((data[0] & 0x1e0000) == referred_entry->mask) { in dump_sync_status()
236 label = referred_entry->label; in dump_sync_status()
245 if ((data[0] & 0x1e000000) == rate_entry->mask) { in dump_sync_status()
246 rate = rate_entry->rate; in dump_sync_status()
268 u8 *buf = (u8 *)ff->msg_buf[port]; in former_fill_midi_msg()
278 for (i = len - 1; i >= 0; --i) in former_fill_midi_msg()
279 ff->msg_buf[port][i] = cpu_to_le32(buf[i]); in former_fill_midi_msg()
280 ff->rx_bytes[port] = len; in former_fill_midi_msg()
301 reg = cpu_to_le32(ff->tx_stream.data_block_quadlets); in allocate_tx_resources()
302 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in allocate_tx_resources()
311 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in allocate_tx_resources()
325 return -ETIMEDOUT; in allocate_tx_resources()
328 // channel. On the other hand, 'struct fw_iso_resources.allocated' is in allocate_tx_resources()
330 ff->tx_resources.channel = tx_isoc_channel; in allocate_tx_resources()
342 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
353 err = fw_iso_resources_allocate(&ff->rx_resources, in ff800_allocate_resources()
354 amdtp_stream_get_max_payload(&ff->rx_stream), in ff800_allocate_resources()
355 fw_parent_device(ff->unit)->max_speed); in ff800_allocate_resources()
359 // Set isochronous channel and the number of quadlets of rx packets. in ff800_allocate_resources()
362 data = ff->rx_stream.data_block_quadlets << 3; in ff800_allocate_resources()
363 data = (data << 8) | ff->rx_resources.channel; in ff800_allocate_resources()
365 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_allocate_resources()
375 unsigned int generation = ff->rx_resources.generation; in ff800_begin_session()
378 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff800_begin_session()
379 int err = fw_iso_resources_update(&ff->rx_resources); in ff800_begin_session()
385 reg |= cpu_to_le32(ff->tx_stream.data_block_quadlets); in ff800_begin_session()
386 if (fw_parent_device(ff->unit)->max_speed == SCODE_800) in ff800_begin_session()
388 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_begin_session()
397 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff800_finish_session()
414 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff800_handle_midi_msg()
437 // Fireface 400 manages isochronous channel number in 3 bit field. Therefore,
438 // we can allocate between 0 and 7 channel.
452 return -EINVAL; in ff400_allocate_resources()
456 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_allocate_resources()
467 // Keep resources for in-stream. in ff400_allocate_resources()
468 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
469 err = fw_iso_resources_allocate(&ff->tx_resources, in ff400_allocate_resources()
470 amdtp_stream_get_max_payload(&ff->tx_stream), in ff400_allocate_resources()
471 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
475 // Keep resources for out-stream. in ff400_allocate_resources()
476 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in ff400_allocate_resources()
477 err = fw_iso_resources_allocate(&ff->rx_resources, in ff400_allocate_resources()
478 amdtp_stream_get_max_payload(&ff->rx_stream), in ff400_allocate_resources()
479 fw_parent_device(ff->unit)->max_speed); in ff400_allocate_resources()
481 fw_iso_resources_free(&ff->tx_resources); in ff400_allocate_resources()
488 unsigned int generation = ff->rx_resources.generation; in ff400_begin_session()
492 if (generation != fw_parent_device(ff->unit)->card->generation) { in ff400_begin_session()
493 err = fw_iso_resources_update(&ff->tx_resources); in ff400_begin_session()
497 err = fw_iso_resources_update(&ff->rx_resources); in ff400_begin_session()
502 // Set isochronous channel and the number of quadlets of received in ff400_begin_session()
504 reg = cpu_to_le32(((ff->rx_stream.data_block_quadlets << 3) << 8) | in ff400_begin_session()
505 ff->rx_resources.channel); in ff400_begin_session()
506 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
511 // Set isochronous channel and the number of quadlets of transmitted in ff400_begin_session()
515 (ff->tx_resources.channel << 5) | in ff400_begin_session()
516 (ff->tx_stream.data_block_quadlets)); in ff400_begin_session()
517 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
524 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_begin_session()
533 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in ff400_finish_session()
542 // - 0x04000000: 0x'....'....'0000'0000
543 // - 0x08000000: 0x'....'....'0000'0080
544 // - 0x10000000: 0x'....'....'0000'0100
545 // - 0x20000000: 0x'....'....'0000'0180
549 // - 0x01000000: suppress transmission
550 // - 0x02000000: suppress transmission
552 // Actually, the register is write-only and includes the other options such as
562 u32 quad = le32_to_cpu(buf[i]); in ff400_handle_midi_msg() local
573 index = (quad >> 8) & 0xff; in ff400_handle_midi_msg()
575 substream = READ_ONCE(ff->tx_midi_substreams[0]); in ff400_handle_midi_msg()
577 byte = quad & 0xff; in ff400_handle_midi_msg()
583 index = (quad >> 24) & 0xff; in ff400_handle_midi_msg()
585 substream = READ_ONCE(ff->tx_midi_substreams[1]); in ff400_handle_midi_msg()
587 byte = (quad >> 16) & 0xff; in ff400_handle_midi_msg()