linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/8] pinctrl: sirf: convert to linear irq domain
Date: Mon, 25 Mar 2013 09:33:16 +0000	[thread overview]
Message-ID: <201303250933.16921.arnd@arndb.de> (raw)
In-Reply-To: <CAGsJ_4wR8UaSZ6NVANw3CTj+w6=41oxJRkffaJhOh4HBW8e3zg@mail.gmail.com>

On Monday 25 March 2013, Barry Song wrote:
> > @@ -1770,9 +1767,8 @@ static int sirfsoc_gpio_probe(struct device_node *np)
> >                         goto out;
> >                 }
> >
> > -               bank->domain = irq_domain_add_legacy(np, SIRFSOC_GPIO_BANK_SIZE,
> > -                       SIRFSOC_GPIO_IRQ_START + i * SIRFSOC_GPIO_BANK_SIZE, 0,
> > -                       &sirfsoc_gpio_irq_simple_ops, bank);
> > +               bank->domain = irq_domain_add_linear(np, SIRFSOC_GPIO_BANK_SIZE,
> > +                                               &sirfsoc_gpio_irq_simple_ops, bank);
> 
> this line breaks the gpio/irq mapping and gpio irq_domain:
> 
>        printk("%s gpio_to_irq: %d %d %d\n", __func__,
>                gpio_to_irq(0), gpio_to_irq(32), gpio_to_irq(65));
> 
> result:
> sdhci_sirf_probe gpio_to_irq: 0 0 0
> 
> for the old codes, it works:
> sdhci_sirf_probe gpio_to_irq: 128 160 193

Does it work if you add the hunk below?

I think the problem is that with irq_domain_add_linear, we don't create
a mapping for all the interrupts right away.

	Arnd

diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index d02498b..5f031ca 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1347,7 +1347,7 @@ static inline int sirfsoc_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 	struct sirfsoc_gpio_bank *bank = container_of(to_of_mm_gpio_chip(chip),
 		struct sirfsoc_gpio_bank, chip);
 
-	return irq_find_mapping(bank->domain, offset);
+	return irq_create_mapping(bank->domain, offset);
 }
 
 static inline int sirfsoc_gpio_to_offset(unsigned int gpio)

  reply	other threads:[~2013-03-25  9:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 11:41 [PATCH 0/8] SIRF multiplatform support Arnd Bergmann
2013-03-20 11:41 ` [PATCH 1/8] pinctrl: sirf: convert to linear irq domain Arnd Bergmann
2013-03-20 14:28   ` Barry Song
2013-03-25  9:11   ` Barry Song
2013-03-25  9:33     ` Arnd Bergmann [this message]
2013-03-25 10:08       ` Barry Song
2013-03-20 11:41 ` [PATCH 2/8] ARM: sirf: fix prima2 interrupt lookup Arnd Bergmann
2013-03-25  5:44   ` Barry Song
2013-03-20 11:41 ` [PATCH 3/8] ARM: sirf: move irq driver to drivers/irqchip Arnd Bergmann
2013-03-25  9:19   ` Barry Song
2013-03-25  9:41     ` Arnd Bergmann
2013-03-25  9:56       ` Barry Song
2013-03-25 11:13         ` Arnd Bergmann
2013-03-20 11:41 ` [PATCH 4/8] ARM: sirf: enable sparse IRQ Arnd Bergmann
2013-03-25 10:33   ` Barry Song
2013-03-25 10:53     ` Arnd Bergmann
2013-03-20 11:41 ` [PATCH 5/8] ARM: sirf: move debug-macro.S to include/debug/sirf.S Arnd Bergmann
2013-03-25  9:44   ` Barry Song
2013-03-20 11:41 ` [PATCH 6/8] ARM: sirf: use clocksource_of infrastructure Arnd Bergmann
2013-03-25  9:27   ` Barry Song
2013-03-20 11:41 ` [PATCH 7/8] ARM: sirf: enable multiplatform support Arnd Bergmann
2013-03-25 10:22   ` Barry Song
2013-03-25 10:54     ` Arnd Bergmann
2013-03-20 11:41 ` [PATCH 8/8] ARM: sirf: enable support in multi_v7_defconfig Arnd Bergmann
2013-03-25 10:26   ` Barry Song
2013-03-20 12:28 ` [PATCH 0/8] SIRF multiplatform support Arnd Bergmann
2013-03-25 11:33 ` Arnd Bergmann
2013-03-26  6:17   ` Barry Song
2013-03-26 14:31     ` Arnd Bergmann
2013-03-27  1:48       ` Barry Song

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=201303250933.16921.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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).