public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Chuang Zhu <git@chuang.cz>
Cc: linux-iio@vger.kernel.org, "Jonathan Cameron" <jic23@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: Wed, 8 Apr 2026 10:55:20 -0500	[thread overview]
Message-ID: <20260408155520.GA2256298-robh@kernel.org> (raw)
In-Reply-To: <20260315182304.613783-1-git@chuang.cz>

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.

Rob

      parent reply	other threads:[~2026-04-08 15:55 UTC|newest]

Thread overview: 3+ 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 [this message]

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=20260408155520.GA2256298-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=git@chuang.cz \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mtitinger@baylibre.com \
    --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