Re: [PATCH 1/3] iio: adc: mt6359-auxadc: correct channel types to IIO_VOLTAGE

From: Roman Vivchar

Date: Tue Nov 03 2026 - 19:10:54 EST



Hi Jonathan,

On Wednesday, November 4th, 2026 at 1:42 AM, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:

> On Tue, 03 Nov 2026 18:32:07 +0200
> Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@xxxxxxxxxx> wrote:
>
> > From: Roman Vivchar <rva333@xxxxxxxxxxxxxx>
> >
> > All mt6357, mt6358, mt6359 and mt6363 declare their channel types as
> > voltage, resistance and temperature. This is wrong, since the PMIC
> > doesn't include any built-in conversion block. It simply measures
> > voltage, while consumers are supposed to convert these readings to
> > the actual temperature or resistance using efuse calibration.
> Hi Roman,
>
> Useful to have an example of the consumer that is doing this.

I have sent a PMIC thermal driver in the past for mt6323. I will send
a new version soon, but it will take some time. It should be compatible
with both mt6323 and mt6358, since they use very similar formulas.

>
> >
> > Correct all channel types to IIO_VOLTAGE.
> >
> > Fixes: 3587914bf61d ("iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC")
> > Fixes: d6f49313272b ("iio: adc: mt6359: Add support for MediaTek MT6363 PMIC AUXADC")
> > Signed-off-by: Roman Vivchar <rva333@xxxxxxxxxxxxxx>
>
> This one makes me very nervous, not because it is wrong but rather
> because there may be a bunch of userspace relying on these wrong
> channel types.
>
> It is horrible but I think we can't touch that :( What we can do is
> put the right interface in place as well. Thankfully it looks like
> the channel index is independent of the channel type so we can duplicate
> the wrong channels with voltage ones + some comments to make sure this
> doesn't propagate to any new supported devices.

I believe it's a bug, because all MediaTek PMICs I know can't report
temperature or resistance without consumer. Some channels like battery
voltage were overflowing sysfs, producing garbage result.

> AngeloGioacchino, why did you go with the different channel types?
>
> If we do decide to go ahead with this approach, are there other channels
> that are validly using the channel type for non voltage? If not change
> the macro to drop the parameter.

I think mt6359 may be able to report battery current. I can't really tell
though. mt6358 seems to wire current sensing to FGADC, which is separate
block. Perhaps someone from MediaTek or ChromeOS knows more about this.

Best regards,
Roman