aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/collie.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2009-03-25 05:14:25 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-25 06:13:56 -0400
commit224be092d116b663ac426c4615e34ee54bab4a14 (patch)
tree1c5d71de8685ee4f61fa464a603a7c6bfbb4cb4e /arch/arm/mach-sa1100/collie.c
parentcf281a99b6e4f1223c8fdce390db3bf79e773f4c (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/collie.c')
-rw-r--r--arch/arm/mach-sa1100/collie.c27
1 files changed, 22 insertions, 5 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
199static 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
198static void collie_set_vpp(int vpp) 213static 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
218static void collie_flash_exit(void)
219{
220 gpio_free(COLLIE_GPIO_VPEN);
221}
207static struct flash_platform_data collie_flash_data = { 222static 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};