Lines Matching refs:xadc
45 struct xadc { struct
75 int (*read)(struct xadc *xadc, unsigned int reg, uint16_t *val); argument
76 int (*write)(struct xadc *xadc, unsigned int reg, uint16_t val);
79 void (*update_alarm)(struct xadc *xadc, unsigned int alarm);
80 unsigned long (*get_dclk_rate)(struct xadc *xadc);
86 static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_read_adc_reg() argument
89 lockdep_assert_held(&xadc->mutex); in _xadc_read_adc_reg()
90 return xadc->ops->read(xadc, reg, val); in _xadc_read_adc_reg()
93 static inline int _xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_write_adc_reg() argument
96 lockdep_assert_held(&xadc->mutex); in _xadc_write_adc_reg()
97 return xadc->ops->write(xadc, reg, val); in _xadc_write_adc_reg()
100 static inline int xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_read_adc_reg() argument
105 mutex_lock(&xadc->mutex); in xadc_read_adc_reg()
106 ret = _xadc_read_adc_reg(xadc, reg, val); in xadc_read_adc_reg()
107 mutex_unlock(&xadc->mutex); in xadc_read_adc_reg()
111 static inline int xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_write_adc_reg() argument
116 mutex_lock(&xadc->mutex); in xadc_write_adc_reg()
117 ret = _xadc_write_adc_reg(xadc, reg, val); in xadc_write_adc_reg()
118 mutex_unlock(&xadc->mutex); in xadc_write_adc_reg()