From patchwork Sun Aug 18 05:19:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 2846154 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 97E209F271 for ; Sun, 18 Aug 2013 05:23:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E9932020F for ; Sun, 18 Aug 2013 05:23:07 +0000 (UTC) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72D1B20214 for ; Sun, 18 Aug 2013 05:23:05 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7I5Lp9R020620; Sun, 18 Aug 2013 00:21:51 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7I5Lpmt029628; Sun, 18 Aug 2013 00:21:51 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Sun, 18 Aug 2013 00:21:51 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r7I5LprL015429; Sun, 18 Aug 2013 00:21:51 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1EE3480632; Sun, 18 Aug 2013 00:21:51 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 9FDE68062A for ; Sun, 18 Aug 2013 00:21:34 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r7I5LYrs028122 for ; Sun, 18 Aug 2013 00:21:34 -0500 (CDT) Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7I5LXp2001204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 18 Aug 2013 00:21:34 -0500 Received: from [216.82.250.99:27871] by server-11.bemta-12.messagelabs.com id 76/35-32766-DD950125; Sun, 18 Aug 2013 05:21:33 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-10.tower-126.messagelabs.com!1376803289!10330540!1 X-Originating-IP: [209.85.220.47] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10402 invoked from network); 18 Aug 2013 05:21:30 -0000 Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by server-10.tower-126.messagelabs.com with RC4-SHA encrypted SMTP; 18 Aug 2013 05:21:30 -0000 Received: by mail-pa0-f47.google.com with SMTP id kl13so3407623pab.6 for ; Sat, 17 Aug 2013 22:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cyZ1ZiypXfpeFF4EA6HBqr0iQfidnwisQ3qCjyIFXhc=; b=AaHiT+gqYq4q9FsJdD+p35bW/uqIgw8GXQbDzyF236d7Od4DIqK0IpvhJOt1edS4zT WKcu8OJfl7QkBWan00bRg4B/Rc4QcvJnjvHqAWzZIoh+1I2vSI7mJOmcCLkdBKAWKBEL RI/ONGKgg7WfYtcqxr80FezCRMF6/6K2Jwxvc2whDbhelXHMv2IDSg2MMuBhLatcKIAP BFCfoIjsT8pB55WDstw6TVhM0xEeT3W1ROvqh0IITGavLyrvhY9qp4DvADxgG811bwCp AaLXJdpmcY2cyto+OQbzmdv0rIpRhSFppBmDWRmFWQr1Niv2w6oPXk2ggAWyotnJWKOt I37w== X-Received: by 10.66.188.203 with SMTP id gc11mr6211189pac.63.1376803289414; Sat, 17 Aug 2013 22:21:29 -0700 (PDT) Received: from localhost.localdomain ([112.79.40.224]) by mx.google.com with ESMTPSA id pq1sm7175496pbb.26.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 Aug 2013 22:21:28 -0700 (PDT) From: "Lad, Prabhakar" To: DLOS , Sekhar Nori Subject: [PATCH v3 6/7] ARM: davinci: dmxxx: gpio device creation Date: Sun, 18 Aug 2013 10:49:02 +0530 Message-ID: <1376803143-13738-7-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376803143-13738-1-git-send-email-prabhakar.csengg@gmail.com> References: <1376803143-13738-1-git-send-email-prabhakar.csengg@gmail.com> CC: Linus Walleij , LKML , Philip Avinash , Grant Likely , LAK X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Philip Avinash Create davinci gpio device and remove gpio references in davinci_soc_info structure for dmxxx platforms. Also add Memory and IRQ resources for GPIO platform device. Also rearrange header file inclusion in group basis. Signed-off-by: Philip Avinash Signed-off-by: Sekhar Nori Signed-off-by: Lad, Prabhakar Acked-by: Linus Walleij --- arch/arm/mach-davinci/board-dm355-evm.c | 33 +++++++----- arch/arm/mach-davinci/board-dm355-leopard.c | 30 ++++++----- arch/arm/mach-davinci/board-dm365-evm.c | 30 ++++++----- arch/arm/mach-davinci/board-dm644x-evm.c | 40 ++++++++------ arch/arm/mach-davinci/board-dm646x-evm.c | 37 +++++++------ arch/arm/mach-davinci/board-neuros-osd2.c | 18 ++++--- arch/arm/mach-davinci/davinci.h | 17 +++--- arch/arm/mach-davinci/dm355.c | 54 +++++++++++++------ arch/arm/mach-davinci/dm365.c | 58 ++++++++++++++------- arch/arm/mach-davinci/dm644x.c | 47 ++++++++++++----- arch/arm/mach-davinci/dm646x.c | 47 ++++++++++++----- arch/arm/mach-davinci/include/mach/common.h | 2 + arch/arm/mach-davinci/include/mach/gpio-davinci.h | 2 - 13 files changed, 272 insertions(+), 143 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 42b23a3..4712fb4 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -8,29 +8,31 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ -#include -#include +#include #include -#include +#include +#include +#include +#include #include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include + #include -#include -#include #include #include -#include +#include #include -#include -#include -#include #include "davinci.h" @@ -375,6 +377,11 @@ static struct spi_board_info dm355_evm_spi_info[] __initconst = { static __init void dm355_evm_init(void) { struct clk *aemif; + int ret; + + ret = dm355_gpio_register(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); gpio_request(1, "dm9000"); gpio_direction_input(1); diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c index d9eb1c9..fbaeea8 100644 --- a/arch/arm/mach-davinci/board-dm355-leopard.c +++ b/arch/arm/mach-davinci/board-dm355-leopard.c @@ -7,27 +7,28 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ -#include -#include +#include #include -#include +#include +#include +#include +#include #include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include +#include #include #include -#include +#include #include -#include -#include -#include #include "davinci.h" @@ -233,6 +234,11 @@ static struct spi_board_info dm355_leopard_spi_info[] __initconst = { static __init void dm355_leopard_init(void) { struct clk *aemif; + int ret; + + ret = dm355_gpio_register(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); gpio_request(9, "dm9000"); gpio_direction_input(9); diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 000e2ab..9c1dd31 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -12,33 +12,33 @@ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include -#include +#include #include #include -#include -#include #include +#include +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include #include -#include -#include -#include #include +#include #include #include #include -#include #include -#include +#include #include -#include -#include -#include #include #include @@ -743,6 +743,12 @@ static struct spi_board_info dm365_evm_spi_info[] __initconst = { static __init void dm365_evm_init(void) { + int ret; + + ret = dm365_gpio_register(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); + evm_init_i2c(); davinci_serial_init(dm365_serial_device); diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 462812b..d0894d8 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -8,37 +8,42 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ -#include -#include +#include #include -#include +#include #include #include -#include #include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include - -#include #include #include #include -#include -#include #include -#include -#include -#include -#include +#include + +#include #include "davinci.h" @@ -753,9 +758,14 @@ static int davinci_phy_fixup(struct phy_device *phydev) static __init void davinci_evm_init(void) { + int ret; struct clk *aemif_clk; struct davinci_soc_info *soc_info = &davinci_soc_info; + ret = dm644x_gpio_register(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); + aemif_clk = clk_get(NULL, "aemif"); clk_prepare_enable(aemif_clk); diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 734cc02..e5e4cf0 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -16,37 +16,37 @@ * Included Files **************************************************************************/ -#include -#include -#include +#include +#include #include -#include #include #include #include - -#include -#include - +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include +#include +#include #include #include +#include +#include #include #include -#include -#include -#include -#include -#include -#include "davinci.h" +#include +#include + #include "clock.h" +#include "davinci.h" #define NAND_BLOCK_SIZE SZ_128K @@ -785,8 +785,13 @@ static struct edma_rsv_info dm646x_edma_rsv[] = { static __init void evm_init(void) { + int ret; struct davinci_soc_info *soc_info = &davinci_soc_info; + ret = dm646x_gpio_register(); + if (ret) + pr_warn("evm_init: GPIO init failed: %d\n", ret); + evm_init_i2c(); davinci_serial_init(dm646x_serial_device); dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 8e156e0..322eabd 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c @@ -23,20 +23,21 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ -#include #include #include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include #include -#include -#include -#include +#include #include "davinci.h" @@ -168,9 +169,14 @@ static struct davinci_mmc_config davinci_ntosd2_mmc_config = { static __init void davinci_ntosd2_init(void) { + int ret; struct clk *aemif_clk; struct davinci_soc_info *soc_info = &davinci_soc_info; + ret = dm644x_gpio_register(); + if (ret) + pr_warn("%s: GPIO init failed: %d\n", __func__, ret); + aemif_clk = clk_get(NULL, "aemif"); clk_prepare_enable(aemif_clk); diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h index 6dfc038..e297cb7 100644 --- a/arch/arm/mach-davinci/davinci.h +++ b/arch/arm/mach-davinci/davinci.h @@ -18,22 +18,23 @@ #define __DAVINCI_H #include -#include #include -#include -#include #include #include #include +#include +#include +#include + #include -#include -#include -#include #include #include #include #include +#include +#include +#include #define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000 #define SYSMOD_VDAC_CONFIG 0x2c @@ -84,6 +85,7 @@ void dm355_init_spi0(unsigned chipselect_mask, const struct spi_board_info *info, unsigned len); void dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata); int dm355_init_video(struct vpfe_config *, struct vpbe_config *); +int dm355_gpio_register(void); /* DM365 function declarations */ void dm365_init(void); @@ -94,11 +96,13 @@ void dm365_init_rtc(void); void dm365_init_spi0(unsigned chipselect_mask, const struct spi_board_info *info, unsigned len); int dm365_init_video(struct vpfe_config *, struct vpbe_config *); +int dm365_gpio_register(void); /* DM644x function declarations */ void dm644x_init(void); void dm644x_init_asp(struct snd_platform_data *pdata); int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); +int dm644x_gpio_register(void); /* DM646x function declarations */ void dm646x_init(void); @@ -108,6 +112,7 @@ int dm646x_init_edma(struct edma_rsv_info *rsv); void dm646x_video_init(void); void dm646x_setup_vpif(struct vpif_display_config *, struct vpif_capture_config *); +int dm646x_gpio_register(void); extern struct platform_device dm365_serial_device[]; extern struct platform_device dm355_serial_device[]; diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 0f3cb48..3eb5ffe 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -8,31 +8,31 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ -#include #include -#include -#include #include - +#include +#include +#include +#include +#include +#include #include #include +#include #include -#include -#include +#include #include -#include +#include +#include #include -#include -#include -#include -#include +#include -#include "davinci.h" +#include "asp.h" #include "clock.h" +#include "davinci.h" #include "mux.h" -#include "asp.h" #define DM355_UART2_BASE (IO_PHYS + 0x206000) #define DM355_OSD_BASE (IO_PHYS + 0x70200) @@ -886,6 +886,30 @@ static struct platform_device dm355_vpbe_dev = { }, }; +static struct resource dm355_gpio_resources[] = { + { /* registers */ + .start = DAVINCI_GPIO_BASE, + .end = DAVINCI_GPIO_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + { /* interrupt */ + .start = IRQ_DM355_GPIOBNK0, + .end = IRQ_DM355_GPIOBNK6, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct davinci_gpio_platform_data dm355_gpio_platform_data = { + .ngpio = 104, + .intc_irq_num = DAVINCI_N_AINTC_IRQ, +}; + +int __init dm355_gpio_register() +{ + return davinci_gpio_register(dm355_gpio_resources, + sizeof(dm355_gpio_resources), + &dm355_gpio_platform_data); +} /*----------------------------------------------------------------------*/ static struct map_desc dm355_io_desc[] = { @@ -1005,10 +1029,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = { .intc_irq_prios = dm355_default_priorities, .intc_irq_num = DAVINCI_N_AINTC_IRQ, .timer_info = &dm355_timer_info, - .gpio_type = GPIO_TYPE_DAVINCI, - .gpio_base = DAVINCI_GPIO_BASE, - .gpio_num = 104, - .gpio_irq = IRQ_DM355_GPIOBNK0, .sram_dma = 0x00010000, .sram_len = SZ_32K, }; diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 278080d..9bb60f1 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -12,31 +12,32 @@ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ -#include #include -#include -#include #include -#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include #include -#include -#include +#include #include -#include +#include +#include #include -#include -#include -#include -#include +#include -#include "davinci.h" +#include "asp.h" #include "clock.h" +#include "davinci.h" #include "mux.h" -#include "asp.h" #define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */ #define DM365_RTC_BASE 0x01c69000 @@ -698,6 +699,32 @@ void __init dm365_init_spi0(unsigned chipselect_mask, platform_device_register(&dm365_spi0_device); } +static struct resource dm365_gpio_resources[] = { + { /* registers */ + .start = DAVINCI_GPIO_BASE, + .end = DAVINCI_GPIO_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + { /* interrupt */ + .start = IRQ_DM365_GPIO0, + .end = IRQ_DM365_GPIO7, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct davinci_gpio_platform_data dm365_gpio_platform_data = { + .ngpio = 104, + .intc_irq_num = DAVINCI_N_AINTC_IRQ, + .gpio_unbanked = 8, +}; + +int __init dm365_gpio_register() +{ + return davinci_gpio_register(dm365_gpio_resources, + sizeof(dm365_gpio_resources), + &dm365_gpio_platform_data); +} + static struct emac_platform_data dm365_emac_pdata = { .ctrl_reg_offset = DM365_EMAC_CNTRL_OFFSET, .ctrl_mod_reg_offset = DM365_EMAC_CNTRL_MOD_OFFSET, @@ -1105,11 +1132,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { .intc_irq_prios = dm365_default_priorities, .intc_irq_num = DAVINCI_N_AINTC_IRQ, .timer_info = &dm365_timer_info, - .gpio_type = GPIO_TYPE_DAVINCI, - .gpio_base = DAVINCI_GPIO_BASE, - .gpio_num = 104, - .gpio_irq = IRQ_DM365_GPIO0, - .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ .emac_pdata = &dm365_emac_pdata, .sram_dma = 0x00010000, .sram_len = SZ_32K, diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 4f74682..9f5f059 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -8,27 +8,28 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ -#include #include -#include -#include +#include #include +#include +#include +#include #include +#include #include +#include #include -#include #include -#include +#include #include -#include -#include +#include -#include "davinci.h" +#include "asp.h" #include "clock.h" +#include "davinci.h" #include "mux.h" -#include "asp.h" /* * Device specific clocks @@ -771,6 +772,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() +{ + return davinci_gpio_register(dm644_gpio_resources, + sizeof(dm644_gpio_resources), + &dm644_gpio_platform_data); +} /*----------------------------------------------------------------------*/ static struct map_desc dm644x_io_desc[] = { @@ -897,10 +922,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, diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 68f8d1f..02042d5 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -8,28 +8,29 @@ * is licensed "as is" without any warranty of any kind, whether express * or implied. */ +#include #include #include -#include -#include -#include #include +#include +#include +#include #include +#include #include +#include #include -#include #include -#include +#include #include -#include -#include +#include -#include "davinci.h" +#include "asp.h" #include "clock.h" +#include "davinci.h" #include "mux.h" -#include "asp.h" #define DAVINCI_VPIF_BASE (0x01C12000) @@ -748,6 +749,30 @@ static struct platform_device vpif_capture_dev = { .num_resources = ARRAY_SIZE(vpif_capture_resource), }; +static struct resource dm646x_gpio_resources[] = { + { /* registers */ + .start = DAVINCI_GPIO_BASE, + .end = DAVINCI_GPIO_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + { /* interrupt */ + .start = IRQ_DM646X_GPIOBNK0, + .end = IRQ_DM646X_GPIOBNK2, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct davinci_gpio_platform_data dm646x_gpio_platform_data = { + .ngpio = 43, + .intc_irq_num = DAVINCI_N_AINTC_IRQ, +}; + +int __init dm646x_gpio_register() +{ + return davinci_gpio_register(dm646x_gpio_resources, + sizeof(dm646x_gpio_resources), + &dm646x_gpio_platform_data); +} /*----------------------------------------------------------------------*/ static struct map_desc dm646x_io_desc[] = { @@ -874,10 +899,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = { .intc_irq_prios = dm646x_default_priorities, .intc_irq_num = DAVINCI_N_AINTC_IRQ, .timer_info = &dm646x_timer_info, - .gpio_type = GPIO_TYPE_DAVINCI, - .gpio_base = DAVINCI_GPIO_BASE, - .gpio_num = 43, /* Only 33 usable */ - .gpio_irq = IRQ_DM646X_GPIOBNK0, .emac_pdata = &dm646x_emac_pdata, .sram_dma = 0x10010000, .sram_len = SZ_32K, diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index 0b3c169..4bb25e2 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h @@ -38,6 +38,8 @@ struct davinci_timer_info { struct davinci_gpio_controller; +#define DAVINCI_GPIO_BASE 0x01c67000 + /* * SoC info passed into common davinci modules. * diff --git a/arch/arm/mach-davinci/include/mach/gpio-davinci.h b/arch/arm/mach-davinci/include/mach/gpio-davinci.h index 551ba43..0d63b24 100644 --- a/arch/arm/mach-davinci/include/mach/gpio-davinci.h +++ b/arch/arm/mach-davinci/include/mach/gpio-davinci.h @@ -21,8 +21,6 @@ #include #include -#define DAVINCI_GPIO_BASE 0x01C67000 - enum davinci_gpio_type { GPIO_TYPE_DAVINCI = 0, GPIO_TYPE_TNETV107X,