Adding driver authors to the To: Line and top posting to get some review. Yours, Linus Walleij On Fri, Jun 2, 2017 at 1:27 AM, <xgchenshy@xxxxxxxxx> wrote: > From: Xiaoguang Chen <xgchenshy@xxxxxxxxx> > > dwapb_irq_set_type overwrites polarity register value for > IRQ_TYPE_EDGE_BOTH case. If the polarity of one gpio is 0 > by default, then it will set falling edge irq trigger. > and the gpio may requires rising edge irq for the first time, > and it will be missed. > > Do not overwrite polarity register for IRQ_TYPE_EDGE_BOTH case > can solve this issue. > > Signed-off-by: Xiaoguang Chen <xgchenshy@xxxxxxxxx> > --- > drivers/gpio/gpio-dwapb.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c > index f051c45..80913e4 100644 > --- a/drivers/gpio/gpio-dwapb.c > +++ b/drivers/gpio/gpio-dwapb.c > @@ -288,7 +288,8 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 type) > irq_setup_alt_chip(d, type); > > dwapb_write(gpio, GPIO_INTTYPE_LEVEL, level); > - dwapb_write(gpio, GPIO_INT_POLARITY, polarity); > + if (type != IRQ_TYPE_EDGE_BOTH) > + dwapb_write(gpio, GPIO_INT_POLARITY, polarity); > spin_unlock_irqrestore(&gc->bgpio_lock, flags); > > return 0; > -- > 2.8.4 (Apple Git-73) > -- 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