From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] pinctrl/nomadik: use simple or linear IRQ domain
Date: Thu, 27 Sep 2012 08:29:38 -0500 [thread overview]
Message-ID: <506454C2.2080807@gmail.com> (raw)
In-Reply-To: <1348751639-17457-1-git-send-email-linus.walleij@stericsson.com>
On 09/27/2012 08:13 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This alters the Nomadik pinctrl driver to:
>
> - Call irqdomain_add_linear() for the DT case so we get
> all independent from IRQ numbers in this case.
> - Call irqdomain_add_simple() for the legacy case, which
> allocates the IRQ descriptors for the Nomadik pin controller
> dynamically.
>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/pinctrl/pinctrl-nomadik.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
> index e031c84..6aab107 100644
> --- a/drivers/pinctrl/pinctrl-nomadik.c
> +++ b/drivers/pinctrl/pinctrl-nomadik.c
> @@ -1286,9 +1286,19 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>
> platform_set_drvdata(dev, nmk_chip);
>
> - nmk_chip->domain = irq_domain_add_legacy(np, NMK_GPIO_PER_CHIP,
> - NOMADIK_GPIO_TO_IRQ(pdata->first_gpio),
> - 0, &nmk_gpio_irq_simple_ops, nmk_chip);
> + if (np) {
> + /* The DT case will just grab a set of IRQ numbers */
> + nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
> + &nmk_gpio_irq_simple_ops, nmk_chip);
irq_start = -1;
if (!np)
irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
and then always call irq_domain_add_simple.
Rob
> + } else {
> + /* Non-DT legacy mode, use hardwired IRQ numbers */
> + int irq_start;
> +
> + irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
> + nmk_chip->domain = irq_domain_add_simple(NULL,
> + NMK_GPIO_PER_CHIP, irq_start,
> + &nmk_gpio_irq_simple_ops, nmk_chip);
> + }
> if (!nmk_chip->domain) {
> dev_err(&dev->dev, "failed to create irqdomain\n");
> ret = -ENOSYS;
>
WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robherring2@gmail.com>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Stephen Warren <swarren@nvidia.com>,
Anmar Oueja <anmar.oueja@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 3/4] pinctrl/nomadik: use simple or linear IRQ domain
Date: Thu, 27 Sep 2012 08:29:38 -0500 [thread overview]
Message-ID: <506454C2.2080807@gmail.com> (raw)
In-Reply-To: <1348751639-17457-1-git-send-email-linus.walleij@stericsson.com>
On 09/27/2012 08:13 AM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This alters the Nomadik pinctrl driver to:
>
> - Call irqdomain_add_linear() for the DT case so we get
> all independent from IRQ numbers in this case.
> - Call irqdomain_add_simple() for the legacy case, which
> allocates the IRQ descriptors for the Nomadik pin controller
> dynamically.
>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/pinctrl/pinctrl-nomadik.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
> index e031c84..6aab107 100644
> --- a/drivers/pinctrl/pinctrl-nomadik.c
> +++ b/drivers/pinctrl/pinctrl-nomadik.c
> @@ -1286,9 +1286,19 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
>
> platform_set_drvdata(dev, nmk_chip);
>
> - nmk_chip->domain = irq_domain_add_legacy(np, NMK_GPIO_PER_CHIP,
> - NOMADIK_GPIO_TO_IRQ(pdata->first_gpio),
> - 0, &nmk_gpio_irq_simple_ops, nmk_chip);
> + if (np) {
> + /* The DT case will just grab a set of IRQ numbers */
> + nmk_chip->domain = irq_domain_add_linear(np, NMK_GPIO_PER_CHIP,
> + &nmk_gpio_irq_simple_ops, nmk_chip);
irq_start = -1;
if (!np)
irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
and then always call irq_domain_add_simple.
Rob
> + } else {
> + /* Non-DT legacy mode, use hardwired IRQ numbers */
> + int irq_start;
> +
> + irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
> + nmk_chip->domain = irq_domain_add_simple(NULL,
> + NMK_GPIO_PER_CHIP, irq_start,
> + &nmk_gpio_irq_simple_ops, nmk_chip);
> + }
> if (!nmk_chip->domain) {
> dev_err(&dev->dev, "failed to create irqdomain\n");
> ret = -ENOSYS;
>
next prev parent reply other threads:[~2012-09-27 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 13:13 [PATCH 3/4] pinctrl/nomadik: use simple or linear IRQ domain Linus Walleij
2012-09-27 13:13 ` Linus Walleij
2012-09-27 13:29 ` Rob Herring [this message]
2012-09-27 13:29 ` Rob Herring
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=506454C2.2080807@gmail.com \
--to=robherring2@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.