From: Jonathan Cameron <jic23@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: "Chuang Zhu" <git@chuang.cz>,
linux-iio@vger.kernel.org,
"Marc Titinger" <mtitinger@baylibre.com>,
"Stefan Brüns" <stefan.bruens@rwth-aachen.de>
Subject: Re: [PATCH v3] iio: adc: ina2xx: add INA236 support
Date: Sun, 12 Apr 2026 15:34:07 +0100 [thread overview]
Message-ID: <20260412153347.539c5eee@jic23-huawei> (raw)
In-Reply-To: <20260408155520.GA2256298-robh@kernel.org>
On Wed, 8 Apr 2026 10:55:20 -0500
Rob Herring <robh@kernel.org> wrote:
> On Mon, Mar 16, 2026 at 02:23:04AM +0800, Chuang Zhu wrote:
> > The calibration divisor is not directly specified in the datasheet, but can be calculated:
> >
> > I = Current_LSB * Current
> > Current = ShuntVoltage * CAL / calibration_divisor
> > CAL = 0.00512 / (Current_LSB * Rshunt)
> > ShuntVoltage = Vshunt / ShuntVoltage_LSB
> >
> > => I = (0.00512 / (calibration_divisor*ShuntVoltage_LSB)) * (Vshunt / Rshunt)
> >
> > Ohm's law, I = Vshunt / Rshunt
> > => 0.00512 / (calibration_divisor*ShuntVoltage_LSB) = 1
> >
> > ShuntVoltage_LSB = 2.5 uV = 0.0000025 V
> > => calibration_divisor = 2048
> >
> > Signed-off-by: Chuang Zhu <git@chuang.cz>
>
>
> > @@ -1082,6 +1117,10 @@ static const struct of_device_id ina2xx_of_match[] = {
> > .compatible = "ti,ina231",
> > .data = (void *)ina226
> > },
> > + {
> > + .compatible = "ti,ina236",
>
> This is not documented. Please add/extend a binding for it.
Good point. I missed that.
As this has gone upstream now, follow up patch please.
Jonathan
>
> Rob
next prev parent reply other threads:[~2026-04-12 14:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 18:23 [PATCH v3] iio: adc: ina2xx: add INA236 support Chuang Zhu
2026-03-21 19:45 ` Jonathan Cameron
2026-04-08 15:55 ` Rob Herring
2026-04-12 14:34 ` Jonathan Cameron [this message]
2026-04-12 15:21 ` Chuang Zhu
2026-04-20 14:28 ` Jonathan Cameron
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=20260412153347.539c5eee@jic23-huawei \
--to=jic23@kernel.org \
--cc=git@chuang.cz \
--cc=linux-iio@vger.kernel.org \
--cc=mtitinger@baylibre.com \
--cc=robh@kernel.org \
--cc=stefan.bruens@rwth-aachen.de \
/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