summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/collie.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2009-03-25 10:14:25 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-25 10:13:56 +0000
commit224be092d116b663ac426c4615e34ee54bab4a14 (patch)
tree1c5d71de8685ee4f61fa464a603a7c6bfbb4cb4e /arch/arm/mach-sa1100/collie.c
parentcf281a99b6e4f1223c8fdce390db3bf79e773f4c (diff)
downloadlinux-224be092d116b663ac426c4615e34ee54bab4a14.tar.gz
linux-224be092d116b663ac426c4615e34ee54bab4a14.tar.bz2
linux-224be092d116b663ac426c4615e34ee54bab4a14.zip
[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 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h>
+#include <linux/gpio.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -195,18 +196,34 @@ static struct mtd_partition collie_partitions[] = {
}
};
+static int collie_flash_init(void)
+{
+ int rc;
+ rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable");
+ if (rc)
+ return rc;
+
+ rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1);
+ if (rc)
+ gpio_free(COLLIE_GPIO_VPEN);
+
+ return rc;
+}
+
static void collie_set_vpp(int vpp)
{
- write_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR) | COLLIE_SCP_VPEN);
- if (vpp)
- write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) | COLLIE_SCP_VPEN);
- else
- write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) & ~COLLIE_SCP_VPEN);
+ gpio_set_value(COLLIE_GPIO_VPEN, vpp);
}
+static void collie_flash_exit(void)
+{
+ gpio_free(COLLIE_GPIO_VPEN);
+}
static struct flash_platform_data collie_flash_data = {
.map_name = "cfi_probe",
+ .init = collie_flash_init,
.set_vpp = collie_set_vpp,
+ .exit = collie_flash_exit,
.parts = collie_partitions,
.nr_parts = ARRAY_SIZE(collie_partitions),
};