Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+1 -1
+1 -1
drivers/hwmon/ina238.c
··· 218 218 219 219 static int ina228_read_voltage(struct ina238_data *data, int channel, long *val) 220 220 { 221 - int reg = channel ? INA238_BUS_VOLTAGE : INA238_SHUNT_VOLTAGE; 221 + int reg = channel ? INA238_BUS_VOLTAGE : INA238_CURRENT; 222 222 u32 lsb = data->voltage_lsb[channel]; 223 223 u32 factor = NUNIT_PER_MUNIT; 224 224 int err, regval;