diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2025-09-03 16:08:03 -0700 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2025-09-07 16:34:39 -0700 |
| commit | b7bce92f2890f6002bd3155c0510bd28b6ead4e1 (patch) | |
| tree | cee58bb8076176fd50e86de7f6ff559b41b12f71 | |
| parent | bcac89eebefbcf886c2b971de4bf026073e0ee8e (diff) | |
| download | linux-stable-b7bce92f2890f6002bd3155c0510bd28b6ead4e1.tar.gz linux-stable-b7bce92f2890f6002bd3155c0510bd28b6ead4e1.zip | |
hwmon: (ina238) Stop using the shunt voltage register
Since the value of the current register and the value of the shunt register
now match each other, it is no longer necessary to read the shunt voltage
register in the first place. Read the current register instead and use it
to calculate the shunt voltage.
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| -rw-r--r-- | drivers/hwmon/ina238.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c index c04481a8c643..9dc94eccb750 100644 --- a/drivers/hwmon/ina238.c +++ b/drivers/hwmon/ina238.c @@ -218,7 +218,7 @@ static int ina238_read_field_s20(const struct i2c_client *client, u8 reg, s32 *v static int ina228_read_voltage(struct ina238_data *data, int channel, long *val) { - int reg = channel ? INA238_BUS_VOLTAGE : INA238_SHUNT_VOLTAGE; + int reg = channel ? INA238_BUS_VOLTAGE : INA238_CURRENT; u32 lsb = data->voltage_lsb[channel]; u32 factor = NUNIT_PER_MUNIT; int err, regval; |
