[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110921122300.GB4374@opensource.wolfsonmicro.com>
Date: Wed, 21 Sep 2011 13:23:01 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Ian Lartey <ian@...nsource.wolfsonmicro.com>,
Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: mfd: Simulate active high IRQs with wm831x
On Wed, Sep 21, 2011 at 09:44:15AM +0300, Dan Carpenter wrote:
> 518 /* Simulate an edge triggered IRQ by polling the input
> 519 * status. This is sucky but improves interoperability.
> 520 */
> 521 if (primary == WM831X_GP_INT &&
> 522 wm831x->gpio_level[i - WM831X_IRQ_GPIO_1]) {
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> We're inside a for loop over ARRAY_SIZE(wm831x_irqs) which has 58
> elements (so "i" is 0-57) and we subtract WM831X_IRQ_GPIO_1 (1) which
> gives us a max of 56. The ->gpio_level[] array only has 16 elements
> In wm831x_irq_set_type() it only sets the first 11 elements of the
> ->gpio_level[] array. Perhaps something similar is needed here. I
> don't know the code well enough to say.
There's no need for any additional checks, the check for the primary IRQ
ensures that we know we're dealing with a GPIO IRQ.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists