Re: [PATCH v11 4/9] gpio: pl061: convert register access to regmap
From: Andy Shevchenko
Date: Wed Oct 21 2026 - 08:53:25 EST
On Tue, Oct 20, 2026 at 03:54:08PM +0800, Long Zhao via B4 Relay wrote:
> Replace readb()/writeb() with a MMIO regmap while keeping the existing
> gpio_chip and girq irqchip. Use a raw spinlock so irq_ack() can run
> under the irq descriptor lock.
...
> static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
> {
> struct pl061 *pl061 = gpiochip_get_data(gc);
> unsigned long flags;
> - unsigned char gpiodir;
> + unsigned int mask = BIT(offset);
Please, check everywhere (where you touch the definition blocks)
if you follow reversed xmas tree order. No need to resend just for
it, but if anything requires v12, please also address this.
> raw_spin_lock_irqsave(&pl061->lock, flags);
...
> static int pl061_set_value(struct gpio_chip *gc, unsigned int offset, int value)
> {
> struct pl061 *pl061 = gpiochip_get_data(gc);
>
> - writeb(!!value << offset, pl061->base + (BIT(offset + 2)));
> -
> - return 0;
> + return regmap_assign_bits(pl061->regmap,
> + BIT(offset + PL061_DATA_OFFSET),
Keep it on a single (81 characters) line, it's fine, it keeps it consistent
with the rest of the similar calls, so increases readability overall of the
driver. With the same remark, address if you need a v12 for something else.
> + BIT(offset), value);
> }
--
With Best Regards,
Andy Shevchenko