RE: [PATCH 2/2] iio: temperature: ltc2983: Add support for ADT7604
From: Stan, Liviu
Date: Tue May 12 2026 - 07:55:53 EST
On Tue, May 12, 2026, Nuno Sá wrote:
> > > > 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
>
> So it's clear what physical quantity coverage ratio is affecting.
I still think a new channel type is the right approach. Consider copper
trace sensors - they also support a custom table, and when one is
provided the chip outputs both a resistance result and a temperature
result (the interpolation output), each in their own register bank. The
current approach handles that with separate IIO_RESISTANCE and
IIO_TEMP channels. So, for consistency, if we use a chan_info
attribute for the leak detector coverage output, we would need to do
the same for the copper trace temperature output. Since IIO_TEMP
makes sense for the interpolation result for copper traces and
because it is a distinct physical quantity output by the chip, I think it
would make the most sense that leak detectors follow the same
pattern and create a separate IIO channel.
What do you think?
Thanks,
Liviu