Lines Matching +full:reg +full:- +full:data
2 * motu-protocol-v2.c - a part of driver for MOTU FireWire series
4 * Copyright (c) 2015-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>
30 __be32 reg; in v2_get_clock_rate() local
34 err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, in v2_get_clock_rate()
35 sizeof(reg)); in v2_get_clock_rate()
39 index = (be32_to_cpu(reg) & V2_CLOCK_RATE_MASK) >> V2_CLOCK_RATE_SHIFT; in v2_get_clock_rate()
41 return -EIO; in v2_get_clock_rate()
50 __be32 reg; in v2_set_clock_rate() local
51 u32 data; in v2_set_clock_rate() local
60 return -EINVAL; in v2_set_clock_rate()
62 err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, in v2_set_clock_rate()
63 sizeof(reg)); in v2_set_clock_rate()
66 data = be32_to_cpu(reg); in v2_set_clock_rate()
68 data &= ~V2_CLOCK_RATE_MASK; in v2_set_clock_rate()
69 data |= i << V2_CLOCK_RATE_SHIFT; in v2_set_clock_rate()
71 if (motu->spec == &snd_motu_spec_traveler) { in v2_set_clock_rate()
72 data &= ~V2_CLOCK_TRAVELER_FETCH_ENABLE; in v2_set_clock_rate()
73 data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; in v2_set_clock_rate()
76 reg = cpu_to_be32(data); in v2_set_clock_rate()
77 return snd_motu_transaction_write(motu, V2_CLOCK_STATUS_OFFSET, ®, in v2_set_clock_rate()
78 sizeof(reg)); in v2_set_clock_rate()
84 __be32 reg; in v2_get_clock_source() local
88 err = snd_motu_transaction_read(motu, V2_CLOCK_STATUS_OFFSET, ®, in v2_get_clock_source()
89 sizeof(reg)); in v2_get_clock_source()
93 index = be32_to_cpu(reg) & V2_CLOCK_SRC_MASK; in v2_get_clock_source()
95 return -EIO; in v2_get_clock_source()
98 err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, ®, in v2_get_clock_source()
99 sizeof(reg)); in v2_get_clock_source()
108 if (be32_to_cpu(reg) & 0x00000200) in v2_get_clock_source()
123 return -EIO; in v2_get_clock_source()
131 __be32 reg; in v2_switch_fetching_mode() local
132 u32 data; in v2_switch_fetching_mode() local
135 if (motu->spec == &snd_motu_spec_traveler) { in v2_switch_fetching_mode()
137 ®, sizeof(reg)); in v2_switch_fetching_mode()
140 data = be32_to_cpu(reg); in v2_switch_fetching_mode()
142 data &= ~(V2_CLOCK_TRAVELER_FETCH_DISABLE | in v2_switch_fetching_mode()
146 data |= V2_CLOCK_TRAVELER_FETCH_ENABLE; in v2_switch_fetching_mode()
148 data |= V2_CLOCK_TRAVELER_FETCH_DISABLE; in v2_switch_fetching_mode()
150 reg = cpu_to_be32(data); in v2_switch_fetching_mode()
152 ®, sizeof(reg)); in v2_switch_fetching_mode()
165 formats->msg_chunks = 2; in calculate_fixed_part()
206 formats->fixed_part_pcm_chunks[0] = pcm_chunks[0]; in calculate_fixed_part()
207 formats->fixed_part_pcm_chunks[1] = pcm_chunks[1]; in calculate_fixed_part()
208 formats->fixed_part_pcm_chunks[2] = pcm_chunks[2]; in calculate_fixed_part()
213 u32 data, u32 mask, u32 shift) in calculate_differed_part() argument
222 data = (data & mask) >> shift; in calculate_differed_part()
224 data == V2_OPT_IFACE_MODE_ADAT) { in calculate_differed_part()
229 /* At mode x4, no data chunks are supported in this part. */ in calculate_differed_part()
230 formats->differed_part_pcm_chunks[0] = pcm_chunks[0]; in calculate_differed_part()
231 formats->differed_part_pcm_chunks[1] = pcm_chunks[1]; in calculate_differed_part()
236 __be32 reg; in v2_cache_packet_formats() local
237 u32 data; in v2_cache_packet_formats() local
240 err = snd_motu_transaction_read(motu, V2_IN_OUT_CONF_OFFSET, ®, in v2_cache_packet_formats()
241 sizeof(reg)); in v2_cache_packet_formats()
244 data = be32_to_cpu(reg); in v2_cache_packet_formats()
246 calculate_fixed_part(&motu->tx_packet_formats, AMDTP_IN_STREAM, in v2_cache_packet_formats()
247 motu->spec->flags, motu->spec->analog_in_ports); in v2_cache_packet_formats()
248 calculate_differed_part(&motu->tx_packet_formats, motu->spec->flags, in v2_cache_packet_formats()
249 data, V2_OPT_IN_IFACE_MASK, V2_OPT_IN_IFACE_SHIFT); in v2_cache_packet_formats()
251 calculate_fixed_part(&motu->rx_packet_formats, AMDTP_OUT_STREAM, in v2_cache_packet_formats()
252 motu->spec->flags, motu->spec->analog_out_ports); in v2_cache_packet_formats()
253 calculate_differed_part(&motu->rx_packet_formats, motu->spec->flags, in v2_cache_packet_formats()
254 data, V2_OPT_OUT_IFACE_MASK, V2_OPT_OUT_IFACE_SHIFT); in v2_cache_packet_formats()
256 motu->tx_packet_formats.pcm_byte_offset = 10; in v2_cache_packet_formats()
257 motu->rx_packet_formats.pcm_byte_offset = 10; in v2_cache_packet_formats()