Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: TI INA236 support
@ 2026-11-30 22:33 Florian Fainelli
  2026-11-30 22:33 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: add ti,ina236 compatible Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Florian Fainelli @ 2026-11-30 22:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, open list:HARDWARE MONITORING,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	bcm-kernel-feedback-list

This patch series adds support for the TI INA236 power monitor which is
virtually identical to the existing TI INA232.

Yuval Raviv (2):
  dt-bindings: hwmon: ina2xx: add ti,ina236 compatible
  hwmon: ina2xx: add support for TI INA236 power monitor

 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  |  3 +++
 drivers/hwmon/ina2xx.c                        | 21 +++++++++++++++++++
 2 files changed, 24 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] dt-bindings: hwmon: ina2xx: add ti,ina236 compatible
  2026-11-30 22:33 [PATCH 0/2] hwmon: TI INA236 support Florian Fainelli
@ 2026-11-30 22:33 ` Florian Fainelli
  2026-11-30 22:33 ` [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor Florian Fainelli
  2026-11-30 22:38 ` [PATCH 0/2] hwmon: TI INA236 support sashiko-bot
  2 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2026-11-30 22:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yuval Raviv, Florian Fainelli, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, open list:HARDWARE MONITORING,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	bcm-kernel-feedback-list

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

The INA236 is electrically identical to the already-supported INA232
(same calibration/shunt/bus-voltage/power-LSB characteristics, no
configurable shunt-gain). Add it to the compatible enum and to the
same ti,shunt-gain/ti,maximum-expected-current-microamp exclusion
lists as INA232.

Signed-off-by: Yuval Raviv <yuval.raviv@broadcom.com>
[florian: commit message, description]
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index a79ade3142fa..410d2deddcae 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -31,6 +31,7 @@ properties:
       - ti,ina232
       - ti,ina233
       - ti,ina234
+      - ti,ina236
       - ti,ina237
       - ti,ina238
       - ti,ina260
@@ -117,6 +118,7 @@ allOf:
               - ti,ina231
               - ti,ina232
               - ti,ina234
+              - ti,ina236
               - ti,ina237
               - ti,ina238
               - ti,ina260
@@ -140,6 +142,7 @@ allOf:
               - ti,ina231
               - ti,ina232
               - ti,ina234
+              - ti,ina236
               - ti,ina260
               - ti,ina700
               - ti,ina780
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor
  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
  2026-11-30 22:38   ` sashiko-bot
  2026-11-30 22:38 ` [PATCH 0/2] hwmon: TI INA236 support sashiko-bot
  2 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2026-11-30 22:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yuval Raviv, Florian Fainelli, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, open list:HARDWARE MONITORING,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	bcm-kernel-feedback-list

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor
  2026-11-30 22:33 ` [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor Florian Fainelli
@ 2026-11-30 22:38   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-30 22:38 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: open list:HARDWARE MONITORING,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, robh,
	conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] hwmon: ina2xx: redundant ina236 enum and duplicate ina2xx_config
  entry
- [Low] hwmon: ina2xx: missing INA236 in Documentation/hwmon/ina2xx.rst
  and Kconfig
--

commit 351424d3ad21da9a6be43b706bb618d413e818b0
Author: Yuval Raviv <yuval.raviv@broadcom.com>

hwmon: ina2xx: add support for TI INA236 power monitor

This commit adds support for the Texas Instruments INA236 power monitor to
the ina2xx driver by adding an enum value, configuration table entry, and
I2C and OF match table entries.

> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
> index 19b35f3bf3a3c..3cacf07f805d5 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,

[Severity: Low]
Since INA236 uses the exact same configuration as INA232 and no code path
in the driver distinguishes between them, could the ina236 entries in
ina2xx_id[] and ina2xx_of_match[] point directly to ina232 instead of
adding a separate enum value and duplicating ina2xx_config[ina232]?  Other
compatible chips in this driver (ina220 using ina219, and ina230/ina231
using ina226) share the existing enum ID directly.

> @@ -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 },
>  	{ }

[Severity: Low]
Should Documentation/hwmon/ina2xx.rst and the SENSORS_INA2XX help text in
drivers/hwmon/Kconfig also be updated to list INA236 among the supported
chips, per Documentation/hwmon/submitting-patches.rst?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130223310.2979752-1-florian.fainelli@broadcom.com?part=2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] hwmon: TI INA236 support
  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 ` [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor Florian Fainelli
@ 2026-11-30 22:38 ` sashiko-bot
  2 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-30 22:38 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: open list:HARDWARE MONITORING

Sashiko has finished reviewing this 2-patch series:

- Patch 1: no issues found.
- Patch 2 ("hwmon: ina2xx: add support for TI INA236 power monitor"): 2
  potential issues (2 Low)

A detailed review has been sent as a separate reply to patch 2.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130223310.2979752-1-florian.fainelli@broadcom.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-30 22:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] hwmon: ina2xx: add support for TI INA236 power monitor Florian Fainelli
2026-11-30 22:38   ` sashiko-bot
2026-11-30 22:38 ` [PATCH 0/2] hwmon: TI INA236 support sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox