diff options
Diffstat (limited to 'arch/arm/mach-sa1100/collie.c')
-rw-r--r-- | arch/arm/mach-sa1100/collie.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 2052eb88c961..bbf2ebcc3066 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> |
@@ -145,7 +146,8 @@ static struct locomo_driver collie_uart_driver = { | |||
145 | .remove = collie_uart_remove, | 146 | .remove = collie_uart_remove, |
146 | }; | 147 | }; |
147 | 148 | ||
148 | static int __init collie_uart_init(void) { | 149 | static int __init collie_uart_init(void) |
150 | { | ||
149 | return locomo_driver_register(&collie_uart_driver); | 151 | return locomo_driver_register(&collie_uart_driver); |
150 | } | 152 | } |
151 | device_initcall(collie_uart_init); | 153 | device_initcall(collie_uart_init); |
@@ -195,18 +197,34 @@ static struct mtd_partition collie_partitions[] = { | |||
195 | } | 197 | } |
196 | }; | 198 | }; |
197 | 199 | ||
200 | static int collie_flash_init(void) | ||
201 | { | ||
202 | int 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) | 216 | } |
202 | write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) | COLLIE_SCP_VPEN); | 217 | |
203 | else | 218 | static void collie_flash_exit(void) |
204 | write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) & ~COLLIE_SCP_VPEN); | 219 | { |
220 | gpio_free(COLLIE_GPIO_VPEN); | ||
205 | } | 221 | } |
206 | 222 | ||
207 | static struct flash_platform_data collie_flash_data = { | 223 | static struct flash_platform_data collie_flash_data = { |
208 | .map_name = "cfi_probe", | 224 | .map_name = "cfi_probe", |
225 | .init = collie_flash_init, | ||
209 | .set_vpp = collie_set_vpp, | 226 | .set_vpp = collie_set_vpp, |
227 | .exit = collie_flash_exit, | ||
210 | .parts = collie_partitions, | 228 | .parts = collie_partitions, |
211 | .nr_parts = ARRAY_SIZE(collie_partitions), | 229 | .nr_parts = ARRAY_SIZE(collie_partitions), |
212 | }; | 230 | }; |