[PATCH 1/2] gpio add interrupt support on pca953x
Mark Brown
broonie at opensource.wolfsonmicro.com
Tue Dec 22 07:51:29 EST 2009
On Tue, Dec 22, 2009 at 07:29:03AM -0500, Haojian Zhuang wrote:
> +static void pca953x_irq_work(struct work_struct *work)
> +{
> + DECLARE_BITMAP(rising, PCA953X_NUM_IRQ);
> + DECLARE_BITMAP(falling, PCA953X_NUM_IRQ);
...
> +static void pca953x_irq_handler(unsigned int irq, struct irq_desc *desc)
> +{
> + struct pca953x_chip *chip = desc->handler_data;
> +
> + desc->chip->ack(irq);
> + schedule_work(&chip->irq_work);
> +}
genirq ought to be able to handle this in-line with the assistance of
the lock() and sync_unlock() operations that are available to irq_chip,
you shouldn't need a workqueue. The wm831x driver is as far as I know
the only driver actually doing this at the minute.
> +static struct irq_chip pca953x_irqchip = {
> + .name = "GPIO",
Might be nice to call this "pxa953x" or something else including that
name - GPIO is a bit too generic, it's not going to immediately obvious
which chip this GPIO is for.
More information about the linux-arm-kernel
mailing list