cleanup spitz battery charging code
Subsystems (3)
PATCH 1/1 cleanup spitz battery charging code
Hi!
This cleans up sharpsl charging code a bit, without really changing anything. It will probably break compilation on corgi, but few "()"s should fix that, and those macros are *really* evil.
Please apply... rmk said he prefers sharp patches to go through you. I hope it is okay with you.
---
commit c2c4df2e9a028895eccc644b45272cba5d40d1a6 tree 9d9d3e51dd34dc72520de5f776a51d0b4dd4ae70 parent 5ca0c6d2dc47d84f33410487ab21878e3fe515f6 author <pavel@amd.(none)> Sun, 06 Nov 2005 22:29:23 +0100 committer <pavel@amd.(none)> Sun, 06 Nov 2005 22:29:23 +0100
arch/arm/mach-pxa/sharpsl.h | 8 +++--- arch/arm/mach-pxa/sharpsl_pm.c | 54 ++++++++++++++++++++-------------------- arch/arm/mach-pxa/spitz_pm.c | 6 ++-- 3 files changed, 34 insertions(+), 34 deletions(-)
arch/arm/mach-pxa/sharpsl.h +4 -4
@@ -115,7 +115,7 @@ extern struct battery_thresh spitz_batte#define CHARGE_LED_ERR () sharpsl_pm.machinfo->chargeled(SHARPSL_LED_ERROR)#define DISCHARGE_ON () sharpsl_pm.machinfo->discharge(1)#define DISCHARGE_OFF () sharpsl_pm.machinfo->discharge(0) -#define STATUS_AC_IN sharpsl_pm.machinfo->status_acin() -#define STATUS_BATT_LOCKED READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock) -#define STATUS_CHRG_FULL READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull) -#define STATUS_FATAL READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal) +#define STATUS_AC_IN () sharpsl_pm.machinfo->status_acin() +#define STATUS_BATT_LOCKED () READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batlock) +#define STATUS_CHRG_FULL () READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_batfull) +#define STATUS_FATAL () READ_GPIO_BIT(sharpsl_pm.machinfo->gpio_fatal)
arch/arm/mach-pxa/sharpsl_pm.c +27 -27
196 lines not on this page · raw message
arch/arm/mach-pxa/spitz_pm.c +3 -3
@@ -81,7 +81,7 @@ static void spitz_discharge1(int on)static void spitz_presuspend (void ) { - spitz_last_ac_status =STATUS_AC_IN ; + spitz_last_ac_status =STATUS_AC_IN ();/* GPIO Sleep Register */ PGSR0 =0x00144018 ;
@@ -130,8 +130,8 @@ static int spitz_should_wakeup(unsigned {int is_resume =0 ; -if (spitz_last_ac_status !=STATUS_AC_IN ) { -if (STATUS_AC_IN ) { +if (spitz_last_ac_status !=STATUS_AC_IN ()) { +if (STATUS_AC_IN ()) {/* charge on */ sharpsl_pm.flags |=SHARPSL_DO_OFFLINE_CHRG ;dev_dbg (sharpsl_pm.dev,"AC Inserted\n" );
Signature · 1 line
Thanks, Sharp!
Quoted 8 lines · Pavel Machek
This cleans up sharpsl charging code a bit, without really changing anything. It will probably break compilation on corgi, but few "()"s should fix that, and those macros are *really* evil.
Please apply... rmk said he prefers sharp patches to go through you. I hope it is okay with you.
Signed-off-by Pavel Machek <[email protected]>
Thanks for this, its fine with me. I've been making changes like this to bring the driver up to standard for a long time and after a while you begin to loose site of what else needs doing.
The patch is queued in Russell's patch system. This can be applied once its fate has been determined.
Richard