Re: [PATCH v4 03/10] iio: adc: add the ti-ads1262 driver
From: Jonathan Cameron
Date: Wed Sep 09 2026 - 22:43:27 EST
...
> >> +static int ads1262_fwnode_xlate(struct iio_dev *indio_dev,
> >> + const struct fwnode_reference_args *iiospec)
> >> +{
> >> + /* REVISIT: the auxiliary ADC (ADC2) is currently not supported */
> >> + if (iiospec->nargs > 1 && iiospec->args[1])
> >> + return -EINVAL;
> >> +
> >> + if (!iiospec->nargs)
> >> + return 0;
> >> +
> >> + for (unsigned int i = 0; i < indio_dev->num_channels; i++) {
> >
> > Won't this include the timestamp channel?
>
> Yes, I'll fix it.
>
> >
> >> + if (indio_dev->channels[i].address == iiospec->args[0])
> >
> > I don't think .address is the right thing to use here (it is coming from
> > reg in the devcietree). I would expect channel. Otherwise consumers in the
> > devicetree have to be away of how channels were assigned rather than picking
> > the datasheet channel number.
>
> I was very confused about what approach should I take here. All channels
> in this chip are actually differential. In that case should I make
> #io-channel-cells = 3 i.e. positive, negative and ADC?
Yes. Given the flexibility that makes sense.
You would need to sanity check the channel is actually present that
matches those choices though.
>
> >
> > And the devicetree bindings should mention the monitor channel numbers (11 - 14).
> >
> >> + return i;
> >> + }
> >> +
> >> + return -EINVAL;
> >> +}
> >> +
> >
> > ...