summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch')
-rw-r--r--recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch137
1 files changed, 137 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch b/recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch
new file mode 100644
index 0000000000..c08c21a977
--- /dev/null
+++ b/recipes/linux/linux-2.6.28/collie/0017-collie-convert-to-gpiolib-for-ucb1x00.patch
@@ -0,0 +1,137 @@
+From c1bf0dcce68a5e01213e18c9ca1fd49efad4ddff Mon Sep 17 00:00:00 2001
+From: Thomas Kunze <thommycheck@gmx.de>
+Date: Tue, 10 Feb 2009 18:15:34 +0100
+Subject: [PATCH 17/23] collie: convert to gpiolib for ucb1x00
+
+Only the parts used for collie_battery are converted.
+The rest will be cleaned up later.
+
+Conflicts:
+
+ arch/arm/mach-sa1100/collie.c
+ arch/arm/mach-sa1100/include/mach/collie.h
+---
+ arch/arm/mach-sa1100/collie.c | 3 +-
+ arch/arm/mach-sa1100/include/mach/collie.h | 68 ++++++++++++++-------------
+ 2 files changed, 37 insertions(+), 34 deletions(-)
+
+diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
+index ec673b8..4b52f30 100644
+--- a/arch/arm/mach-sa1100/collie.c
++++ b/arch/arm/mach-sa1100/collie.c
+@@ -87,6 +87,7 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {
+ static struct mcp_plat_data collie_mcp_data = {
+ .mccr0 = MCCR0_ADM | MCCR0_ExtClk,
+ .sclk_rate = 9216000,
++ .gpio_base = COLLIE_TC35143_GPIO_BASE,
+ };
+
+ #ifdef CONFIG_SHARP_LOCOMO
+@@ -256,7 +257,7 @@ static void __init collie_init(void)
+ PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
+ PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+
+- PWER = COLLIE_GPIO_AC_IN | COLLIE_GPIO_CO | COLLIE_GPIO_ON_KEY |
++ PWER = COLLIE_GPIO_AC_IN_ | COLLIE_GPIO_CO_ | COLLIE_GPIO_ON_KEY |
+ COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT | PWER_RTC;
+
+ PGSR = COLLIE_GPIO_nREMOCON_ON;
+diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
+index 799c930..bba8978 100644
+--- a/arch/arm/mach-sa1100/include/mach/collie.h
++++ b/arch/arm/mach-sa1100/include/mach/collie.h
+@@ -15,7 +15,7 @@
+
+
+ #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1)
+-#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11
++#define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE)
+ #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
+ #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13
+ #define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
+@@ -25,28 +25,29 @@
+ #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
+ #define COLLIE_GPIO_LB_VOL_CHG (COLLIE_SCOOP_GPIO_BASE + 8)
+
+-#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
++#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
+ COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON )
+-#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
+- COLLIE_SCP_CHARGE_ON )
++#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)
+
+ /* GPIOs for which the generic definition doesn't say much */
+
+-#define COLLIE_GPIO_ON_KEY GPIO_GPIO (0)
+-#define COLLIE_GPIO_AC_IN GPIO_GPIO (1)
+-#define COLLIE_GPIO_SDIO_INT GPIO_GPIO (11)
+-#define COLLIE_GPIO_CF_IRQ GPIO_GPIO (14)
+-#define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO (15)
+-#define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO (16)
+-#define COLLIE_GPIO_nMIC_ON GPIO_GPIO (17)
+-#define COLLIE_GPIO_nREMOCON_ON GPIO_GPIO (18)
+-#define COLLIE_GPIO_CO GPIO_GPIO (20)
+-#define COLLIE_GPIO_MCP_CLK GPIO_GPIO (21)
+-#define COLLIE_GPIO_CF_CD GPIO_GPIO (22)
+-#define COLLIE_GPIO_UCB1x00_IRQ GPIO_GPIO (23)
+-#define COLLIE_GPIO_WAKEUP GPIO_GPIO (24)
+-#define COLLIE_GPIO_GA_INT GPIO_GPIO (25)
+-#define COLLIE_GPIO_MAIN_BAT_LOW GPIO_GPIO (26)
++#define COLLIE_GPIO_ON_KEY GPIO_GPIO(0)
++#define COLLIE_GPIO_AC_IN (1)
++#define COLLIE_GPIO_AC_IN_ GPIO_GPIO(1)
++#define COLLIE_GPIO_SDIO_INT GPIO_GPIO(11)
++#define COLLIE_GPIO_CF_IRQ GPIO_GPIO(14)
++#define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO(15)
++#define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO(16)
++#define COLLIE_GPIO_nMIC_ON GPIO_GPIO(17)
++#define COLLIE_GPIO_nREMOCON_ON GPIO_GPIO(18)
++#define COLLIE_GPIO_CO (20)
++#define COLLIE_GPIO_CO_ GPIO_GPIO(20)
++#define COLLIE_GPIO_MCP_CLK GPIO_GPIO(21)
++#define COLLIE_GPIO_CF_CD GPIO_GPIO(22)
++#define COLLIE_GPIO_UCB1x00_IRQ GPIO_GPIO(23)
++#define COLLIE_GPIO_WAKEUP GPIO_GPIO(24)
++#define COLLIE_GPIO_GA_INT GPIO_GPIO(25)
++#define COLLIE_GPIO_MAIN_BAT_LOW (26)
+
+ /* Interrupts */
+
+@@ -70,19 +71,20 @@
+ #define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
+
+ /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
+-#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 /* GPIO0=Version */
+-#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 /* GPIO1=TBL_CHK */
+-#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 /* GPIO2=VPNE_ON */
+-#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 /* GPIO3=IR_ON */
+-#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 /* GPIO4=AMP_ON */
+-#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 /* GPIO5=Version */
+-#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 /* GPIO5=fs 8k LPF */
+-#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 /* GPIO6=BUZZER BIAS */
+-#define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7 /* GPIO7=MBAT_ON */
+-#define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8 /* GPIO8=BBAT_ON */
+-#define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9 /* GPIO9=TMP_ON */
+-#define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 )
+-#define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \
+- UCB_IO_7 | UCB_IO_8 | UCB_IO_9 )
++#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
++#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
++#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
++#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
++#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3
++#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
++#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
++#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
++#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6
++#define COLLIE_GPIO_MBAT_ON (COLLIE_TC35143_GPIO_BASE + 7)
++#define COLLIE_GPIO_BBAT_ON (COLLIE_TC35143_GPIO_BASE + 8)
++#define COLLIE_GPIO_TMP_ON (COLLIE_TC35143_GPIO_BASE + 9)
++#define COLLIE_TC35143_GPIO_IN (UCB_IO_0 | UCB_IO_2 | UCB_IO_5)
++#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \
++ | UCB_IO_6)
+
+ #endif
+--
+1.5.6.5
+