Lines Matching refs:chan

472 				      const struct iio_chan_spec *chan, char *buf)
477 !!(st->cb_mask[chan->address >> 8] &
478 BIT(chan->address & 0xFF)));
483 const struct iio_chan_spec *chan,
495 devaddr = chan->address >> 8;
496 ch = chan->address & 0xFF;
514 const struct iio_chan_spec *chan,
522 ret = ad7280_read_reg(st, chan->address >> 8,
523 (chan->address & 0xFF) + AD7280A_CB1_TIMER_REG);
536 const struct iio_chan_spec *chan,
554 ret = ad7280_write(st, chan->address >> 8,
555 (chan->address & 0xFF) + AD7280A_CB1_TIMER_REG, 0,
589 static void ad7280_voltage_channel_init(struct iio_chan_spec *chan, int i,
592 chan->type = IIO_VOLTAGE;
593 chan->differential = 1;
594 chan->channel = i;
595 chan->channel2 = chan->channel + 1;
597 chan->event_spec = ad7280_events;
598 chan->num_event_specs = ARRAY_SIZE(ad7280_events);
600 chan->ext_info = ad7280_cell_ext_info;
603 static void ad7280_temp_channel_init(struct iio_chan_spec *chan, int i,
606 chan->type = IIO_TEMP;
607 chan->channel = i;
609 chan->event_spec = ad7280_events;
610 chan->num_event_specs = ARRAY_SIZE(ad7280_events);
614 static void ad7280_common_fields_init(struct iio_chan_spec *chan, int addr,
617 chan->indexed = 1;
618 chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW);
619 chan->info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE);
620 chan->info_mask_shared_by_all = BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO);
621 chan->address = addr;
622 chan->scan_index = cnt;
623 chan->scan_type.sign = 'u';
624 chan->scan_type.realbits = 12;
625 chan->scan_type.storagebits = 32;
628 static void ad7280_total_voltage_channel_init(struct iio_chan_spec *chan,
631 chan->type = IIO_VOLTAGE;
632 chan->differential = 1;
633 chan->channel = 0;
634 chan->channel2 = dev * AD7280A_CELLS_PER_DEV;
635 chan->address = AD7280A_ALL_CELLS;
636 chan->indexed = 1;
637 chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW);
638 chan->info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE);
639 chan->scan_index = cnt;
640 chan->scan_type.sign = 'u';
641 chan->scan_type.realbits = 32;
642 chan->scan_type.storagebits = 32;
649 struct iio_chan_spec *chan;
652 chan = &st->channels[*cnt];
656 ad7280_voltage_channel_init(chan, i, irq_present);
659 ad7280_temp_channel_init(chan, i, irq_present);
663 ad7280_common_fields_init(chan, addr, *cnt);
687 const struct iio_chan_spec *chan,
694 switch (chan->type) {
725 const struct iio_chan_spec *chan,
740 switch (chan->type) {
882 struct iio_chan_spec const *chan,
893 if (chan->address == AD7280A_ALL_CELLS)
896 ret = ad7280_read_channel(st, chan->address >> 8,
897 chan->address & 0xFF);
907 if ((chan->address & 0xFF) <= AD7280A_CELL_VOLTAGE_6_REG)
922 struct iio_chan_spec const *chan,
1005 if (device_property_present(dev, "adi,voltage-alert-last-chan")) {
1008 ret = device_property_read_u32(dev, "adi,voltage-alert-last-chan", &val);