Skip to contentSkip to conversation

hwmon: Add support for the INA260 chip to the INA219 and compatibles driver

PATCH In review Loic Guegan 2 participants 2 messages Aug 20, 2023 – Aug 30, 2024 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Add support for the INA260 chip to the INA219 and compatibles driver

This patch allows to retrieve current, bus voltage and power measurements from the INA260 using its default configuration.

As the INA260 provides integrated shunt, the "ishunt" configuration parameter is introduced. As such, proper attributes can be attached with hwmon and shunt calibration related routnies can be ignored. In addition, the actual INA2XX current register address differ from the INA260 as it does not provide a shunt register. Thus, a specific register address INA2XX_CURRENT_ISHUNT for chips with integrated shunts is proposed.

---
 drivers/hwmon/Kconfig  |  2 +-
 drivers/hwmon/ina2xx.c | 77 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 64 insertions(+), 15 deletions(-)
drivers/hwmon/Kconfig +1 -1
index 307477b8a371..69b75a62c1cf 100644
@@ -2022,7 +2022,7 @@ config SENSORS_INA2XX
 	select REGMAP_I2C
 	help
 	  If you say yes here you get support for INA219, INA220, INA226,
-	  INA230, and INA231 power monitor chips.
+	  INA230, INA231 and INA260 power monitor chips.
 
 	  The INA2xx driver is configured for the default configuration of
 	  the part as described in the datasheet.
drivers/hwmon/ina2xx.c +63 -14

178 lines not on this page · raw message

Signature · 1 line
2.41.0
maintainer
#1 lore raw

Hi,

Quoted 11 lines · Loic Guegan

This patch allows to retrieve current, bus voltage and power measurements from the INA260 using its default configuration.

As the INA260 provides integrated shunt, the "ishunt" configuration parameter is introduced. As such, proper attributes can be attached with hwmon and shunt calibration related routnies can be ignored. In addition, the actual INA2XX current register address differ from the INA260 as it does not provide a shunt register. Thus, a specific register address INA2XX_CURRENT_ISHUNT for chips with integrated shunts is proposed.

Quoted 1 line

This patch will no longer apply after the series at
https://lore.kernel.org/linux-hwmon/[email protected]/T/#t
is accepted and applied. It is also less than perfect since it does not support current limits. Adjusting the driver to support ina260 should be much more straightforward after the above patches are applied. I'll send a follow-up series of patches after I was able to test it with a real chip (I am currently waiting for an evaluation board to arrive).

In case anyone is curious, the (untested) patches necessary to support INA260 are available in the hwmon-staging and testing branches of
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git

Guenter