* [PATCH v2 0/2] hwmon: add ti,ina237 support to ina238 driver
@ 2023-10-26 7:08 Richard Leitner
2023-10-26 7:08 ` [PATCH v2 1/2] hwmon: ina238: add ina237 support Richard Leitner
2023-10-26 7:08 ` [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Richard Leitner
0 siblings, 2 replies; 6+ messages in thread
From: Richard Leitner @ 2023-10-26 7:08 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-kernel, linux-hwmon, devicetree, Richard Leitner
This series adds support for the ina237 power monitor to the ina238
driver as those two are very similar.
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
---
Changes in v2:
- Drop separate MAINTAINERS entry as it's covered by hwmon
- Drop separate dt-bindings for ina23{7,8} as discussed with Krzysztof
- Link to v1: https://lore.kernel.org/r/20231025-ina237-v1-0-a0196119720c@linux.dev
---
Richard Leitner (2):
hwmon: ina238: add ina237 support
dt-bindings: hwmon: ti,ina2xx: add ti,ina237
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
drivers/hwmon/ina238.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
---
base-commit: 4f82870119a46b0d04d91ef4697ac4977a255a9d
change-id: 20231025-ina237-0f1a9c14fd5d
Best regards,
--
Richard Leitner <richard.leitner@linux.dev>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] hwmon: ina238: add ina237 support
2023-10-26 7:08 [PATCH v2 0/2] hwmon: add ti,ina237 support to ina238 driver Richard Leitner
@ 2023-10-26 7:08 ` Richard Leitner
2023-10-26 14:48 ` Guenter Roeck
2023-10-26 7:08 ` [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Richard Leitner
1 sibling, 1 reply; 6+ messages in thread
From: Richard Leitner @ 2023-10-26 7:08 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-kernel, linux-hwmon, devicetree, Richard Leitner
The INA237 "85-V, 16-Bit, Precision Power Monitor With I2C Interface" is
basically the same as INA328. Therefore add a corresponding compatible
to the driver.
According to the datasheet the main difference is the current and power
monitoring accuracy:
+------------------------+---------------+---------------+
| | INA238 | INA237 |
+------------------------+---------------+---------------+
| Offset voltage | +/- 5µV | +/- 50µV |
| Offset drift | +/- 0.02µV/°C | +/- 0.02µV/°C |
| Gain error | +/- 0.1% | +/- 0.3% |
| Gain error drift | +/- 25ppm/°C | +/- 50ppm/°C |
| Common mode rejection | 140dB | 120dB |
| Power accuracy | 0.7% | 1.6% |
+------------------------+---------------+---------------+
As well as the missing DEVICE_ID register at 0x3F, which is currently
not in use by the driver.
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
---
drivers/hwmon/ina238.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c
index f519c22d3907..ca9f5d2c811b 100644
--- a/drivers/hwmon/ina238.c
+++ b/drivers/hwmon/ina238.c
@@ -33,7 +33,7 @@
#define INA238_BUS_UNDER_VOLTAGE 0xf
#define INA238_TEMP_LIMIT 0x10
#define INA238_POWER_LIMIT 0x11
-#define INA238_DEVICE_ID 0x3f
+#define INA238_DEVICE_ID 0x3f /* not available on INA237 */
#define INA238_CONFIG_ADCRANGE BIT(4)
@@ -622,6 +622,7 @@ static const struct i2c_device_id ina238_id[] = {
MODULE_DEVICE_TABLE(i2c, ina238_id);
static const struct of_device_id __maybe_unused ina238_of_match[] = {
+ { .compatible = "ti,ina237" },
{ .compatible = "ti,ina238" },
{ },
};
--
2.40.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237
2023-10-26 7:08 [PATCH v2 0/2] hwmon: add ti,ina237 support to ina238 driver Richard Leitner
2023-10-26 7:08 ` [PATCH v2 1/2] hwmon: ina238: add ina237 support Richard Leitner
@ 2023-10-26 7:08 ` Richard Leitner
2023-10-26 14:29 ` Conor Dooley
2023-10-26 14:47 ` Guenter Roeck
1 sibling, 2 replies; 6+ messages in thread
From: Richard Leitner @ 2023-10-26 7:08 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-kernel, linux-hwmon, devicetree, Richard Leitner
Add ti,ina237 binding to ti,ina2xx as they are very similar and may
share the same properties.
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
---
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 8648877d2d01..378d1f6aeeb3 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -26,6 +26,7 @@ properties:
- ti,ina226
- ti,ina230
- ti,ina231
+ - ti,ina237
- ti,ina238
reg:
--
2.40.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237
2023-10-26 7:08 ` [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Richard Leitner
@ 2023-10-26 14:29 ` Conor Dooley
2023-10-26 14:47 ` Guenter Roeck
1 sibling, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2023-10-26 14:29 UTC (permalink / raw)
To: Richard Leitner
Cc: Guenter Roeck, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-kernel, linux-hwmon, devicetree
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
On Thu, Oct 26, 2023 at 09:08:50AM +0200, Richard Leitner wrote:
> Add ti,ina237 binding to ti,ina2xx as they are very similar and may
> share the same properties.
>
> Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> ---
> Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> index 8648877d2d01..378d1f6aeeb3 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> @@ -26,6 +26,7 @@ properties:
> - ti,ina226
> - ti,ina230
> - ti,ina231
> + - ti,ina237
> - ti,ina238
>
> reg:
>
> --
> 2.40.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237
2023-10-26 7:08 ` [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Richard Leitner
2023-10-26 14:29 ` Conor Dooley
@ 2023-10-26 14:47 ` Guenter Roeck
1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-10-26 14:47 UTC (permalink / raw)
To: Richard Leitner
Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-kernel, linux-hwmon, devicetree
On Thu, Oct 26, 2023 at 09:08:50AM +0200, Richard Leitner wrote:
> Add ti,ina237 binding to ti,ina2xx as they are very similar and may
> share the same properties.
>
> Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] hwmon: ina238: add ina237 support
2023-10-26 7:08 ` [PATCH v2 1/2] hwmon: ina238: add ina237 support Richard Leitner
@ 2023-10-26 14:48 ` Guenter Roeck
0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-10-26 14:48 UTC (permalink / raw)
To: Richard Leitner
Cc: Jean Delvare, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-kernel, linux-hwmon, devicetree
On Thu, Oct 26, 2023 at 09:08:49AM +0200, Richard Leitner wrote:
> The INA237 "85-V, 16-Bit, Precision Power Monitor With I2C Interface" is
> basically the same as INA328. Therefore add a corresponding compatible
> to the driver.
>
> According to the datasheet the main difference is the current and power
> monitoring accuracy:
>
> +------------------------+---------------+---------------+
> | | INA238 | INA237 |
> +------------------------+---------------+---------------+
> | Offset voltage | +/- 5µV | +/- 50µV |
> | Offset drift | +/- 0.02µV/°C | +/- 0.02µV/°C |
> | Gain error | +/- 0.1% | +/- 0.3% |
> | Gain error drift | +/- 25ppm/°C | +/- 50ppm/°C |
> | Common mode rejection | 140dB | 120dB |
> | Power accuracy | 0.7% | 1.6% |
> +------------------------+---------------+---------------+
>
> As well as the missing DEVICE_ID register at 0x3F, which is currently
> not in use by the driver.
>
> Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/ina238.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c
> index f519c22d3907..ca9f5d2c811b 100644
> --- a/drivers/hwmon/ina238.c
> +++ b/drivers/hwmon/ina238.c
> @@ -33,7 +33,7 @@
> #define INA238_BUS_UNDER_VOLTAGE 0xf
> #define INA238_TEMP_LIMIT 0x10
> #define INA238_POWER_LIMIT 0x11
> -#define INA238_DEVICE_ID 0x3f
> +#define INA238_DEVICE_ID 0x3f /* not available on INA237 */
>
> #define INA238_CONFIG_ADCRANGE BIT(4)
>
> @@ -622,6 +622,7 @@ static const struct i2c_device_id ina238_id[] = {
> MODULE_DEVICE_TABLE(i2c, ina238_id);
>
> static const struct of_device_id __maybe_unused ina238_of_match[] = {
> + { .compatible = "ti,ina237" },
> { .compatible = "ti,ina238" },
> { },
> };
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-26 14:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-26 7:08 [PATCH v2 0/2] hwmon: add ti,ina237 support to ina238 driver Richard Leitner
2023-10-26 7:08 ` [PATCH v2 1/2] hwmon: ina238: add ina237 support Richard Leitner
2023-10-26 14:48 ` Guenter Roeck
2023-10-26 7:08 ` [PATCH v2 2/2] dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Richard Leitner
2023-10-26 14:29 ` Conor Dooley
2023-10-26 14:47 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).