Re: [PATCH] regmap: irq: Correct documentation of wake_invert flag

From: Shawn Guo

Date: Sat Oct 25 2025 - 02:56:00 EST


On Fri, Oct 24, 2025 at 02:11:26PM +0100, Mark Brown wrote:
> On Fri, Oct 24, 2025 at 04:23:44PM +0800, Shawn Guo wrote:
>
> > Per commit 9442490a0286 ("regmap: irq: Support wake IRQ mask inversion")
> > the wake_invert flag is to support enable register, so cleared bits are
> > wake disabled.
>
> > - * @wake_invert: Inverted wake register: cleared bits are wake enabled.
> > + * @wake_invert: Inverted wake register: cleared bits are wake disabled.
>
> That sounds like what I'd expect for a normal polarity wake register?
> I'd expect to set the bit to enable, so inverting that means that
> instead we clear the bit which is what the original text says.

Hmm, am I misreading the wake disable code in regmap_add_irq_chip()?

/* Wake is disabled by default */
if (d->wake_buf) {
...

if (chip->wake_invert)
ret = regmap_update_bits(d->map, reg,
d->mask_buf_def[i],
0);
else
ret = regmap_update_bits(d->map, reg,
d->mask_buf_def[i],
d->wake_buf[i]);
...
}

Isn't it clearing bits to disable wake for wake_invert flag?

Shawn