Lines Matching refs:adis
22 struct adis;
82 int (*enable_irq)(struct adis *adis, bool enable);
110 struct adis { struct
138 int adis_init(struct adis *adis, struct iio_dev *indio_dev, argument
140 int __adis_reset(struct adis *adis);
148 static inline int adis_reset(struct adis *adis) in adis_reset() argument
152 mutex_lock(&adis->state_lock); in adis_reset()
153 ret = __adis_reset(adis); in adis_reset()
154 mutex_unlock(&adis->state_lock); in adis_reset()
159 int __adis_write_reg(struct adis *adis, unsigned int reg,
161 int __adis_read_reg(struct adis *adis, unsigned int reg,
170 static inline int __adis_write_reg_8(struct adis *adis, unsigned int reg, in __adis_write_reg_8() argument
173 return __adis_write_reg(adis, reg, val, 1); in __adis_write_reg_8()
182 static inline int __adis_write_reg_16(struct adis *adis, unsigned int reg, in __adis_write_reg_16() argument
185 return __adis_write_reg(adis, reg, val, 2); in __adis_write_reg_16()
194 static inline int __adis_write_reg_32(struct adis *adis, unsigned int reg, in __adis_write_reg_32() argument
197 return __adis_write_reg(adis, reg, val, 4); in __adis_write_reg_32()
206 static inline int __adis_read_reg_16(struct adis *adis, unsigned int reg, in __adis_read_reg_16() argument
212 ret = __adis_read_reg(adis, reg, &tmp, 2); in __adis_read_reg_16()
225 static inline int __adis_read_reg_32(struct adis *adis, unsigned int reg, in __adis_read_reg_32() argument
231 ret = __adis_read_reg(adis, reg, &tmp, 4); in __adis_read_reg_32()
245 static inline int adis_write_reg(struct adis *adis, unsigned int reg, in adis_write_reg() argument
250 mutex_lock(&adis->state_lock); in adis_write_reg()
251 ret = __adis_write_reg(adis, reg, val, size); in adis_write_reg()
252 mutex_unlock(&adis->state_lock); in adis_write_reg()
264 static int adis_read_reg(struct adis *adis, unsigned int reg, in adis_read_reg() argument
269 mutex_lock(&adis->state_lock); in adis_read_reg()
270 ret = __adis_read_reg(adis, reg, val, size); in adis_read_reg()
271 mutex_unlock(&adis->state_lock); in adis_read_reg()
282 static inline int adis_write_reg_8(struct adis *adis, unsigned int reg, in adis_write_reg_8() argument
285 return adis_write_reg(adis, reg, val, 1); in adis_write_reg_8()
294 static inline int adis_write_reg_16(struct adis *adis, unsigned int reg, in adis_write_reg_16() argument
297 return adis_write_reg(adis, reg, val, 2); in adis_write_reg_16()
306 static inline int adis_write_reg_32(struct adis *adis, unsigned int reg, in adis_write_reg_32() argument
309 return adis_write_reg(adis, reg, val, 4); in adis_write_reg_32()
318 static inline int adis_read_reg_16(struct adis *adis, unsigned int reg, in adis_read_reg_16() argument
324 ret = adis_read_reg(adis, reg, &tmp, 2); in adis_read_reg_16()
337 static inline int adis_read_reg_32(struct adis *adis, unsigned int reg, in adis_read_reg_32() argument
343 ret = adis_read_reg(adis, reg, &tmp, 4); in adis_read_reg_32()
350 int __adis_update_bits_base(struct adis *adis, unsigned int reg, const u32 mask,
362 static inline int adis_update_bits_base(struct adis *adis, unsigned int reg, in adis_update_bits_base() argument
367 mutex_lock(&adis->state_lock); in adis_update_bits_base()
368 ret = __adis_update_bits_base(adis, reg, mask, val, size); in adis_update_bits_base()
369 mutex_unlock(&adis->state_lock); in adis_update_bits_base()
384 #define adis_update_bits(adis, reg, mask, val) ({ \ argument
386 adis_update_bits_base(adis, reg, mask, val, sizeof(val)); \
400 #define __adis_update_bits(adis, reg, mask, val) ({ \ argument
402 __adis_update_bits_base(adis, reg, mask, val, sizeof(val)); \
405 int __adis_check_status(struct adis *adis);
406 int __adis_initial_startup(struct adis *adis);
407 int __adis_enable_irq(struct adis *adis, bool enable);
409 static inline int adis_enable_irq(struct adis *adis, bool enable) in adis_enable_irq() argument
413 mutex_lock(&adis->state_lock); in adis_enable_irq()
414 ret = __adis_enable_irq(adis, enable); in adis_enable_irq()
415 mutex_unlock(&adis->state_lock); in adis_enable_irq()
420 static inline int adis_check_status(struct adis *adis) in adis_check_status() argument
424 mutex_lock(&adis->state_lock); in adis_check_status()
425 ret = __adis_check_status(adis); in adis_check_status()
426 mutex_unlock(&adis->state_lock); in adis_check_status()
431 static inline void adis_dev_lock(struct adis *adis) in adis_dev_lock() argument
433 mutex_lock(&adis->state_lock); in adis_dev_lock()
436 static inline void adis_dev_unlock(struct adis *adis) in adis_dev_unlock() argument
438 mutex_unlock(&adis->state_lock); in adis_dev_unlock()
520 devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev,
523 int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev);
531 devm_adis_setup_buffer_and_trigger(struct adis *adis, struct iio_dev *indio_dev, in devm_adis_setup_buffer_and_trigger() argument
537 static inline int devm_adis_probe_trigger(struct adis *adis, in devm_adis_probe_trigger() argument