From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-msm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Tim Bird <tim.bird@sonymobile.com>,
Bjorn Andersson <bjorn.andersson@sonymobile.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: [RFC PATCH 14/18] ARM: msm: pass gpio irq range as resource
Date: Wed, 4 Mar 2015 20:33:08 +0100 [thread overview]
Message-ID: <1425497592-1831064-15-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1425497592-1831064-1-git-send-email-arnd@arndb.de>
The IRQ numbers that are used by the gpio driver are hardware
specific, and since this driver does not use irq domains, we
have to pass them as platform resources in order to perform
gpio configuration at runtime.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-msm/devices-msm7x00.c | 5 +++++
arch/arm/mach-msm/devices-msm7x30.c | 5 +++++
arch/arm/mach-msm/devices-qsd8x50.c | 5 +++++
arch/arm/mach-msm/gpio-msm-v1.c | 15 +++++++++------
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index b7308e7a301b..38c16313f433 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -99,6 +99,11 @@ static struct resource msm_gpio_resources[] = {
.flags = IORESOURCE_IRQ,
},
{
+ .start = NR_MSM_IRQS,
+ .end = NR_MSM_IRQS + NR_GPIO_IRQS - 1,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
.start = 0xa9200800,
.end = 0xa9200800 + SZ_4K - 1,
.flags = IORESOURCE_MEM,
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index 2d36c54b9523..197d2b8afa20 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -80,6 +80,11 @@ static struct resource msm_gpio_resources[] = {
.flags = IORESOURCE_IRQ,
},
{
+ .start = NR_MSM_IRQS,
+ .end = NR_MSM_IRQS + NR_GPIO_IRQS - 1,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
.start = 0xac001000,
.end = 0xac001000 + SZ_4K - 1,
.flags = IORESOURCE_MEM,
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index 5f280467f207..3fd28b702591 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -90,6 +90,11 @@ static struct resource msm_gpio_resources[] = {
.flags = IORESOURCE_IRQ,
},
{
+ .start = NR_MSM_IRQS,
+ .end = NR_MSM_IRQS + NR_GPIO_IRQS - 1,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
.start = 0xa9000800,
.end = 0xa9000800 + SZ_4K - 1,
.flags = IORESOURCE_MEM,
diff --git a/arch/arm/mach-msm/gpio-msm-v1.c b/arch/arm/mach-msm/gpio-msm-v1.c
index 589115c1faa2..2700f9bda455 100644
--- a/arch/arm/mach-msm/gpio-msm-v1.c
+++ b/arch/arm/mach-msm/gpio-msm-v1.c
@@ -274,7 +274,7 @@
#define MSM7X30_GPIO_INT_STATUS_6 MSM_GPIO1_REG(0xE0)
#define MSM7X30_GPIO_INT_STATUS_7 MSM_GPIO1_REG(0x234)
-#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0)
+static int msm_gpio_first_irq;
#define MSM_GPIO_BANK(soc, bank, first, last) \
{ \
@@ -446,7 +446,7 @@ static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
- return MSM_GPIO_TO_INT(chip->base + offset);
+ return chip->base + offset - msm_gpio_first_irq;
}
static int msm_gpio_request(struct gpio_chip *chip, unsigned offset)
@@ -618,9 +618,9 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
j = fls(mask) - 1;
/* printk("%s %08x %08x bit %d gpio %d irq %d\n",
__func__, v, m, j, msm_chip->chip.start + j,
- FIRST_GPIO_IRQ + msm_chip->chip.start + j); */
+ msm_gpio_first_irq + msm_chip->chip.start + j); */
val &= ~mask;
- generic_handle_irq(FIRST_GPIO_IRQ +
+ generic_handle_irq(msm_gpio_first_irq +
msm_chip->chip.base + j);
}
}
@@ -668,8 +668,11 @@ static int gpio_msm_v1_probe(struct platform_device *pdev)
if (IS_ERR(base2))
return PTR_ERR(base2);
- for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
- if (i - FIRST_GPIO_IRQ >=
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
+ msm_gpio_first_irq = res->start;
+
+ for (i = msm_gpio_first_irq; i <= res->end; i++) {
+ if (i - msm_gpio_first_irq >=
msm_gpio_chips[j].chip.base +
msm_gpio_chips[j].chip.ngpio)
j++;
--
2.1.0.rc2
next prev parent reply other threads:[~2015-03-04 19:33 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 19:32 [RFC PATCH 00/18] ARM: msm multiplatform support Arnd Bergmann
2015-03-04 19:32 ` [RFC PATCH 01/18] serial: remove obsolete msm_serial_hs driver Arnd Bergmann
2015-03-04 20:03 ` Paul Bolle
2015-03-04 20:07 ` Paul Bolle
2015-03-04 20:38 ` Arnd Bergmann
2015-03-04 19:32 ` [RFC PATCH 02/18] mmc: msm: move data mover into mmc driver Arnd Bergmann
2015-03-13 13:14 ` Ulf Hansson
2015-03-04 19:32 ` [RFC PATCH 03/18] mmc: msm: pass dmov resources via device Arnd Bergmann
2015-03-13 13:15 ` Ulf Hansson
2015-03-04 19:32 ` [RFC PATCH 04/18] mmc: msm: move clk-reset logic to platform Arnd Bergmann
2015-03-13 13:15 ` Ulf Hansson
2015-03-04 19:32 ` [RFC PATCH 05/18] ARM: msm: fix qsd8x50 rev.a support Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 06/18] ARM: msm: fix mach/msm_iomap.h inclusions Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 07/18] ARM: msm: fix sirc code for multiplatform Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 08/18] ARM: msm: fix gpiomux config " Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 09/18] ARM: msm: fix vic irqchip " Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 10/18] gpio: move msm-v1 driver to mach-msm Arnd Bergmann
2015-03-09 16:10 ` Linus Walleij
2015-03-04 19:33 ` [RFC PATCH 11/18] clocksource: qcom: make mach-msm and mach-qcom coexist Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 12/18] ARM: msm: make smd behave like a normal driver Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 13/18] ARM: msm: rename conflicting symbols Arnd Bergmann
2015-03-04 19:33 ` Arnd Bergmann [this message]
2015-03-04 19:33 ` [RFC PATCH 15/18] ARM: msm: clean up irq handling Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 16/18] ARM: msm: make msm_smd.h global Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 17/18] ARM: msm: make all header files local Arnd Bergmann
2015-03-04 19:33 ` [RFC PATCH 18/18] ARM: msm: enable multiplatform support Arnd Bergmann
2015-03-04 20:31 ` [RFC PATCH 00/18] ARM: msm " Paul Bolle
2015-03-04 20:35 ` Arnd Bergmann
2015-03-04 21:09 ` Paul Bolle
2015-03-04 21:14 ` Paul Bolle
2015-03-04 22:11 ` dwalker
2015-03-04 22:30 ` Arnd Bergmann
2015-03-05 16:40 ` Ulf Hansson
2015-03-08 22:52 ` Arnd Bergmann
2015-03-07 3:12 ` dwalker
2015-03-12 16:27 ` Arnd Bergmann
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=1425497592-1831064-15-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=bjorn.andersson@sonymobile.com \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
--cc=tim.bird@sonymobile.com \
--cc=ulf.hansson@linaro.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
all inboxes | Powered by JetHome®