Commit 8cb52f78 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Russell King

[ARM] 5430/1: collie_pm: use new GPIO API to control charger

Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 224be092
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <mach/hardware.h> #include <mach/hardware.h>
...@@ -58,6 +59,9 @@ static void collie_charger_init(void) ...@@ -58,6 +59,9 @@ static void collie_charger_init(void)
return; return;
} }
gpio_request(COLLIE_GPIO_CHARGE_ON, "charge on");
gpio_direction_output(COLLIE_GPIO_CHARGE_ON, 1);
ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON | ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON |
COLLIE_TC35143_GPIO_BBAT_ON); COLLIE_TC35143_GPIO_BBAT_ON);
return; return;
...@@ -73,17 +77,11 @@ static void collie_measure_temp(int on) ...@@ -73,17 +77,11 @@ static void collie_measure_temp(int on)
static void collie_charge(int on) static void collie_charge(int on)
{ {
extern struct platform_device colliescoop_device;
/* Zaurus seems to contain LTC1731; it should know when to /* Zaurus seems to contain LTC1731; it should know when to
* stop charging itself, so setting charge on should be * stop charging itself, so setting charge on should be
* relatively harmless (as long as it is not done too often). * relatively harmless (as long as it is not done too often).
*/ */
if (on) { gpio_set_value(COLLIE_GPIO_CHARGE_ON, on);
set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
} else {
reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
}
} }
static void collie_discharge(int on) static void collie_discharge(int on)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1)
#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0)
#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
#define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13
#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14 #define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
...@@ -25,11 +25,10 @@ ...@@ -25,11 +25,10 @@
#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
COLLIE_SCP_LB_VOL_CHG ) COLLIE_SCP_LB_VOL_CHG )
#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R )
COLLIE_SCP_CHARGE_ON )
/* GPIOs for which the generic definition doesn't say much */ /* GPIOs for which the generic definition doesn't say much */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment