lkml.org 
[lkml]   [2011]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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.


\
 
 \ /
  Last update: 2011-09-21 14:25    [W:0.018 / U:4.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site