From 9cc1515cbd2155df8530ba8438b0b5bfdff50117 Mon Sep 17 00:00:00 2001 From: Philip Avinash Date: Sun, 18 Aug 2013 10:49:00 +0530 Subject: ARM: davinci: support gpio platform device DaVinci GPIO driver now uses platform device model. Add a GPIO platform register API to convert the traditional DaVinci SoCs to use the new model. While at it, also group related include files together wherever that was not the case. Signed-off-by: Philip Avinash Acked-by: Linus Walleij Signed-off-by: Lad, Prabhakar [nsekhar@ti.com: move function declaration to local header, simplify commit message, merge SoC specific portions from other patches into this patch] Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/dm644x.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-davinci/dm644x.c') diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 4f74682293d6..143a3217e8ef 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include "davinci.h" #include "clock.h" @@ -771,6 +771,30 @@ static struct platform_device dm644x_vpbe_dev = { }, }; +static struct resource dm644_gpio_resources[] = { + { /* registers */ + .start = DAVINCI_GPIO_BASE, + .end = DAVINCI_GPIO_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + { /* interrupt */ + .start = IRQ_GPIOBNK0, + .end = IRQ_GPIOBNK4, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct davinci_gpio_platform_data dm644_gpio_platform_data = { + .ngpio = 71, + .intc_irq_num = DAVINCI_N_AINTC_IRQ, +}; + +int __init dm644x_gpio_register(void) +{ + return davinci_gpio_register(dm644_gpio_resources, + sizeof(dm644_gpio_resources), + &dm644_gpio_platform_data); +} /*----------------------------------------------------------------------*/ static struct map_desc dm644x_io_desc[] = { @@ -897,10 +921,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = { .intc_irq_prios = dm644x_default_priorities, .intc_irq_num = DAVINCI_N_AINTC_IRQ, .timer_info = &dm644x_timer_info, - .gpio_type = GPIO_TYPE_DAVINCI, - .gpio_base = DAVINCI_GPIO_BASE, - .gpio_num = 71, - .gpio_irq = IRQ_GPIOBNK0, .emac_pdata = &dm644x_emac_pdata, .sram_dma = 0x00008000, .sram_len = SZ_16K, -- cgit v1.2.3