diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2009-03-25 05:14:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-03-25 06:13:56 -0400 |
commit | 224be092d116b663ac426c4615e34ee54bab4a14 (patch) | |
tree | 1c5d71de8685ee4f61fa464a603a7c6bfbb4cb4e /arch/arm/mach-sa1100 | |
parent | cf281a99b6e4f1223c8fdce390db3bf79e773f4c (diff) |
[ARM] 5429/1: collie: start scoop converton to new api
Start converting scoop gpio access to new API instead of old
deprecated one.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100')
-rw-r--r-- | arch/arm/mach-sa1100/collie.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/include/mach/collie.h | 7 |
2 files changed, 26 insertions, 8 deletions
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 2052eb88c961..a911f44aa9fc 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
26 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
27 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
28 | #include <linux/gpio.h> | ||
28 | 29 | ||
29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
30 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
@@ -195,18 +196,34 @@ static struct mtd_partition collie_partitions[] = { | |||
195 | } | 196 | } |
196 | }; | 197 | }; |
197 | 198 | ||
199 | static int collie_flash_init(void) | ||
200 | { | ||
201 | int rc; | ||
202 | rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable"); | ||
203 | if (rc) | ||
204 | return rc; | ||
205 | |||
206 | rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1); | ||
207 | if (rc) | ||
208 | gpio_free(COLLIE_GPIO_VPEN); | ||
209 | |||
210 | return rc; | ||
211 | } | ||
212 | |||
198 | static void collie_set_vpp(int vpp) | 213 | static void collie_set_vpp(int vpp) |
199 | { | 214 | { |
200 | write_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR) | COLLIE_SCP_VPEN); | 215 | gpio_set_value(COLLIE_GPIO_VPEN, vpp); |
201 | if (vpp) | ||
202 | write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) | COLLIE_SCP_VPEN); | ||
203 | else | ||
204 | write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) & ~COLLIE_SCP_VPEN); | ||
205 | } | 216 | } |
206 | 217 | ||
218 | static void collie_flash_exit(void) | ||
219 | { | ||
220 | gpio_free(COLLIE_GPIO_VPEN); | ||
221 | } | ||
207 | static struct flash_platform_data collie_flash_data = { | 222 | static struct flash_platform_data collie_flash_data = { |
208 | .map_name = "cfi_probe", | 223 | .map_name = "cfi_probe", |
224 | .init = collie_flash_init, | ||
209 | .set_vpp = collie_set_vpp, | 225 | .set_vpp = collie_set_vpp, |
226 | .exit = collie_flash_exit, | ||
210 | .parts = collie_partitions, | 227 | .parts = collie_partitions, |
211 | .nr_parts = ARRAY_SIZE(collie_partitions), | 228 | .nr_parts = ARRAY_SIZE(collie_partitions), |
212 | }; | 229 | }; |
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h index 69e962416e3f..9bc53497d355 100644 --- a/arch/arm/mach-sa1100/include/mach/collie.h +++ b/arch/arm/mach-sa1100/include/mach/collie.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #define __ASM_ARCH_COLLIE_H | 14 | #define __ASM_ARCH_COLLIE_H |
15 | 15 | ||
16 | 16 | ||
17 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) | ||
17 | #define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 | 18 | #define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 |
18 | #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 | 19 | #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 |
19 | #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 | 20 | #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 |
@@ -21,13 +22,13 @@ | |||
21 | #define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 | 22 | #define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 |
22 | #define COLLIE_SCP_5VON SCOOP_GPCR_PA16 | 23 | #define COLLIE_SCP_5VON SCOOP_GPCR_PA16 |
23 | #define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 | 24 | #define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 |
24 | #define COLLIE_SCP_VPEN SCOOP_GPCR_PA18 | 25 | #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) |
25 | #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 | 26 | #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 |
26 | 27 | ||
27 | #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_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ |
28 | COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | COLLIE_SCP_VPEN | \ | 29 | COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ |
29 | COLLIE_SCP_LB_VOL_CHG ) | 30 | COLLIE_SCP_LB_VOL_CHG ) |
30 | #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \ | 31 | #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ |
31 | COLLIE_SCP_CHARGE_ON ) | 32 | COLLIE_SCP_CHARGE_ON ) |
32 | 33 | ||
33 | /* GPIOs for which the generic definition doesn't say much */ | 34 | /* GPIOs for which the generic definition doesn't say much */ |