Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Dmitry Baryshkov and committed by
Russell King
8cb52f78 224be092

+8 -11
+5 -7
arch/arm/mach-sa1100/collie_pm.c
··· 22 22 #include <linux/interrupt.h> 23 23 #include <linux/device.h> 24 24 #include <linux/platform_device.h> 25 + #include <linux/gpio.h> 25 26 26 27 #include <asm/irq.h> 27 28 #include <mach/hardware.h> ··· 59 58 return; 60 59 } 61 60 61 + gpio_request(COLLIE_GPIO_CHARGE_ON, "charge on"); 62 + gpio_direction_output(COLLIE_GPIO_CHARGE_ON, 1); 63 + 62 64 ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON | 63 65 COLLIE_TC35143_GPIO_BBAT_ON); 64 66 return; ··· 77 73 78 74 static void collie_charge(int on) 79 75 { 80 - extern struct platform_device colliescoop_device; 81 - 82 76 /* Zaurus seems to contain LTC1731; it should know when to 83 77 * stop charging itself, so setting charge on should be 84 78 * relatively harmless (as long as it is not done too often). 85 79 */ 86 - if (on) { 87 - set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); 88 - } else { 89 - reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON); 90 - } 80 + gpio_set_value(COLLIE_GPIO_CHARGE_ON, on); 91 81 } 92 82 93 83 static void collie_discharge(int on)
+3 -4
arch/arm/mach-sa1100/include/mach/collie.h
··· 15 15 16 16 17 17 #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) 18 - #define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 18 + #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0) 19 19 #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 20 20 #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 21 21 #define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14 ··· 25 25 #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) 26 26 #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 27 27 28 - #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ 28 + #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ 29 29 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ 30 30 COLLIE_SCP_LB_VOL_CHG ) 31 - #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ 32 - COLLIE_SCP_CHARGE_ON ) 31 + #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R ) 33 32 34 33 /* GPIOs for which the generic definition doesn't say much */ 35 34