]> Pileus Git - ~andy/linux/commitdiff
power: rx51_battery: Fix reporting correct values
authorPali Rohár <pali.rohar@gmail.com>
Fri, 15 Feb 2013 22:56:50 +0000 (23:56 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Apr 2013 14:36:27 +0000 (16:36 +0200)
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 <pali.rohar@gmail.com>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/power/rx51_battery.c

index 8208888b844e973004ba2a146cb40bf70c1458b5..35f625e18ba6ec01eae77841746ee8d63b87573f 100644 (file)
@@ -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;