mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: linux-kernel@vger.kernel.org
Cc: Yuval Raviv <yuval.raviv@broadcom.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-hwmon@vger.kernel.org (open list:HARDWARE MONITORING),
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS),
	bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor
Date: Mon, 30 Nov 2026 14:33:10 -0800	[thread overview]
Message-ID: <20261130223310.2979752-3-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20261130223310.2979752-1-florian.fainelli@broadcom.com>

From: Yuval Raviv <yuval.raviv@broadcom.com>

The INA236 shares the same electrical characteristics as the already
supported INA232 (calibration value, shunt/bus-voltage/power LSBs,
alert support, update interval), so it reuses that configuration
verbatim. Add it to the chip enum, config table, I2C device ID table
and OF match table.

Signed-off-by: Yuval Raviv <yuval.raviv@broadcom.com>
[florian: forward porting, commit message, comments]
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/hwmon/ina2xx.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index aa5b39a87622..82598d3fac90 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -126,6 +126,7 @@ enum ina2xx_ids {
 	ina226,
 	ina232,
 	ina234,
+	ina236,
 	ina260,
 	sy24655
 };
@@ -225,6 +226,21 @@ static const struct ina2xx_config ina2xx_config[] = {
 		.current_shift = 0,
 		.has_update_interval = true,
 	},
+	[ina236] = {
+		/* same electrical characteristics as ina232 */
+		.config_default = INA226_CONFIG_DEFAULT,
+		.calibration_value = 2048,
+		.shunt_div = 400,
+		.shunt_voltage_shift = 0,
+		.bus_voltage_shift = 0,
+		.bus_voltage_lsb = 1600,
+		.power_lsb_factor = 32,
+		.has_alerts = true,
+		.has_ishunt = false,
+		.has_power_average = false,
+		.current_shift = 0,
+		.has_update_interval = true,
+	},
 	[ina260] = {
 		.config_default = INA260_CONFIG_DEFAULT,
 		.shunt_div = 400,
@@ -1140,6 +1156,7 @@ static const struct i2c_device_id ina2xx_id[] = {
 	{ .name = "ina231", .driver_data = ina226 },
 	{ .name = "ina232", .driver_data = ina232 },
 	{ .name = "ina234", .driver_data = ina234 },
+	{ .name = "ina236", .driver_data = ina236 },
 	{ .name = "ina260", .driver_data = ina260 },
 	{ .name = "sy24655", .driver_data = sy24655 },
 	{ }
@@ -1179,6 +1196,10 @@ static const struct of_device_id __maybe_unused ina2xx_of_match[] = {
 		.compatible = "ti,ina234",
 		.data = (void *)ina234
 	},
+	{
+		.compatible = "ti,ina236",
+		.data = (void *)ina236
+	},
 	{
 		.compatible = "ti,ina260",
 		.data = (void *)ina260
-- 
2.34.1


      parent reply	other threads:[~2026-11-30 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:33 [PATCH 0/2] hwmon: TI INA236 support Florian Fainelli
2026-11-30 22:33 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: add ti,ina236 compatible Florian Fainelli
2026-11-30 22:33 ` Florian Fainelli [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=20261130223310.2979752-3-florian.fainelli@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    --cc=yuval.raviv@broadcom.com \
    /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®