From: avinashphilip@ti.com (Philip Avinash)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/7] ARM: davinci: da8xx: creation of gpio platform device
Date: Fri, 14 Jun 2013 15:05:28 +0530 [thread overview]
Message-ID: <1371202532-14628-4-git-send-email-avinashphilip@ti.com> (raw)
In-Reply-To: <1371202532-14628-1-git-send-email-avinashphilip@ti.com>
From: KV Sujith <sujithkv@ti.com>
gpio controller resource information being associated with
davinci_soc_info structure and not created any device. Hence davinci
gpio didn't fall under proper device model. This patch creates gpio
davinci as a platform device for da8xx platforms.
- Add Memory and IRQ resources for da8xx
- Register GPIO platform driver for da8xx.
- Add da8xx_register_gpio API to create platform device for da8xx
platforms.
Signed-off-by: KV Sujith <sujithkv@ti.com>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/devices-da8xx.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 1 +
2 files changed, 27 insertions(+)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index bf57252..892ad86 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -640,6 +640,32 @@ int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
return platform_device_register(&da8xx_lcdc_device);
}
+static struct resource da8xx_gpio_resources[] = {
+ { /* registers */
+ .start = DA8XX_GPIO_BASE,
+ .end = DA8XX_GPIO_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ { /* interrupt */
+ .start = IRQ_DA8XX_GPIO0,
+ .end = IRQ_DA8XX_GPIO8,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device da8xx_gpio_device = {
+ .name = "davinci_gpio",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(da8xx_gpio_resources),
+ .resource = da8xx_gpio_resources,
+};
+
+int __init da8xx_register_gpio(void *pdata)
+{
+ da8xx_gpio_device.dev.platform_data = pdata;
+ return platform_device_register(&da8xx_gpio_device);
+}
+
static struct resource da8xx_mmcsd0_resources[] = {
{ /* registers */
.start = DA8XX_MMCSD0_BASE,
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 2e1c9ea..aa66690 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -96,6 +96,7 @@ int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
int da850_register_mmcsd1(struct davinci_mmc_config *config);
void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
int da8xx_register_rtc(void);
+int da8xx_register_gpio(void *pdata);
int da850_register_cpufreq(char *async_clk);
int da8xx_register_cpuidle(void);
void __iomem * __init da8xx_get_mem_ctlr(void);
--
1.7.9.5
next prev parent reply other threads:[~2013-06-14 9:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 9:35 [PATCH v2 0/7] Convert GPIO Davinci to platform driver Philip Avinash
2013-06-14 9:35 ` [PATCH v2 1/7] gpio: davinci: coding style correction Philip Avinash
2013-06-19 10:52 ` Sekhar Nori
2013-06-14 9:35 ` [PATCH v2 2/7] gpio: davinci: move to platform device Philip Avinash
2013-06-19 11:23 ` Sekhar Nori
2013-06-14 9:35 ` Philip Avinash [this message]
2013-06-19 11:51 ` [PATCH v2 3/7] ARM: davinci: da8xx: creation of gpio " Sekhar Nori
2013-06-14 9:35 ` [PATCH v2 4/7] ARM: davinci: creation of gpio platform device for dmxxx platforms Philip Avinash
2013-06-20 6:18 ` Sekhar Nori
2013-06-14 9:35 ` [PATCH v2 5/7] ARM: davinci: da8xx: gpio device creation Philip Avinash
2013-06-20 8:40 ` Sekhar Nori
2013-06-20 9:07 ` Sekhar Nori
2013-06-14 9:35 ` [PATCH v2 6/7] ARM: davinci: dmxxx: " Philip Avinash
2013-06-20 8:55 ` Sekhar Nori
2013-06-14 9:35 ` [PATCH v2 7/7] ARM: davinci: Start using gpiolib API inplace of inline functions Philip Avinash
2013-06-19 19:05 ` Linus Walleij
2013-06-20 9:19 ` Sekhar Nori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371202532-14628-4-git-send-email-avinashphilip@ti.com \
--to=avinashphilip@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).