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

[ Upstream commit 248efcf00602f0282587999bcc221a872bd72530 ]

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

This fixes voltage_ocv reporting inconsistent values on my tablet.

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