mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
power: supply: max17040: Correct voltage reading
[ Upstream commit 0383024f81 ]
According to the datasheet available at (1), the bottom four
bits are always zero and the actual voltage is 1.25x this value
in mV. Since the kernel API specifies that voltages should be in
uV, it should report 1250x the shifted value.
1) https://datasheets.maximintegrated.com/en/ds/MAX17040-MAX17041.pdf
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
318af72412
commit
da95fdc3c7
@@ -109,7 +109,7 @@ static void max17040_get_vcell(struct i2c_client *client)
|
||||
|
||||
vcell = max17040_read_reg(client, MAX17040_VCELL);
|
||||
|
||||
chip->vcell = vcell;
|
||||
chip->vcell = (vcell >> 4) * 1250;
|
||||
}
|
||||
|
||||
static void max17040_get_soc(struct i2c_client *client)
|
||||
|
||||
Reference in New Issue
Block a user