From: Jonathan Cameron <jic23@kernel.org>
To: Roman Vivchar <rva333@protonmail.com>
Cc: "Roman Vivchar via B4 Relay"
<devnull+rva333.protonmail.com@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
"Chen-Yu Tsai" <wenst@chromium.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/3] iio: adc: mt6359-auxadc: correct channel types to IIO_VOLTAGE
Date: Sat, 14 Nov 2026 18:48:47 +0000 [thread overview]
Message-ID: <20261114184847.70ae590e@jic23-hlaptop> (raw)
In-Reply-To: <LVXIwHr3ekY5Ao7bcfza5XGvBZor-SdLtC_MF1qWu5S0zG2vylGpgamn2xVPcw5hQ5Vedb4ALvs1oyzs7Td3ssP1pF6OjogIICu97Suo1bI=@protonmail.com>
On Tue, 10 Nov 2026 20:39:47 +0000
Roman Vivchar <rva333@protonmail.com> wrote:
> Hi Jonathan,
>
> On Wednesday, November 4th, 2026 at 1:42 AM, Jonathan Cameron <jic23@kernel.org> wrote:
>
> > On Tue, 03 Nov 2026 18:32:07 +0200
> > Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org> wrote:
>
> ...
>
> > >
> > > 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@protonmail.com>
> >
> > 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.
>
> Sorry I forgot to include this in my previous reply, but do you suggest
> duplicating the old channels and adding the fixed ones as separate entries?
Yes.
>
> That would cause issues for in-kernel consumers. In my tree I have a
> battery thermal zone driven by ntc_thermistor (which is actually how I
> found this bug, as it refused to probe due to the wrong channel type),
> and I will soon send a new revision of the PMIC thermal driver. They all
> require IIO_VOLTAGE channels to operate properly. If we duplicate the
> channels, consumers will get the wrong type unless we reorder the array
> or add a custom xlate callback.
Indeed, one of those two solutions should deal with this.
>
> Existing userspace tools would get bogus values from the current ABI
> anyway. The driver applies a raw mV scale to all channels, while thermal
> needs efuse calibration with a special formula applied, and even plain
> voltage channels like bat_adc and cdt_v were mislabeled as resistance and
> temperature.
Ah. If the values are effectively useless we can hopefully assume no
one is actually using them and hence the risk is low.
>
> Given all this, I think it's better to simply fix channel types.
>
> Best regards,
> Roman
>
next prev parent reply other threads:[~2026-11-14 18:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 16:32 [PATCH 0/3] iio: adc: mt6359-auxadc: various fixes Roman Vivchar via B4 Relay
2026-11-03 16:32 ` [PATCH 1/3] iio: adc: mt6359-auxadc: correct channel types to IIO_VOLTAGE Roman Vivchar via B4 Relay
2026-11-03 23:42 ` Jonathan Cameron
2026-11-04 0:10 ` Roman Vivchar
2026-11-10 20:39 ` Roman Vivchar
2026-11-14 18:48 ` Jonathan Cameron [this message]
2026-11-03 16:32 ` [PATCH 2/3] iio: adc: mt6359-auxadc: mask conversion ready bit in mt6358_read_imp Roman Vivchar via B4 Relay
2026-11-03 23:45 ` Jonathan Cameron
2026-11-04 0:19 ` Roman Vivchar
2026-11-14 18:50 ` Jonathan Cameron
2026-11-03 16:32 ` [PATCH 3/3] iio: adc: mt6359-auxadc: fix scale calculation Roman Vivchar via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261114184847.70ae590e@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devnull+rva333.protonmail.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nfraprado@collabora.com \
--cc=nuno.sa@analog.com \
--cc=rva333@protonmail.com \
--cc=wenst@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®