Re: [PATCH 2/2] iio: temperature: ltc2983: Add support for ADT7604
From: Jonathan Cameron
Date: Tue May 12 2026 - 06:55:45 EST
On Tue, 12 May 2026 09:24:27 +0100
Nuno Sá <noname.nuno@xxxxxxxxx> wrote:
> On Mon, May 11, 2026 at 12:02:31PM +0000, Stan, Liviu wrote:
> > On Mon, 11 May 2026 Jonathan Cameron wrote:
> > > > > Ok. So what are our options here? Present it as simple resistance and leave
> > > > > userspace to figure it out or add a new channel type? To me feels like new
> > > > > channel type makes sense.
> > > >
> > > > The current approach presents it as IIO_TEMP since the chip outputs coverage
> > > > (using the custom table interpolation) via the temperature result bank, not
> > > > the resistance bank, but I agree a new channel type makes sense. Should I
> > > > create a specific type like IIO_COVERAGE_PERCENT or would a general
> > > > IIO_PERCENTAGE be better?
> > >
> > > For ABI purposes we don't care where it comes from.
> > >
> > > We already have some 'ratio' type measurements like concentration which are
> > > percentages and similar to those I think we need some indication of 'what'
> > > is being measured given it's unit free. Hence IIO_COVERAGE_PERCENT seems
> > > the better choice to me.
> >
> > Understood. Will do that in v2.
>
> I do wonder if a complete type is what we want? How will we present it?
>
> in_coverage_ratio?
>
> What I'm not too convinced is that coverage is relative to what? Well
> it's a percentage so I guess we could not care and leave interpretation to
> userspace (to know which device is dealing with). Still I wonder if a
> new iio_chan_info wouldn't be more appropriate? In this case applied to
> iio_resistance. So something like:
>
> in_resistance_coverage_ratio
I'm perhaps missing something - as far as I understand it there is no meaningful
connection to resistance in what is being measured.
I think what you are proposing is similar to measuring current via voltage
drop over a sense resistor. We don't present that as modified voltage, we
present it as current.
Here the thing being measured is coverage rather than resistance
so keeping resistance in there is confusing for the user.
If we wanted a type to modify then we could do this as a modified area measurement.
Channel type IIO_AREA (which is new) and modifier IIO_MOD_RATIO (also new).
Jonathan
>
> So it's clear what physical quantity coverage ratio is affecting.
>
> Thoughts?
> - Nuno Sá
>
> >
> > Thank you!
> >
> > Liviu