2010-08-10 10:05:04

by Alan

[permalink] [raw]
Subject: [PATCH 0/2] Battery fixes

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


2010-08-10 10:05:27

by Alan

[permalink] [raw]
Subject: [PATCH 1/2] Fix the argument order to intel_scu_ipc_command in the battery driver

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);
}

2010-08-10 10:05:32

by Alan

[permalink] [raw]
Subject: [PATCH 2/2] intel mid battery: Fix battery scaling

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;
}

/**

2010-08-10 10:37:57

by Anton Vorontsov

[permalink] [raw]
Subject: Re: [PATCH 0/2] Battery fixes

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!