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);
90 static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_read_adc_reg() argument
93 lockdep_assert_held(&xadc->mutex); in _xadc_read_adc_reg()
94 return xadc->ops->read(xadc, reg, val); in _xadc_read_adc_reg()
97 static inline int _xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in _xadc_write_adc_reg() argument
100 lockdep_assert_held(&xadc->mutex); in _xadc_write_adc_reg()
101 return xadc->ops->write(xadc, reg, val); in _xadc_write_adc_reg()
104 static inline int xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_read_adc_reg() argument
109 mutex_lock(&xadc->mutex); in xadc_read_adc_reg()
110 ret = _xadc_read_adc_reg(xadc, reg, val); in xadc_read_adc_reg()
111 mutex_unlock(&xadc->mutex); in xadc_read_adc_reg()
115 static inline int xadc_write_adc_reg(struct xadc *xadc, unsigned int reg, in xadc_write_adc_reg() argument
120 mutex_lock(&xadc->mutex); in xadc_write_adc_reg()
121 ret = _xadc_write_adc_reg(xadc, reg, val); in xadc_write_adc_reg()
122 mutex_unlock(&xadc->mutex); in xadc_write_adc_reg()