power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time
authorHans de Goede <hdegoede@redhat.com>
Wed, 14 Dec 2016 16:38:51 +0000 (17:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:23:25 +0000 (09:23 +0100)
commit0010542d3f79ed2c2e3be382f89201c77bcd3bc2
tree65855ee45b7ebd51d672c959de4e5707aa11fe33
parentd9a5790b214527e2a73b602f1ded4f509e3fe04b
power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time

[ Upstream commit 4949fc5e071f8e8d8122e0b16cf6a2ec1ca36258 ]

In order for the MSB -> LSB latching to work correctly we must read the
2 8 bit registers of a 15 bit value in one consecutive read.

This fixes charge_full reporting 3498768 on some reads and 3354624 one
other reads on my tablet (for the 3354624 value the raw LSB is 0x00).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/axp288_fuel_gauge.c