Alan Cox (1):
intel mid battery: Fix battery scaling
Arjan van de Ven (1):
Fix the argument order to intel_scu_ipc_command in the battery driver
drivers/power/intel_mid_battery.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--
"CMS is like a porcupine in a balloon factory"
--Alan Altmark
From: Arjan van de Ven <[email protected]>
The arguments to intel_scu_ipc_command are "command, subcommand"
the battery driver got this the wrong way around.
Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
---
drivers/power/intel_mid_battery.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c
index 46730f5..6430a7b 100644
--- a/drivers/power/intel_mid_battery.c
+++ b/drivers/power/intel_mid_battery.c
@@ -168,7 +168,7 @@ struct battery_property {
*/
static int pmic_scu_ipc_battery_cc_read(u32 *value)
{
- return intel_scu_ipc_command(IPC_CMD_CC_RD, IPCMSG_BATTERY,
+ return intel_scu_ipc_command(IPCMSG_BATTERY, IPC_CMD_CC_RD,
NULL, 0, value, 1);
}
There are 3600 seconds per not 3600 hours per second. Correcting this
along with the previous fix gives sensible numbers.
Signed-off-by: Alan Cox <[email protected]>
---
drivers/power/intel_mid_battery.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/power/intel_mid_battery.c b/drivers/power/intel_mid_battery.c
index 6430a7b..c61ffec 100644
--- a/drivers/power/intel_mid_battery.c
+++ b/drivers/power/intel_mid_battery.c
@@ -427,7 +427,7 @@ static int pmic_usb_get_property(struct power_supply *psy,
static inline unsigned long mAStouAh(unsigned long v)
{
/* seconds to hours, mA to µA */
- return v * 3600 * 1000;
+ return (v * 1000) / 3600;
}
/**
On Tue, Aug 10, 2010 at 10:27:43AM +0100, Alan Cox wrote:
> Alan Cox (1):
> intel mid battery: Fix battery scaling
>
> Arjan van de Ven (1):
> Fix the argument order to intel_scu_ipc_command in the battery driver
Applied, thanks!