[PATCH v3 10/12] gpio: pxa: add irq base in platform data

Linus Walleij linus.walleij at linaro.org
Thu Feb 21 14:12:30 EST 2013


On Mon, Feb 18, 2013 at 6:12 AM, Haojian Zhuang
<haojian.zhuang at linaro.org> wrote:

> Macro PXA_GPIO_TO_IRQ() & MMP_GPIO_TO_IRQ() is used in machine driver
> without DT. Although we're allocating irq descriptions dynamically,
> it may break machine drivers without DT. Append pdata->irq_base.
> If irq_base is valid, allocate irq descriptions from irq_base.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang at linaro.org>
(...)
> -               chips[i].irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0);
> +               if (pdata->irq_base)
> +                       irq_base = pdata->irq_base + gpio;
> +               else
> +                       irq_base = -1;
> +               chips[i].irq_base = irq_alloc_descs(irq_base, 0, gc->ngpio, 0);
>                 if (chips[i].irq_base < 0)
>                         return -EINVAL;
>                 if (!irq_domain_add_legacy(pdev->dev.of_node, gc->ngpio,

In this case, when you want to pass a base IRQ, use
irq_domain_add_simple().

The descriptor allocation will still be unnecessary.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list