Lines Matching refs:xadc
44 struct xadc { struct
78 int (*read)(struct xadc *xadc, unsigned int reg, uint16_t *val); argument
79 int (*write)(struct xadc *xadc, unsigned int reg, uint16_t val);
82 void (*update_alarm)(struct xadc *xadc, unsigned int alarm);
83 unsigned long (*get_dclk_rate)(struct xadc *xadc);
92 static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_read_adc_reg() argument
95 lockdep_assert_held(&xadc->mutex); in _xadc_read_adc_reg()
96 return xadc->ops->read(xadc, reg, val); in _xadc_read_adc_reg()
99 static inline int _xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_write_adc_reg() argument
102 lockdep_assert_held(&xadc->mutex); in _xadc_write_adc_reg()
103 return xadc->ops->write(xadc, reg, val); in _xadc_write_adc_reg()
106 static inline int xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_read_adc_reg() argument
111 mutex_lock(&xadc->mutex); in xadc_read_adc_reg()
112 ret = _xadc_read_adc_reg(xadc, reg, val); in xadc_read_adc_reg()
113 mutex_unlock(&xadc->mutex); in xadc_read_adc_reg()
117 static inline int xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_write_adc_reg() argument
122 mutex_lock(&xadc->mutex); in xadc_write_adc_reg()
123 ret = _xadc_write_adc_reg(xadc, reg, val); in xadc_write_adc_reg()
124 mutex_unlock(&xadc->mutex); in xadc_write_adc_reg()