[PATCH v4 1/3] ARM: bcm281xx: Add GPIO driver

Linus Walleij linus.walleij at linaro.org
Wed Aug 28 15:50:09 EDT 2013


On Fri, Aug 23, 2013 at 9:30 PM, Markus Mayer <markus.mayer at linaro.org> wrote:

> I have a follow-up question regarding status reads for each iteration.
> Is this what you are looking for?
>
>         for (;;) {
>                 sta = readl(reg_base + GPIO_INT_STATUS(bank_id)) &
>                     (~(readl(reg_base + GPIO_INT_MASK(bank_id))));
>                 if (sta == 0)
>                         break;

Yes, but follow the design pattern of other drivers such as the
drivers/irqchip/irq-vic.c:

static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
{
        u32 stat, irq;
        int handled = 0;

        while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
                irq = ffs(stat) - 1;
                handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
                handled = 1;
        }
}

I.e use that nice while-construction.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list