aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorVaradarajan, Charulatha <charu@ti.com>2010-12-07 19:26:56 -0500
committerTony Lindgren <tony@atomide.com>2010-12-07 19:26:56 -0500
commitc95d10bc49d50a9bc0f63a6eae79bb2707dabfdc (patch)
treeb6d4fb201cd2eb73af0c96db5143ce2d3b9857f4 /arch/arm/plat-omap
parent9a748053f5f58a77cd71864f1d7b804175b0e47d (diff)
OMAP15xx: GPIO: Introduce support for GPIO init
Add support for handling OMAP15xx specific gpio_init by providing platform device data and doing device registration. Signed-off-by: Charulatha V <charu@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/gpio.c10
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h18
2 files changed, 20 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index e4741905285b..2b0d90109828 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -205,13 +205,6 @@ struct gpio_bank {
205 u32 dbck_enable_mask; 205 u32 dbck_enable_mask;
206}; 206};
207 207
208#define METHOD_MPUIO 0
209#define METHOD_GPIO_1510 1
210#define METHOD_GPIO_1610 2
211#define METHOD_GPIO_7XX 3
212#define METHOD_GPIO_24XX 5
213#define METHOD_GPIO_44XX 6
214
215#ifdef CONFIG_ARCH_OMAP16XX 208#ifdef CONFIG_ARCH_OMAP16XX
216static struct gpio_bank gpio_bank_1610[5] = { 209static struct gpio_bank gpio_bank_1610[5] = {
217 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE, 210 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE,
@@ -335,7 +328,8 @@ static struct gpio_bank gpio_bank_44xx[6] = {
335#endif 328#endif
336 329
337static struct gpio_bank *gpio_bank; 330static struct gpio_bank *gpio_bank;
338static int gpio_bank_count; 331/* TODO: Analyze removing gpio_bank_count usage from driver code */
332int gpio_bank_count;
339 333
340static inline struct gpio_bank *get_gpio_bank(int gpio) 334static inline struct gpio_bank *get_gpio_bank(int gpio)
341{ 335{
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index de1c604962eb..5bef86d76a6a 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -27,6 +27,7 @@
27#define __ASM_ARCH_OMAP_GPIO_H 27#define __ASM_ARCH_OMAP_GPIO_H
28 28
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/platform_device.h>
30#include <mach/irqs.h> 31#include <mach/irqs.h>
31 32
32#define OMAP1_MPUIO_BASE 0xfffb5000 33#define OMAP1_MPUIO_BASE 0xfffb5000
@@ -71,6 +72,23 @@
71 IH_MPUIO_BASE + ((nr) & 0x0f) : \ 72 IH_MPUIO_BASE + ((nr) & 0x0f) : \
72 IH_GPIO_BASE + (nr)) 73 IH_GPIO_BASE + (nr))
73 74
75#define METHOD_MPUIO 0
76#define METHOD_GPIO_1510 1
77#define METHOD_GPIO_1610 2
78#define METHOD_GPIO_7XX 3
79#define METHOD_GPIO_24XX 5
80#define METHOD_GPIO_44XX 6
81
82struct omap_gpio_platform_data {
83 u16 virtual_irq_start;
84 int bank_type;
85 int bank_width; /* GPIO bank width */
86 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
87};
88
89/* TODO: Analyze removing gpio_bank_count usage from driver code */
90extern int gpio_bank_count;
91
74extern int omap_gpio_init(void); /* Call from board init only */ 92extern int omap_gpio_init(void); /* Call from board init only */
75extern void omap2_gpio_prepare_for_idle(int power_state); 93extern void omap2_gpio_prepare_for_idle(int power_state);
76extern void omap2_gpio_resume_after_idle(void); 94extern void omap2_gpio_resume_after_idle(void);