Re: [PATCH 2/2] gpio: etraxfs: add interrupt support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 31, 2015 at 2:48 PM, Rabin Vincent <rabin@xxxxxx> wrote:

> On ETRAX FS, all pins on the first port (and only the first port) have
> interrupt support.
>
> On ARTPEC-3, all pins on all ports have interrupt support.  However,
> there are only eight interrupts.  Each of the interrupts is associated
> with a group of pins and for each interrupt the one pin from the group
> which will trigger it can be selected.
>
> Signed-off-by: Rabin Vincent <rabin@xxxxxx>

Patch applied, kudos for using the IRQ helpers!

> +static int etraxfs_gpio_irq_request_resources(struct irq_data *d)
> +{
> +       struct etraxfs_gpio_chip *chip = irq_data_get_irq_chip_data(d);
> +       struct etraxfs_gpio_block *block = chip->block;
> +       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
> +       int ret = -EBUSY;
> +
> +       spin_lock(&block->lock);
> +       if (block->group[grpirq])
> +               goto out;
> +
> +       ret = gpiochip_lock_as_irq(&chip->bgc.gc, d->hwirq);
> +       if (ret)
> +               goto out;

Some duplicate code for locking the irqs, so I'll see if I can
refactor something.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux