diff options
author | Thomas Kunze <thommycheck@gmx.de> | 2009-02-10 20:59:05 +0100 |
---|---|---|
committer | Thomas Kunze <thommycheck@gmx.de> | 2009-02-10 20:59:05 +0100 |
commit | 4be205e17f2f4497ff936255c5bba7553bc39dc9 (patch) | |
tree | f3b472118758d0f1b352834810b7bd294a4454d0 /packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch | |
parent | 0345d624647954e3a49e05b8c221f8281e0897eb (diff) |
linux_2.6.28: add collie patches
Diffstat (limited to 'packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch')
-rw-r--r-- | packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch b/packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch new file mode 100644 index 0000000000..51c161f99d --- /dev/null +++ b/packages/linux/linux-2.6.28/collie/0001-collie-start-scoop-converton-to-new-api.patch @@ -0,0 +1,106 @@ +From 4765c85914d55590c6d17b6cf9e6f7964d1af108 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov <dbaryshkov@gmail.com> +Date: Tue, 28 Oct 2008 21:41:39 +0300 +Subject: [PATCH 01/23] collie: start scoop converton to new api + +Start converting scoop gpio access to new API instead of old +deprecated one. + +Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> +--- + arch/arm/mach-sa1100/collie.c | 28 +++++++++++++++++++++++----- + arch/arm/mach-sa1100/include/mach/collie.h | 7 ++++--- + 2 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c +index fe28999..8cf267f 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> +@@ -55,6 +56,7 @@ static struct resource collie_scoop_resources[] = { + static struct scoop_config collie_scoop_setup = { + .io_dir = COLLIE_SCOOP_IO_DIR, + .io_out = COLLIE_SCOOP_IO_OUT, ++ .gpio_base = COLLIE_SCOOP_GPIO_BASE, + }; + + struct platform_device colliescoop_device = { +@@ -196,18 +198,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), + }; +diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h +index 69e9624..9bc5349 100644 +--- a/arch/arm/mach-sa1100/include/mach/collie.h ++++ b/arch/arm/mach-sa1100/include/mach/collie.h +@@ -14,6 +14,7 @@ + #define __ASM_ARCH_COLLIE_H + + ++#define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) + #define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 + #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 + #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 +@@ -21,13 +22,13 @@ + #define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 + #define COLLIE_SCP_5VON SCOOP_GPCR_PA16 + #define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 +-#define COLLIE_SCP_VPEN SCOOP_GPCR_PA18 ++#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) + #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 + + #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ +- COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | COLLIE_SCP_VPEN | \ ++ COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ + COLLIE_SCP_LB_VOL_CHG ) +-#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \ ++#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ + COLLIE_SCP_CHARGE_ON ) + + /* GPIOs for which the generic definition doesn't say much */ +-- +1.5.6.5 + |