public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: thierry.reding@avionic-design•de (Thierry Reding)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 5/6] gpio: tegra: Dynamically allocate IRQ base, and support DT
Date: Thu, 5 Jan 2012 08:23:06 +0100	[thread overview]
Message-ID: <20120105072306.GA3980@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1325702378-20863-5-git-send-email-swarren@nvidia.com>

* Stephen Warren wrote:
> @@ -343,6 +344,16 @@ static int __devinit tegra_gpio_probe(struct platform_device *pdev)
>  	int i;
>  	int j;
>  
> +	irq_domain.irq_base = irq_alloc_descs(-1, 0, TEGRA_NR_GPIOS, 0);
> +	if (irq_domain.irq_base < 0) {
> +		dev_err(&pdev->dev, "Couldn't allocate IRQ numbers\n");
> +		return -ENODEV;
> +	}
> +	irq_domain.nr_irq = TEGRA_NR_GPIOS;
> +	irq_domain.ops = &irq_domain_simple_ops;
> +	irq_domain.of_node = pdev->dev.of_node;
> +	irq_domain_add(&irq_domain);

I was wondering: except for setting the nr_irq field this is pretty much what
irq_domain_add_simple() does. While I get that you need access to the domain
later on and cannot use the helper, I'm still wondering why the nr_irq field
is not initialized by irq_domain_add_simple().

I have a driver for a GPIO/IRQ expander that does exactly the same and was
always wondering why the irq_data.hwirq field isn't properly setup, and
irq_domain.nr_irq being 0 seems to be exactly the reason. So am I supposed to
not use irq_domain_add_simple() in this case or should we rather update the
helper to take a nr_irq parameter that can be used to initialize the nr_irq
field?

Thierry

P.S.: sorry for hijacking
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120105/9b493e95/attachment-0001.sig>

  reply	other threads:[~2012-01-05  7:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 18:39 [PATCH 1/6] ARM: tegra: Remove use of TEGRA_GPIO_TO_IRQ Stephen Warren
2012-01-04 18:39 ` [PATCH 2/6] dt: tegra gpio: Flesh out binding documentation Stephen Warren
2012-01-04 18:39 ` [PATCH 3/6] ARM: dt: tegra30.dtsi: Reformat gpio's interrupts property Stephen Warren
2012-01-04 19:50   ` Grant Likely
2012-01-04 18:39 ` [PATCH 4/6] ARM: dt: tegra30.dtsi: Add extra GPIO interrupt Stephen Warren
2012-01-04 18:39 ` [PATCH 5/6] gpio: tegra: Dynamically allocate IRQ base, and support DT Stephen Warren
2012-01-05  7:23   ` Thierry Reding [this message]
2012-01-05 17:47     ` Stephen Warren
2012-01-05 17:56       ` Grant Likely
2012-01-05 13:17   ` Jamie Iles
2012-01-05 16:47     ` Stephen Warren
2012-01-05 16:48       ` Jamie Iles
2012-01-04 18:39 ` [PATCH 6/6] gpio: tegra: Parameterize the number of banks Stephen Warren
2012-01-04 19:54   ` Rob Herring
2012-01-04 20:00     ` Stephen Warren
2012-01-04 22:00       ` Grant Likely
2012-01-05 17:24         ` Rob Herring
2012-01-13 20:55           ` Stephen Warren
2012-01-14 15:15             ` Rob Herring
2012-01-04 19:52 ` [PATCH 1/6] ARM: tegra: Remove use of TEGRA_GPIO_TO_IRQ Grant Likely
2012-01-24  8:34   ` Olof Johansson

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=20120105072306.GA3980@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design$(echo .)de \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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