From 8059c1c6be45973ea72342567a6ede5f4f0bf8e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Fri, 15 Feb 2013 23:56:50 +0100 Subject: [PATCH] power: rx51_battery: Fix reporting correct values MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Tell twl4030_madc_conversion that this driver needs raw values. Driver twl4030_madc has some hardcoded values and conversation functions which are incorrect for Nokia RX-51 board. This driver rx51_battery expects raw values which convert itself. This patch fixing values reported by power supply interface. Before this patch driver reported always incorrect values on 3.8 kernel (sometimes design capacity was negative). Signed-off-by: Pali Rohár Acked-by: Anton Vorontsov Signed-off-by: Samuel Ortiz --- drivers/power/rx51_battery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c index 8208888..35f625e 100644 --- a/drivers/power/rx51_battery.c +++ b/drivers/power/rx51_battery.c @@ -42,6 +42,7 @@ static int rx51_battery_read_adc(int channel) req.method = TWL4030_MADC_SW1; req.func_cb = NULL; req.type = TWL4030_MADC_WAIT; + req.raw = true; if (twl4030_madc_conversion(&req) <= 0) return -ENODATA; -- 2.7.4