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

Shawn Guo posted 1 patch 3 months, 2 weeks ago
include/linux/regmap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] regmap: irq: Correct documentation of wake_invert flag
Posted by Shawn Guo 3 months, 2 weeks ago
From: Shawn Guo <shawnguo@kernel.org>

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.

Fixes: 68622bdfefb9 ("regmap: irq: document mask/wake_invert flags")
Cc: stable@vger.kernel.org
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
---
 include/linux/regmap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4e1ac1fbcec4..55343795644b 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1643,7 +1643,7 @@ struct regmap_irq_chip_data;
  * @status_invert: Inverted status register: cleared bits are active interrupts.
  * @status_is_level: Status register is actuall signal level: Xor status
  *		     register with previous value to get active interrupts.
- * @wake_invert: Inverted wake register: cleared bits are wake enabled.
+ * @wake_invert: Inverted wake register: cleared bits are wake disabled.
  * @type_in_mask: Use the mask registers for controlling irq type. Use this if
  *		  the hardware provides separate bits for rising/falling edge
  *		  or low/high level interrupts and they should be combined into
-- 
2.43.0
Re: [PATCH] regmap: irq: Correct documentation of wake_invert flag
Posted by Mark Brown 3 months, 1 week ago
On Fri, 24 Oct 2025 16:23:44 +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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: irq: Correct documentation of wake_invert flag
      commit: 48cbf50531d8eca15b8a811717afdebb8677de9b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Re: [PATCH] regmap: irq: Correct documentation of wake_invert flag
Posted by Mark Brown 3 months, 2 weeks ago
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.
Re: [PATCH] regmap: irq: Correct documentation of wake_invert flag
Posted by Shawn Guo 3 months, 2 weeks ago
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