hwmon: ina2xx: add support for TI INA236
Subsystems (3)
v2 cover hwmon: ina2xx: add support for TI INA236
This series adds support for the TI INA236 current, voltage and power monitor to the ina2xx hwmon driver. The INA236 is electrically identical to the INA232 as far as this driver is concerned, so it reuses the existing ina232 configuration.
Patch 1 fills a documentation gap for the already supported INA232, patch 2 adds the ti,ina236 compatible to the binding and patch 3 adds the driver support along with its documentation.
Changes in v2:
- Add patch 1 documenting the INA232 in the Kconfig help text and in Documentation/hwmon/ina2xx.rst
- Reuse the ina232 configuration for the INA236 instead of adding a separate enum value and a duplicated ina2xx_config[] entry
- List the INA236 in the Kconfig help text and in Documentation/hwmon/ina2xx.rst
- No changes to the dt-bindings patch
Florian Fainelli (1):
hwmon: ina2xx: document INA232 support
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 ++ Documentation/hwmon/ina2xx.rst | 28 +++++++++++++++++-- drivers/hwmon/Kconfig | 3 +- drivers/hwmon/ina2xx.c | 5 ++++ 4 files changed, 35 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/3 hwmon: ina2xx: document INA232 support
Commit d1db9b08fbf3 ("hwmon: (ina2xx) Add support for INA232") did not update the SENSORS_INA2XX Kconfig help text or Documentation/hwmon/ina2xx.rst. List the INA232 in both, including the supported chips entry, the description and the alert/limit sysfs entries.
---
Changes in v2:
- New patch.
Documentation/hwmon/ina2xx.rst | 15 +++++++++++++-- drivers/hwmon/Kconfig | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-)
Documentation/hwmon/ina2xx.rst +13 -2
@@ -74,6 +74,16 @@ Supported chips: https://us1.silergy.com/ + * Texas Instruments INA232 + + Prefix: 'ina232' + + Addresses: I2C 0x40 - 0x43 and 0x48 - 0x4b + + Datasheet: Publicly available at the Texas Instruments website + + https://www.ti.com/ + * Texas Instruments INA234 Prefix: 'ina234'
@@ -99,8 +109,8 @@ interface. The INA220 monitors both shunt drop and supply voltage. The INA226 is a current shunt and power monitor with an I2C interface. The INA226 monitors both a shunt voltage drop and bus supply voltage. -INA230, INA231, and INA234 are high or low side current shunt and power monitors -with an I2C interface. The chips monitor both a shunt voltage drop and +INA230, INA231, INA232, and INA234 are high or low side current shunt and power +monitors with an I2C interface. The chips monitor both a shunt voltage drop and bus supply voltage. INA260 is a high or low side current and power monitor with integrated shunt
@@ -142,6 +152,7 @@ Additional entries are available for the following chips: * ina226 * ina230 * ina231 + * ina232 * ina234 * ina260 * sy24655
drivers/hwmon/Kconfig +2 -1
@@ -2456,7 +2456,8 @@ config SENSORS_INA2XX select REGMAP_I2C help If you say yes here you get support for INA219, INA220, INA226, - INA230, INA231, INA234, INA260, and SY24655 power monitor chips. + INA230, INA231, INA232, INA234, INA260, and SY24655 power monitor + chips. The INA2xx driver is configured for the default configuration of the part as described in the datasheet.
Signature · 1 line
2.34.1
PATCH v2 2/3 dt-bindings: hwmon: ina2xx: add ti,ina236 compatible
In reply to Florian FainelliFrom: Yuval Raviv <[email protected]>
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.
---
Changes in v2:
- None.
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml +3 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v2 3/3 hwmon: ina2xx: add support for TI INA236 power monitor
In reply to Florian FainelliFrom: Yuval Raviv <[email protected]>
The INA236 shares the same electrical characteristics as the already supported INA232 (calibration value, shunt/bus-voltage/power LSBs, alert support, update interval), and no code path in the driver needs to tell the two apart. Add it to the I2C device ID table and OF match table using the existing ina232 configuration, and list it in the Kconfig help text and in the driver documentation.
---
Changes in v2:
- Drop the ina236 enum value and the duplicated ina2xx_config[] entry, point the ina236 I2C ID and OF match entries at ina232 instead
- Update the SENSORS_INA2XX Kconfig help text and Documentation/hwmon/ina2xx.rst to list the INA236
Documentation/hwmon/ina2xx.rst | 17 ++++++++++++++--- drivers/hwmon/Kconfig | 4 ++-- drivers/hwmon/ina2xx.c | 5 +++++ 3 files changed, 21 insertions(+), 5 deletions(-)
Documentation/hwmon/ina2xx.rst +14 -3
@@ -94,6 +94,16 @@ Supported chips: https://www.ti.com/ + * Texas Instruments INA236 + + Prefix: 'ina236' + + Addresses: I2C 0x40 - 0x43 and 0x48 - 0x4b + + Datasheet: Publicly available at the Texas Instruments website + + https://www.ti.com/ + Author: Lothar Felten <[email protected]> Description
@@ -109,9 +119,9 @@ interface. The INA220 monitors both shunt drop and supply voltage. The INA226 is a current shunt and power monitor with an I2C interface. The INA226 monitors both a shunt voltage drop and bus supply voltage. -INA230, INA231, INA232, and INA234 are high or low side current shunt and power -monitors with an I2C interface. The chips monitor both a shunt voltage drop and -bus supply voltage. +INA230, INA231, INA232, INA234, and INA236 are high or low side current shunt +and power monitors with an I2C interface. The chips monitor both a shunt +voltage drop and bus supply voltage. INA260 is a high or low side current and power monitor with integrated shunt resistor.
@@ -154,6 +164,7 @@ Additional entries are available for the following chips: * ina231 * ina232 * ina234 + * ina236 * ina260 * sy24655
drivers/hwmon/Kconfig +2 -2
@@ -2456,8 +2456,8 @@ config SENSORS_INA2XX select REGMAP_I2C help If you say yes here you get support for INA219, INA220, INA226, - INA230, INA231, INA232, INA234, INA260, and SY24655 power monitor - chips. + INA230, INA231, INA232, INA234, INA236, INA260, and SY24655 power + monitor chips. The INA2xx driver is configured for the default configuration of the part as described in the datasheet.
drivers/hwmon/ina2xx.c +5 -0
@@ -1140,6 +1140,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 = ina232 }, { .name = "ina260", .driver_data = ina260 }, { .name = "sy24655", .driver_data = sy24655 }, { }
@@ -1179,6 +1180,10 @@ static const struct of_device_id __maybe_unused ina2xx_of_match[] = { .compatible = "ti,ina234", .data = (void *)ina234 }, + { + .compatible = "ti,ina236", + .data = (void *)ina232 + }, { .compatible ="ti,ina260" , .data = (void *)ina260
Signature · 1 line
2.34.1
[email protected]
AI reviewSashiko has reviewed this 3-patch series and found no issues.
Sashiko has reviewed this 3-patch series and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]