lkml.org 
[lkml]   [2020]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] pinctrl: nsp: Set irq handler based on trig type
Date
On Tue, 2020-06-30 at 15:26 -0700, Ray Jui wrote:
> - u32 trigger_type;
> >
> > - trigger_type = irq_get_trigger_type(d->irq);
> > - if (trigger_type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
> > - nsp_set_bit(chip, REG, NSP_GPIO_EVENT, gpio, val);
> > + nsp_set_bit(chip, REG, NSP_GPIO_EVENT, gpio, val);
>
>
> I have a question here. I assume writing a bit to this register will
> result in clearing that bit, is that true?
>
> Based on the driver, the 'nsp_gpio_irq_handler' seems to rely on
> 'NSP_GPIO_EVENT' register to figure out which GPIO the interrupt is for.
> And if so, and if this is cleared here that is invoked before the actual
> IRQ handler, how does this work?

It seems that this change masked another issue I was having. However,
the original code is still wrong as using nsp_set_bit() will do a
read/modify/write and clear all events regardless of what gpio is.

I have found another issue, where I'm getting many more edge-triggered
interrupts than I think I should be, so I'll sort that and send a v2 of
this patch.

\
 
 \ /
  Last update: 2020-07-01 22:15    [W:0.049 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site