Re: [PATCH] gpio: dwapb: fix missing first irq for edgeboth irq type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux