* [PATCH V2 1/3] dt-bindings: hwmon: ti,ina2xx: Add INA234 device
2026-02-19 13:01 [PATCH V2 0/3] hwmon: INA234 Ian Ray
@ 2026-02-19 13:01 ` Ian Ray
2026-02-19 13:01 ` [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices Ian Ray
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Ian Ray @ 2026-02-19 13:01 UTC (permalink / raw)
To: Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Ian Ray, Bence Csókás, Tomaž Zaman, linux-hwmon,
linux-doc, linux-kernel, Krzysztof Kozlowski, devicetree,
Krzysztof Kozlowski
Add a compatible string for the INA234 device, which is like INA226 but
has different scaling.
Note that the device tree compatible must be different since the driver
uses the compatible to configure the scaling.
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> # v1
---
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 d3cde8936686..009d78b30859 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -29,6 +29,7 @@ properties:
- ti,ina230
- ti,ina231
- ti,ina233
+ - ti,ina234
- ti,ina237
- ti,ina238
- ti,ina260
@@ -113,6 +114,7 @@ allOf:
- ti,ina228
- ti,ina230
- ti,ina231
+ - ti,ina234
- ti,ina237
- ti,ina238
- ti,ina260
@@ -134,6 +136,7 @@ allOf:
- ti,ina226
- ti,ina230
- ti,ina231
+ - ti,ina234
- ti,ina260
- ti,ina700
- ti,ina780
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
2026-02-19 13:01 [PATCH V2 0/3] hwmon: INA234 Ian Ray
2026-02-19 13:01 ` [PATCH V2 1/3] dt-bindings: hwmon: ti,ina2xx: Add INA234 device Ian Ray
@ 2026-02-19 13:01 ` Ian Ray
2026-02-19 15:59 ` Guenter Roeck
` (2 more replies)
2026-02-19 13:01 ` [PATCH V2 3/3] hwmon: (ina2xx) Add support for INA234 Ian Ray
2026-02-21 7:02 ` [PATCH V2 0/3] hwmon: INA234 Jens Almer
3 siblings, 3 replies; 10+ messages in thread
From: Ian Ray @ 2026-02-19 13:01 UTC (permalink / raw)
To: Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Ian Ray, Bence Csókás, Tomaž Zaman, linux-hwmon,
linux-doc, linux-kernel, Krzysztof Kozlowski, devicetree
* Make sysfs entries documentation easier to maintain.
* Use multi-line enum.
* Correct "has_power_average" comment.
Create a new "has_update_interval" member for chips which support
averaging.
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
---
Documentation/hwmon/ina2xx.rst | 12 ++++++++++--
drivers/hwmon/ina2xx.c | 21 +++++++++++++++++----
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/Documentation/hwmon/ina2xx.rst b/Documentation/hwmon/ina2xx.rst
index a3860aae444c..a4ddf4bd2b08 100644
--- a/Documentation/hwmon/ina2xx.rst
+++ b/Documentation/hwmon/ina2xx.rst
@@ -124,8 +124,16 @@ power1_input Power(uW) measurement channel
shunt_resistor Shunt resistance(uOhm) channel (not for ina260)
======================= ===============================================
-Additional sysfs entries for ina226, ina230, ina231, ina260, and sy24655
-------------------------------------------------------------------------
+Additional sysfs entries
+------------------------
+
+Additional entries are available for the following chips:
+
+ * ina226
+ * ina230
+ * ina231
+ * ina260
+ * sy24655
======================= ====================================================
curr1_lcrit Critical low current
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index 69ac0468dee4..4bf609e25f8a 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -46,9 +46,11 @@
#define INA2XX_CURRENT 0x04 /* readonly */
#define INA2XX_CALIBRATION 0x05
-/* INA226 register definitions */
+/* INA2xx register definitions */
#define INA226_MASK_ENABLE 0x06
#define INA226_ALERT_LIMIT 0x07
+
+/* INA226 register definitions */
#define INA226_DIE_ID 0xFF
/* SY24655 register definitions */
@@ -135,13 +137,19 @@ static const struct regmap_config ina2xx_regmap_config = {
.writeable_reg = ina2xx_writeable_reg,
};
-enum ina2xx_ids { ina219, ina226, ina260, sy24655 };
+enum ina2xx_ids {
+ ina219,
+ ina226,
+ ina260,
+ sy24655
+};
struct ina2xx_config {
u16 config_default;
bool has_alerts; /* chip supports alerts and limits */
bool has_ishunt; /* chip has internal shunt resistor */
- bool has_power_average; /* chip has internal shunt resistor */
+ bool has_power_average; /* chip supports average power */
+ bool has_update_interval;
int calibration_value;
int shunt_div;
int bus_voltage_shift;
@@ -171,6 +179,7 @@ static const struct ina2xx_config ina2xx_config[] = {
.has_alerts = false,
.has_ishunt = false,
.has_power_average = false,
+ .has_update_interval = false,
},
[ina226] = {
.config_default = INA226_CONFIG_DEFAULT,
@@ -182,6 +191,7 @@ static const struct ina2xx_config ina2xx_config[] = {
.has_alerts = true,
.has_ishunt = false,
.has_power_average = false,
+ .has_update_interval = true,
},
[ina260] = {
.config_default = INA260_CONFIG_DEFAULT,
@@ -192,6 +202,7 @@ static const struct ina2xx_config ina2xx_config[] = {
.has_alerts = true,
.has_ishunt = true,
.has_power_average = false,
+ .has_update_interval = true,
},
[sy24655] = {
.config_default = SY24655_CONFIG_DEFAULT,
@@ -203,6 +214,7 @@ static const struct ina2xx_config ina2xx_config[] = {
.has_alerts = true,
.has_ishunt = false,
.has_power_average = true,
+ .has_update_interval = false,
},
};
@@ -706,6 +718,7 @@ static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type
const struct ina2xx_data *data = _data;
bool has_alerts = data->config->has_alerts;
bool has_power_average = data->config->has_power_average;
+ bool has_update_interval = data->config->has_update_interval;
enum ina2xx_ids chip = data->chip;
switch (type) {
@@ -768,7 +781,7 @@ static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type
case hwmon_chip:
switch (attr) {
case hwmon_chip_update_interval:
- if (chip == ina226 || chip == ina260)
+ if (has_update_interval)
return 0644;
break;
default:
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
2026-02-19 13:01 ` [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices Ian Ray
@ 2026-02-19 15:59 ` Guenter Roeck
2026-02-19 20:44 ` Bence Csókás
2026-02-20 1:13 ` kernel test robot
2026-02-20 1:54 ` kernel test robot
2 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2026-02-19 15:59 UTC (permalink / raw)
To: Ian Ray, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Bence Csókás, Tomaž Zaman, linux-hwmon, linux-doc,
linux-kernel, Krzysztof Kozlowski, devicetree
On 2/19/26 05:01, Ian Ray wrote:
> * Make sysfs entries documentation easier to maintain.
> * Use multi-line enum.
> * Correct "has_power_average" comment.
>
> Create a new "has_update_interval" member for chips which support
> averaging.
>
> Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
> ---
> Documentation/hwmon/ina2xx.rst | 12 ++++++++++--
> drivers/hwmon/ina2xx.c | 21 +++++++++++++++++----
> 2 files changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/hwmon/ina2xx.rst b/Documentation/hwmon/ina2xx.rst
> index a3860aae444c..a4ddf4bd2b08 100644
> --- a/Documentation/hwmon/ina2xx.rst
> +++ b/Documentation/hwmon/ina2xx.rst
> @@ -124,8 +124,16 @@ power1_input Power(uW) measurement channel
> shunt_resistor Shunt resistance(uOhm) channel (not for ina260)
> ======================= ===============================================
>
> -Additional sysfs entries for ina226, ina230, ina231, ina260, and sy24655
> -------------------------------------------------------------------------
> +Additional sysfs entries
> +------------------------
> +
> +Additional entries are available for the following chips:
> +
> + * ina226
> + * ina230
> + * ina231
> + * ina260
> + * sy24655
>
> ======================= ====================================================
> curr1_lcrit Critical low current
> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
> index 69ac0468dee4..4bf609e25f8a 100644
> --- a/drivers/hwmon/ina2xx.c
> +++ b/drivers/hwmon/ina2xx.c
> @@ -46,9 +46,11 @@
> #define INA2XX_CURRENT 0x04 /* readonly */
> #define INA2XX_CALIBRATION 0x05
>
> -/* INA226 register definitions */
> +/* INA2xx register definitions */
There was a reason for this. INA219 does not support those registers
or, more generically, they are only supported on chips supporting
alert limits.
> #define INA226_MASK_ENABLE 0x06
> #define INA226_ALERT_LIMIT 0x07
> +
> +/* INA226 register definitions */
> #define INA226_DIE_ID 0xFF
That isn't even used, and the comment is wrong (at least INA230 and INA260
also support it). Might as well drop it.
Either case, is that bike shedding really necessary ? The only really valuable
change in this patch is the introduction of has_update_interval. Please keep that
and drop the rest.
Thanks,
Guenter
>
> /* SY24655 register definitions */
> @@ -135,13 +137,19 @@ static const struct regmap_config ina2xx_regmap_config = {
> .writeable_reg = ina2xx_writeable_reg,
> };
>
> -enum ina2xx_ids { ina219, ina226, ina260, sy24655 };
> +enum ina2xx_ids {
> + ina219,
> + ina226,
> + ina260,
> + sy24655
> +};
>
> struct ina2xx_config {
> u16 config_default;
> bool has_alerts; /* chip supports alerts and limits */
> bool has_ishunt; /* chip has internal shunt resistor */
> - bool has_power_average; /* chip has internal shunt resistor */
> + bool has_power_average; /* chip supports average power */
> + bool has_update_interval;
> int calibration_value;
> int shunt_div;
> int bus_voltage_shift;
> @@ -171,6 +179,7 @@ static const struct ina2xx_config ina2xx_config[] = {
> .has_alerts = false,
> .has_ishunt = false,
> .has_power_average = false,
> + .has_update_interval = false,
> },
> [ina226] = {
> .config_default = INA226_CONFIG_DEFAULT,
> @@ -182,6 +191,7 @@ static const struct ina2xx_config ina2xx_config[] = {
> .has_alerts = true,
> .has_ishunt = false,
> .has_power_average = false,
> + .has_update_interval = true,
> },
> [ina260] = {
> .config_default = INA260_CONFIG_DEFAULT,
> @@ -192,6 +202,7 @@ static const struct ina2xx_config ina2xx_config[] = {
> .has_alerts = true,
> .has_ishunt = true,
> .has_power_average = false,
> + .has_update_interval = true,
> },
> [sy24655] = {
> .config_default = SY24655_CONFIG_DEFAULT,
> @@ -203,6 +214,7 @@ static const struct ina2xx_config ina2xx_config[] = {
> .has_alerts = true,
> .has_ishunt = false,
> .has_power_average = true,
> + .has_update_interval = false,
> },
> };
>
> @@ -706,6 +718,7 @@ static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type
> const struct ina2xx_data *data = _data;
> bool has_alerts = data->config->has_alerts;
> bool has_power_average = data->config->has_power_average;
> + bool has_update_interval = data->config->has_update_interval;
> enum ina2xx_ids chip = data->chip;
>
> switch (type) {
> @@ -768,7 +781,7 @@ static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type
> case hwmon_chip:
> switch (attr) {
> case hwmon_chip_update_interval:
> - if (chip == ina226 || chip == ina260)
> + if (has_update_interval)
> return 0644;
> break;
> default:
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
2026-02-19 15:59 ` Guenter Roeck
@ 2026-02-19 20:44 ` Bence Csókás
0 siblings, 0 replies; 10+ messages in thread
From: Bence Csókás @ 2026-02-19 20:44 UTC (permalink / raw)
To: Guenter Roeck, Ian Ray, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Tomaž Zaman, linux-hwmon, linux-doc, linux-kernel,
Krzysztof Kozlowski, devicetree
Hi,
On 2/19/26 16:59, Guenter Roeck wrote:
> On 2/19/26 05:01, Ian Ray wrote:
>> diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
>> index 69ac0468dee4..4bf609e25f8a 100644
>> --- a/drivers/hwmon/ina2xx.c
>> +++ b/drivers/hwmon/ina2xx.c
>> @@ -46,9 +46,11 @@
>> #define INA2XX_CURRENT 0x04 /* readonly */
>> #define INA2XX_CALIBRATION 0x05
>> -/* INA226 register definitions */
>> +/* INA2xx register definitions */
>
> There was a reason for this. INA219 does not support those registers
> or, more generically, they are only supported on chips supporting
> alert limits.
>
>> #define INA226_MASK_ENABLE 0x06
>> #define INA226_ALERT_LIMIT 0x07
>> +
>> +/* INA226 register definitions */
>> #define INA226_DIE_ID 0xFF
>
> That isn't even used, and the comment is wrong (at least INA230 and INA260
> also support it). Might as well drop it.
>
> Either case, is that bike shedding really necessary ? The only really
> valuable
> change in this patch is the introduction of has_update_interval. Please
> keep that
> and drop the rest.
>
> Thanks,
> Guenter
I agree _this one_ hunk could be dropped. For the rest:
Reviewed-by: Bence Csókás <bence98@sch.bme.hu>
Bence
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
2026-02-19 13:01 ` [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices Ian Ray
2026-02-19 15:59 ` Guenter Roeck
@ 2026-02-20 1:13 ` kernel test robot
2026-02-20 1:54 ` kernel test robot
2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2026-02-20 1:13 UTC (permalink / raw)
To: Ian Ray, Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: oe-kbuild-all, Ian Ray, Bence Csókás, Tomaž Zaman,
linux-hwmon, linux-doc, linux-kernel, devicetree
Hi Ian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on robh/for-next linus/master v6.19 next-20260219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ian-Ray/dt-bindings-hwmon-ti-ina2xx-Add-INA234-device/20260219-210940
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20260219130127.87901-3-ian.ray%40gehealthcare.com
patch subject: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
config: x86_64-randconfig-014-20260219 (https://download.01.org/0day-ci/archive/20260220/202602200951.bP8YVa4Y-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260220/202602200951.bP8YVa4Y-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602200951.bP8YVa4Y-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/hwmon/ina2xx.c: In function 'ina2xx_is_visible':
>> drivers/hwmon/ina2xx.c:722:25: warning: unused variable 'chip' [-Wunused-variable]
722 | enum ina2xx_ids chip = data->chip;
| ^~~~
vim +/chip +722 drivers/hwmon/ina2xx.c
5a56a39be7ffb4 Alex Qiu 2020-05-04 714
814db9f1b8ec1c Guenter Roeck 2024-07-24 715 static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type,
814db9f1b8ec1c Guenter Roeck 2024-07-24 716 u32 attr, int channel)
814db9f1b8ec1c Guenter Roeck 2024-07-24 717 {
814db9f1b8ec1c Guenter Roeck 2024-07-24 718 const struct ina2xx_data *data = _data;
de0da6ae1908b4 Guenter Roeck 2024-08-27 719 bool has_alerts = data->config->has_alerts;
52172ad87a22ed Wenliang Yan 2024-11-06 720 bool has_power_average = data->config->has_power_average;
0337abb760db03 Ian Ray 2026-02-19 721 bool has_update_interval = data->config->has_update_interval;
814db9f1b8ec1c Guenter Roeck 2024-07-24 @722 enum ina2xx_ids chip = data->chip;
814db9f1b8ec1c Guenter Roeck 2024-07-24 723
814db9f1b8ec1c Guenter Roeck 2024-07-24 724 switch (type) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 725 case hwmon_in:
814db9f1b8ec1c Guenter Roeck 2024-07-24 726 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 727 case hwmon_in_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 728 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 729 case hwmon_in_lcrit:
814db9f1b8ec1c Guenter Roeck 2024-07-24 730 case hwmon_in_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 731 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 732 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 733 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 734 case hwmon_in_lcrit_alarm:
814db9f1b8ec1c Guenter Roeck 2024-07-24 735 case hwmon_in_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 736 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 737 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 738 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 739 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 740 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 741 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 742 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 743 case hwmon_curr:
814db9f1b8ec1c Guenter Roeck 2024-07-24 744 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 745 case hwmon_curr_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 746 return 0444;
4d5c2d986757e4 Guenter Roeck 2024-08-28 747 case hwmon_curr_lcrit:
4d5c2d986757e4 Guenter Roeck 2024-08-28 748 case hwmon_curr_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 749 if (has_alerts)
4d5c2d986757e4 Guenter Roeck 2024-08-28 750 return 0644;
4d5c2d986757e4 Guenter Roeck 2024-08-28 751 break;
4d5c2d986757e4 Guenter Roeck 2024-08-28 752 case hwmon_curr_lcrit_alarm:
4d5c2d986757e4 Guenter Roeck 2024-08-28 753 case hwmon_curr_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 754 if (has_alerts)
4d5c2d986757e4 Guenter Roeck 2024-08-28 755 return 0444;
4d5c2d986757e4 Guenter Roeck 2024-08-28 756 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 757 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 758 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 759 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 760 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 761 case hwmon_power:
814db9f1b8ec1c Guenter Roeck 2024-07-24 762 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 763 case hwmon_power_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 764 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 765 case hwmon_power_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 766 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 767 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 768 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 769 case hwmon_power_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 770 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 771 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 772 break;
52172ad87a22ed Wenliang Yan 2024-11-06 773 case hwmon_power_average:
52172ad87a22ed Wenliang Yan 2024-11-06 774 if (has_power_average)
52172ad87a22ed Wenliang Yan 2024-11-06 775 return 0444;
52172ad87a22ed Wenliang Yan 2024-11-06 776 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 777 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 778 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 779 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 780 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 781 case hwmon_chip:
814db9f1b8ec1c Guenter Roeck 2024-07-24 782 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 783 case hwmon_chip_update_interval:
0337abb760db03 Ian Ray 2026-02-19 784 if (has_update_interval)
814db9f1b8ec1c Guenter Roeck 2024-07-24 785 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 786 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 787 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 788 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 789 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 790 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 791 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 792 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 793 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 794 return 0;
814db9f1b8ec1c Guenter Roeck 2024-07-24 795 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 796
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
2026-02-19 13:01 ` [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices Ian Ray
2026-02-19 15:59 ` Guenter Roeck
2026-02-20 1:13 ` kernel test robot
@ 2026-02-20 1:54 ` kernel test robot
2 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2026-02-20 1:54 UTC (permalink / raw)
To: Ian Ray, Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: oe-kbuild-all, Ian Ray, Bence Csókás, Tomaž Zaman,
linux-hwmon, linux-doc, linux-kernel, devicetree
Hi Ian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on robh/for-next linus/master v6.19 next-20260219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ian-Ray/dt-bindings-hwmon-ti-ina2xx-Add-INA234-device/20260219-210940
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20260219130127.87901-3-ian.ray%40gehealthcare.com
patch subject: [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260220/202602200201.hafkm9wo-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260220/202602200201.hafkm9wo-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602200201.hafkm9wo-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/hwmon/ina2xx.c: In function 'ina2xx_is_visible':
>> drivers/hwmon/ina2xx.c:722:25: warning: unused variable 'chip' [-Wunused-variable]
722 | enum ina2xx_ids chip = data->chip;
| ^~~~
vim +/chip +722 drivers/hwmon/ina2xx.c
5a56a39be7ffb4 Alex Qiu 2020-05-04 714
814db9f1b8ec1c Guenter Roeck 2024-07-24 715 static umode_t ina2xx_is_visible(const void *_data, enum hwmon_sensor_types type,
814db9f1b8ec1c Guenter Roeck 2024-07-24 716 u32 attr, int channel)
814db9f1b8ec1c Guenter Roeck 2024-07-24 717 {
814db9f1b8ec1c Guenter Roeck 2024-07-24 718 const struct ina2xx_data *data = _data;
de0da6ae1908b4 Guenter Roeck 2024-08-27 719 bool has_alerts = data->config->has_alerts;
52172ad87a22ed Wenliang Yan 2024-11-06 720 bool has_power_average = data->config->has_power_average;
0337abb760db03 Ian Ray 2026-02-19 721 bool has_update_interval = data->config->has_update_interval;
814db9f1b8ec1c Guenter Roeck 2024-07-24 @722 enum ina2xx_ids chip = data->chip;
814db9f1b8ec1c Guenter Roeck 2024-07-24 723
814db9f1b8ec1c Guenter Roeck 2024-07-24 724 switch (type) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 725 case hwmon_in:
814db9f1b8ec1c Guenter Roeck 2024-07-24 726 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 727 case hwmon_in_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 728 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 729 case hwmon_in_lcrit:
814db9f1b8ec1c Guenter Roeck 2024-07-24 730 case hwmon_in_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 731 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 732 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 733 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 734 case hwmon_in_lcrit_alarm:
814db9f1b8ec1c Guenter Roeck 2024-07-24 735 case hwmon_in_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 736 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 737 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 738 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 739 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 740 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 741 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 742 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 743 case hwmon_curr:
814db9f1b8ec1c Guenter Roeck 2024-07-24 744 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 745 case hwmon_curr_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 746 return 0444;
4d5c2d986757e4 Guenter Roeck 2024-08-28 747 case hwmon_curr_lcrit:
4d5c2d986757e4 Guenter Roeck 2024-08-28 748 case hwmon_curr_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 749 if (has_alerts)
4d5c2d986757e4 Guenter Roeck 2024-08-28 750 return 0644;
4d5c2d986757e4 Guenter Roeck 2024-08-28 751 break;
4d5c2d986757e4 Guenter Roeck 2024-08-28 752 case hwmon_curr_lcrit_alarm:
4d5c2d986757e4 Guenter Roeck 2024-08-28 753 case hwmon_curr_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 754 if (has_alerts)
4d5c2d986757e4 Guenter Roeck 2024-08-28 755 return 0444;
4d5c2d986757e4 Guenter Roeck 2024-08-28 756 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 757 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 758 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 759 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 760 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 761 case hwmon_power:
814db9f1b8ec1c Guenter Roeck 2024-07-24 762 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 763 case hwmon_power_input:
814db9f1b8ec1c Guenter Roeck 2024-07-24 764 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 765 case hwmon_power_crit:
de0da6ae1908b4 Guenter Roeck 2024-08-27 766 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 767 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 768 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 769 case hwmon_power_crit_alarm:
de0da6ae1908b4 Guenter Roeck 2024-08-27 770 if (has_alerts)
814db9f1b8ec1c Guenter Roeck 2024-07-24 771 return 0444;
814db9f1b8ec1c Guenter Roeck 2024-07-24 772 break;
52172ad87a22ed Wenliang Yan 2024-11-06 773 case hwmon_power_average:
52172ad87a22ed Wenliang Yan 2024-11-06 774 if (has_power_average)
52172ad87a22ed Wenliang Yan 2024-11-06 775 return 0444;
52172ad87a22ed Wenliang Yan 2024-11-06 776 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 777 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 778 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 779 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 780 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 781 case hwmon_chip:
814db9f1b8ec1c Guenter Roeck 2024-07-24 782 switch (attr) {
814db9f1b8ec1c Guenter Roeck 2024-07-24 783 case hwmon_chip_update_interval:
0337abb760db03 Ian Ray 2026-02-19 784 if (has_update_interval)
814db9f1b8ec1c Guenter Roeck 2024-07-24 785 return 0644;
814db9f1b8ec1c Guenter Roeck 2024-07-24 786 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 787 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 788 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 789 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 790 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 791 default:
814db9f1b8ec1c Guenter Roeck 2024-07-24 792 break;
814db9f1b8ec1c Guenter Roeck 2024-07-24 793 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 794 return 0;
814db9f1b8ec1c Guenter Roeck 2024-07-24 795 }
814db9f1b8ec1c Guenter Roeck 2024-07-24 796
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH V2 3/3] hwmon: (ina2xx) Add support for INA234
2026-02-19 13:01 [PATCH V2 0/3] hwmon: INA234 Ian Ray
2026-02-19 13:01 ` [PATCH V2 1/3] dt-bindings: hwmon: ti,ina2xx: Add INA234 device Ian Ray
2026-02-19 13:01 ` [PATCH V2 2/3] hwmon: (ina2xx) Make it easier to add more devices Ian Ray
@ 2026-02-19 13:01 ` Ian Ray
2026-02-19 20:45 ` Bence Csókás
2026-02-21 7:02 ` [PATCH V2 0/3] hwmon: INA234 Jens Almer
3 siblings, 1 reply; 10+ messages in thread
From: Ian Ray @ 2026-02-19 13:01 UTC (permalink / raw)
To: Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Ian Ray, Bence Csókás, Tomaž Zaman, linux-hwmon,
linux-doc, linux-kernel, Krzysztof Kozlowski, devicetree
INA234 is register compatible to INA226 (excepting manufacturer and die
or device id registers) but has different scaling.
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
---
Documentation/hwmon/ina2xx.rst | 13 ++++++++++++-
drivers/hwmon/Kconfig | 2 +-
drivers/hwmon/ina2xx.c | 18 ++++++++++++++++++
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/ina2xx.rst b/Documentation/hwmon/ina2xx.rst
index a4ddf4bd2b08..d64e7af46a12 100644
--- a/Documentation/hwmon/ina2xx.rst
+++ b/Documentation/hwmon/ina2xx.rst
@@ -74,6 +74,16 @@ Supported chips:
https://us1.silergy.com/
+ * Texas Instruments INA234
+
+ Prefix: 'ina234'
+
+ Addresses: I2C 0x40 - 0x43
+
+ Datasheet: Publicly available at the Texas Instruments website
+
+ https://www.ti.com/
+
Author: Lothar Felten <lothar.felten@gmail.com>
Description
@@ -89,7 +99,7 @@ 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 and INA231 are high or low side current shunt and power monitors
+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
bus supply voltage.
@@ -132,6 +142,7 @@ Additional entries are available for the following chips:
* ina226
* ina230
* ina231
+ * ina234
* ina260
* sy24655
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 41c381764c2b..6aa8a89f4747 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -2284,7 +2284,7 @@ config SENSORS_INA2XX
select REGMAP_I2C
help
If you say yes here you get support for INA219, INA220, INA226,
- INA230, INA231, INA260, and SY24655 power monitor chips.
+ INA230, INA231, INA234, INA260, and SY24655 power monitor chips.
The INA2xx driver is configured for the default configuration of
the part as described in the datasheet.
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index 4bf609e25f8a..d6032183b055 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -140,6 +140,7 @@ static const struct regmap_config ina2xx_regmap_config = {
enum ina2xx_ids {
ina219,
ina226,
+ ina234,
ina260,
sy24655
};
@@ -193,6 +194,18 @@ static const struct ina2xx_config ina2xx_config[] = {
.has_power_average = false,
.has_update_interval = true,
},
+ [ina234] = {
+ .config_default = INA226_CONFIG_DEFAULT,
+ .calibration_value = 2048,
+ .shunt_div = 400, /* 2.5 µV/LSB raw ADC reading from INA2XX_SHUNT_VOLTAGE */
+ .bus_voltage_shift = 4,
+ .bus_voltage_lsb = 25600,
+ .power_lsb_factor = 32,
+ .has_alerts = true,
+ .has_ishunt = false,
+ .has_power_average = false,
+ .has_update_interval = true,
+ },
[ina260] = {
.config_default = INA260_CONFIG_DEFAULT,
.shunt_div = 400,
@@ -995,6 +1008,7 @@ static const struct i2c_device_id ina2xx_id[] = {
{ "ina226", ina226 },
{ "ina230", ina226 },
{ "ina231", ina226 },
+ { "ina234", ina234 },
{ "ina260", ina260 },
{ "sy24655", sy24655 },
{ }
@@ -1026,6 +1040,10 @@ static const struct of_device_id __maybe_unused ina2xx_of_match[] = {
.compatible = "ti,ina231",
.data = (void *)ina226
},
+ {
+ .compatible = "ti,ina234",
+ .data = (void *)ina234
+ },
{
.compatible = "ti,ina260",
.data = (void *)ina260
--
2.49.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH V2 3/3] hwmon: (ina2xx) Add support for INA234
2026-02-19 13:01 ` [PATCH V2 3/3] hwmon: (ina2xx) Add support for INA234 Ian Ray
@ 2026-02-19 20:45 ` Bence Csókás
0 siblings, 0 replies; 10+ messages in thread
From: Bence Csókás @ 2026-02-19 20:45 UTC (permalink / raw)
To: Ian Ray, Guenter Roeck, Jonathan Corbet, Shuah Khan, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Tomaž Zaman, linux-hwmon, linux-doc, linux-kernel,
Krzysztof Kozlowski, devicetree
Hi,
On 2/19/26 14:01, Ian Ray wrote:
> INA234 is register compatible to INA226 (excepting manufacturer and die
> or device id registers) but has different scaling.
>
> Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
I can indeed find `power_lsb_factor = 32` in an earlier datasheet, dated
2021... Perhaps the TI folks also got confused about the whole "shift
down the lower 4 bits" thing... Well, with the caveat that I don't have
the part, so I can't test it myself:
Reviewed-by: Bence Csókás <bence98@sch.bme.hu>
Bence
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH V2 0/3] hwmon: INA234
2026-02-19 13:01 [PATCH V2 0/3] hwmon: INA234 Ian Ray
` (2 preceding siblings ...)
2026-02-19 13:01 ` [PATCH V2 3/3] hwmon: (ina2xx) Add support for INA234 Ian Ray
@ 2026-02-21 7:02 ` Jens Almer
3 siblings, 0 replies; 10+ messages in thread
From: Jens Almer @ 2026-02-21 7:02 UTC (permalink / raw)
To: ian.ray
Cc: bence98, conor+dt, corbet, devicetree, krzk+dt, krzk, linux-doc,
linux-hwmon, linux-kernel, linux, robh, skhan, tomaz, Jens Almer
Tested on a Mono Gateway Development Kit. All sensors reported and the values were in line with a patch created by Tomaz Zaman against the NXP 6.12 fork.
Tested-by: Jens Almer <bagawk@gmail.com>
^ permalink raw reply [flat|nested] 10+ messages in thread