Lines Matching refs:chan
33 const struct iio_chan_spec *chan; in xadc_handle_event() local
39 chan = xadc_event_to_channel(indio_dev, event); in xadc_handle_event()
41 if (chan->type == IIO_TEMP) { in xadc_handle_event()
47 IIO_UNMOD_EVENT_CODE(chan->type, chan->channel, in xadc_handle_event()
57 IIO_UNMOD_EVENT_CODE(chan->type, chan->channel, in xadc_handle_event()
71 static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan, in xadc_get_threshold_offset() argument
76 if (chan->type == IIO_TEMP) { in xadc_get_threshold_offset()
79 if (chan->channel < 2) in xadc_get_threshold_offset()
80 offset = chan->channel + 1; in xadc_get_threshold_offset()
82 offset = chan->channel + 6; in xadc_get_threshold_offset()
91 static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan) in xadc_get_alarm_mask() argument
93 if (chan->type == IIO_TEMP) { in xadc_get_alarm_mask()
96 switch (chan->channel) { in xadc_get_alarm_mask()
117 const struct iio_chan_spec *chan, enum iio_event_type type, in xadc_read_event_config() argument
122 return (bool)(xadc->alarm_mask & xadc_get_alarm_mask(chan)); in xadc_read_event_config()
126 const struct iio_chan_spec *chan, enum iio_event_type type, in xadc_write_event_config() argument
129 unsigned int alarm = xadc_get_alarm_mask(chan); in xadc_write_event_config()
165 const struct iio_chan_spec *chan, enum iio_event_type type, in xadc_read_event_value() argument
169 unsigned int offset = xadc_get_threshold_offset(chan, dir); in xadc_read_event_value()
189 const struct iio_chan_spec *chan, enum iio_event_type type, in xadc_write_event_value() argument
193 unsigned int offset = xadc_get_threshold_offset(chan, dir); in xadc_write_event_value()
216 if (chan->type == IIO_TEMP) { in xadc_write_event_value()