Lines Matching +full:spi +full:- +full:rx +full:- +full:delay +full:- +full:us
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
13 #include <linux/spi/spi.h>
28 * struct adis_timeouts - ADIS chip variant timeouts
29 * @reset_ms - Wait time after rst pin goes inactive
30 * @sw_reset_ms - Wait time after sw reset command
31 * @self_test_ms - Wait time after self test command
40 * struct adis_data - ADIS chip variant specific data
41 * @read_delay: SPI delay for read operations in us
42 * @write_delay: SPI delay for write operations in us
43 * @cs_change_delay: SPI delay between CS changes in us
51 * @self_test_mask: Bitmask of supported self-test operations
53 * @self_test_no_autoclear: True if device's self-test needs clear of ctrl reg
61 * @burst_len: Burst size in the SPI RX buffer. If @burst_max_len is defined,
65 * @burst_max_speed_hz: Maximum spi speed that can be used in burst mode
102 * @write: Custom spi write implementation.
103 * @read: Custom spi read implementation.
116 * struct adis - ADIS device instance data
117 * @spi: Reference to SPI device which owns this ADIS IIO device
124 * @msg: SPI message object
125 * @xfer: SPI transfer objects to be used for a @msg
129 * @tx: DMA safe TX buffer for SPI transfers
130 * @rx: DMA safe RX buffer for SPI transfers
133 struct spi_device *spi; member
141 * a sequence of SPI R/W in order to protect the SPI transfer
147 * This allows users of the ADIS library to group SPI R/W into
158 u8 rx[4]; member
162 struct spi_device *spi, const struct adis_data *data);
166 * adis_reset() - Reset the device
173 guard(mutex)(&adis->state_lock); in adis_reset()
183 * __adis_write_reg_8() - Write single byte to a register (unlocked)
191 return adis->ops->write(adis, reg, val, 1); in __adis_write_reg_8()
195 * __adis_write_reg_16() - Write 2 bytes to a pair of registers (unlocked)
203 return adis->ops->write(adis, reg, val, 2); in __adis_write_reg_16()
207 * __adis_write_reg_32() - write 4 bytes to four registers (unlocked)
215 return adis->ops->write(adis, reg, val, 4); in __adis_write_reg_32()
219 * __adis_read_reg_16() - read 2 bytes from a 16-bit register (unlocked)
230 ret = adis->ops->read(adis, reg, &tmp, 2); in __adis_read_reg_16()
238 * __adis_read_reg_32() - read 4 bytes from a 32-bit register (unlocked)
249 ret = adis->ops->read(adis, reg, &tmp, 4); in __adis_read_reg_32()
257 * adis_write_reg() - write N bytes to register
266 guard(mutex)(&adis->state_lock); in adis_write_reg()
267 return adis->ops->write(adis, reg, val, size); in adis_write_reg()
271 * adis_read_reg() - read N bytes from register
280 guard(mutex)(&adis->state_lock); in adis_read_reg()
281 return adis->ops->read(adis, reg, val, size); in adis_read_reg()
285 * adis_write_reg_8() - Write single byte to a register
297 * adis_write_reg_16() - Write 2 bytes to a pair of registers
309 * adis_write_reg_32() - write 4 bytes to four registers
321 * adis_read_reg_16() - read 2 bytes from a 16-bit register
340 * adis_read_reg_32() - read 4 bytes from a 32-bit register
361 * adis_update_bits_base() - ADIS Update bits function - Locked version
373 guard(mutex)(&adis->state_lock); in adis_update_bits_base()
378 * adis_update_bits() - Wrapper macro for adis_update_bits_base - Locked version
394 * adis_update_bits() - Wrapper macro for adis_update_bits_base
415 guard(mutex)(&adis->state_lock); in adis_enable_irq()
421 guard(mutex)(&adis->state_lock); in adis_check_status()
425 #define adis_dev_auto_lock(adis) guard(mutex)(&(adis)->state_lock)
427 scoped_guard(mutex, &(adis)->state_lock)