Skip to content

Commit 2358151

Browse files
g0hl1ngroeck
authored andcommitted
hwmon: (ina238) add ina237 support
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent b1f05cb commit 2358151

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/hwmon/ina238.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define INA238_BUS_UNDER_VOLTAGE 0xf
3434
#define INA238_TEMP_LIMIT 0x10
3535
#define INA238_POWER_LIMIT 0x11
36-
#define INA238_DEVICE_ID 0x3f
36+
#define INA238_DEVICE_ID 0x3f /* not available on INA237 */
3737

3838
#define INA238_CONFIG_ADCRANGE BIT(4)
3939

@@ -622,6 +622,7 @@ static const struct i2c_device_id ina238_id[] = {
622622
MODULE_DEVICE_TABLE(i2c, ina238_id);
623623

624624
static const struct of_device_id __maybe_unused ina238_of_match[] = {
625+
{ .compatible = "ti,ina237" },
625626
{ .compatible = "ti,ina238" },
626627
{ },
627628
};

0 commit comments

Comments
 (0)