Lines Matching +full:reset +full:- +full:synchronized
1 // SPDX-License-Identifier: GPL-2.0
2 // ff-protocol-latter.c - a part of driver for RME Fireface series
32 // 0x00000040: Synchronized to word clock on BNC interface
33 // 0x00000020: Synchronized to ADAT or S/PDIF on optical interface
34 // 0x00000010: Synchronized to S/PDIF on coaxial interface
42 // 0x0f000000: detected rate of ADAT-B on 2nd optical interface
43 // 0x00f00000: detected rate of ADAT-A on 1st optical interface
48 // 0x00000800: ADAT-B
49 // 0x00000600: ADAT-A
52 // 0x00000080: Synchronized to ADAT-B on 2nd optical interface
53 // 0x00000040: Synchronized to ADAT-A on 1st optical interface
54 // 0x00000020: Synchronized to AES/EBU on XLR or 2nd optical interface
55 // 0x00000010: Synchronized to word clock on BNC interface
56 // 0x00000008: Lock ADAT-B on 2nd optical interface
57 // 0x00000004: Lock ADAT-A on 1st optical interface
120 if (rate_bits == rate_entry->flag) { in parse_clock_bits()
121 *rate = rate_entry->rate; in parse_clock_bits()
126 return -EIO; in parse_clock_bits()
130 if ((data & 0x000e00) == clk_entry->flag) { in parse_clock_bits()
131 *src = clk_entry->src; in parse_clock_bits()
136 return -EIO; in parse_clock_bits()
148 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in latter_get_clock()
154 return parse_clock_bits(data, rate, src, ff->unit_version); in latter_get_clock()
168 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_switch_fetching_mode()
189 return -EINVAL; in latter_allocate_resources()
197 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_allocate_resources()
216 return -ETIMEDOUT; in latter_allocate_resources()
223 return -EINVAL; in latter_allocate_resources()
229 // Keep resources for in-stream. in latter_allocate_resources()
230 ff->tx_resources.channels_mask = 0x00000000000000ffuLL; in latter_allocate_resources()
231 err = fw_iso_resources_allocate(&ff->tx_resources, in latter_allocate_resources()
232 amdtp_stream_get_max_payload(&ff->tx_stream), in latter_allocate_resources()
233 fw_parent_device(ff->unit)->max_speed); in latter_allocate_resources()
237 // Keep resources for out-stream. in latter_allocate_resources()
238 ff->rx_resources.channels_mask = 0x00000000000000ffuLL; in latter_allocate_resources()
239 err = fw_iso_resources_allocate(&ff->rx_resources, in latter_allocate_resources()
240 amdtp_stream_get_max_payload(&ff->rx_stream), in latter_allocate_resources()
241 fw_parent_device(ff->unit)->max_speed); in latter_allocate_resources()
243 fw_iso_resources_free(&ff->tx_resources); in latter_allocate_resources()
250 unsigned int generation = ff->rx_resources.generation; in latter_begin_session()
256 if (ff->unit_version == SND_FF_UNIT_VERSION_UCX) { in latter_begin_session()
266 return -EINVAL; in latter_begin_session()
269 // IEEE 1394a (400 Mbps), Analog 1-12 and AES are available in latter_begin_session()
278 return -EINVAL; in latter_begin_session()
281 if (generation != fw_parent_device(ff->unit)->card->generation) { in latter_begin_session()
282 err = fw_iso_resources_update(&ff->tx_resources); in latter_begin_session()
286 err = fw_iso_resources_update(&ff->rx_resources); in latter_begin_session()
291 data = (ff->tx_resources.channel << 8) | ff->rx_resources.channel; in latter_begin_session()
293 err = snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_begin_session()
299 return snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_begin_session()
308 snd_fw_transaction(ff->unit, TCODE_WRITE_QUADLET_REQUEST, in latter_finish_session()
325 { "ADAT-A", 0x00000004, 0x00000040, }, in latter_dump_status()
326 { "ADAT-B", 0x00000008, 0x00000080, }, in latter_dump_status()
337 err = snd_fw_transaction(ff->unit, TCODE_READ_QUADLET_REQUEST, in latter_dump_status()
345 if (ff->unit_version == SND_FF_UNIT_VERSION_UCX) { in latter_dump_status()
355 snd_iprintf(buffer, "%s: ", clk_entry->label); in latter_dump_status()
356 if (data & clk_entry->locked_mask) { in latter_dump_status()
357 if (data & clk_entry->synced_mask) in latter_dump_status()
366 err = parse_clock_bits(data, &rate, &src, ff->unit_version); in latter_dump_status()
376 // NOTE: transactions are transferred within 0x00-0x7f in allocated range of
384 // - 0x00002000: 0x'....'....'0000'0000
385 // - 0x00004000: 0x'....'....'0000'0080
386 // - 0x00008000: 0x'....'....'0000'0100
387 // - 0x00010000: 0x'....'....'0000'0180
392 // Actually, the register is write-only and includes the other settings such as
405 if (index >= ff->spec->midi_in_ports) in latter_handle_midi_msg()
431 substream = READ_ONCE(ff->tx_midi_substreams[index]); in latter_handle_midi_msg()
450 case 0xff: /* System reset. */ in calculate_message_bytes()
483 return -EINVAL; in calculate_message_bytes()
499 if (!ff->on_sysex[port]) { in latter_fill_midi_msg()
505 ff->on_sysex[port] = true; in latter_fill_midi_msg()
513 consumed -= 1; in latter_fill_midi_msg()
519 ff->on_sysex[port] = false; in latter_fill_midi_msg()
525 ff->msg_buf[port][0] = cpu_to_le32(data); in latter_fill_midi_msg()
526 ff->rx_bytes[port] = consumed; in latter_fill_midi_msg()