Re: [PATCH v1 1/3] gpio: gpio-hisi: Add HiSilicon GPIO support
From: Linus Walleij
Date: Wed Dec 09 2020 - 04:05:25 EST
Hi Jiaxing,
thanks! waiting for the new patch!
On Wed, Dec 9, 2020 at 9:19 AM luojiaxing <luojiaxing@xxxxxxxxxx> wrote:
> >> +static void hisi_gpio_irq_disable(struct irq_data *d)
> >> +{
> >> + struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
> >> +
> >> + hisi_gpio_irq_set_mask(d);
> >> + hisi_gpio_write_reg(chip, HISI_GPIO_INTEN_CLR_WX, BIT(irqd_to_hwirq(d)));
> >> +}
> >
> > Interesting with a GPIO hardware that both as enable and mask
> > bits. I can't see why, usually they just have masks but I suppose
> > there is some reason.
>
> I see gpio-dwapb.c distinguishes between enable and mask too.
>
> In my opinion, enable indicates that the user uses the GPIO line as the
> interrupt trigger source,
>
> and mask indicates that the user does not want to see an interrupts for
> a while.
>
> The difference between the two types of flag is that interrupts
> generated during masking are recorded but not lost,
>
> however, if interrupts are disabled, interrupts will lost.
Ah, that makes perfect sense! Thanks for explaining.
Yours,
Linus Walleij