Skip to contentSkip to conversation

Battery fixes

PATCH Applied Alan Cox 2 participants 4 messages Aug 10, 2010

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

cover 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(-)
Signature · 2 lines
	"CMS is like a porcupine in a balloon factory"
					--Alan Altmark
author
#1 lore raw

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.

---

 drivers/power/intel_mid_battery.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/power/intel_mid_battery.c +1 -1
index 46730f5..6430a7b 100644
@@ -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);
 }
 
author
#2 lore raw

PATCH 2/2 intel mid battery: Fix battery scaling

In reply to Alan Cox

There are 3600 seconds per not 3600 hours per second. Correcting this along with the previous fix gives sensible numbers.

---

 drivers/power/intel_mid_battery.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/power/intel_mid_battery.c +1 -1
index 6430a7b..c61ffec 100644
@@ -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;
 }
 
 /**
#3 lore raw
In reply to Alan Cox
Quoted 5 lines · Alan Cox

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!