aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2009-08-27 12:19:12 +0400
committerPaul Fertser <fercerpav@gmail.com>2009-09-02 00:50:41 +0400
commita3587e4ed77974adfb057af261aaeea4022018e8 (patch)
tree32d5a065d99b02e56f25cb27e7e612585031eaaa
parent65329e6e3de2b2fd07e524a3c10958f2acb7bcb0 (diff)
gta01: when charging the current reported should be negative
Reported-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Paul Fertser <fercerpav@gmail.com>
-rw-r--r--arch/arm/mach-s3c2410/mach-gta01.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
index 1021ff5f2d5..8a13a4adcfd 100644
--- a/arch/arm/mach-s3c2410/mach-gta01.c
+++ b/arch/arm/mach-s3c2410/mach-gta01.c
@@ -248,7 +248,7 @@ static int gta01_bat_get_current(void)
adc_battvolt = pcf50606_adc_sync_read(pcf, PCF50606_ADCMUX_BATVOLT_SUBTR);
adc_adcin1 = pcf50606_adc_sync_read(pcf, PCF50606_ADCMUX_ADCIN1_SUBTR);
- res = (adc_adcin1 - adc_battvolt) * 2400;
+ res = (adc_battvolt - adc_adcin1) * 2400;
/*rsense is 220 milli */
return (res * 1000) / (220 * 1024) * 1000;