From: Grazvydas Ignotas <notasas@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Rodolfo Giometti <giometti@linux.it>,
Grazvydas Ignotas <notasas@gmail.com>
Subject: [PATCH 2/2] power_supply: bq27x00: fix voltage and current units
Date: Sat, 27 Feb 2010 17:06:44 +0200 [thread overview]
Message-ID: <1267283204-19181-1-git-send-email-notasas@gmail.com> (raw)
The chip returns voltage and current in mV and mA, but
power supply class uses uV and uA, so add missing conversion.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/power/bq27x00_battery.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index 5d940fa..bece33e 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -125,7 +125,7 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di)
return ret;
}
- return volt;
+ return volt * 1000;
}
/*
@@ -156,11 +156,11 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di)
}
if (flags & BQ27000_FLAG_CHGS) {
dev_dbg(di->dev, "negative current!\n");
- return -curr;
+ curr = -curr;
}
}
- return curr;
+ return curr * 1000;
}
/*
--
1.6.3.3
next reply other threads:[~2010-02-27 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-27 15:06 Grazvydas Ignotas [this message]
2010-02-27 15:12 ` Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267283204-19181-1-git-send-email-notasas@gmail.com \
--to=notasas@gmail.com \
--cc=cbouatmailru@gmail.com \
--cc=dwmw2@infradead.org \
--cc=giometti@linux.it \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®