Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 43fac323 authored by Tony Xie's avatar Tony Xie Committed by Mark Brown
Browse files

regmap: add a new macro:REGMAP_IRQ_REG_LINE(_id, _reg_bits)



if there are lots of irqs for a device and the register addresses for these
irqs is continuous, we can use this macro to initialize regmap_irq value.

Signed-off-by: default avatarTony Xie <tony.xie@rock-chips.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 65102238
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1110,6 +1110,12 @@ struct regmap_irq {
#define REGMAP_IRQ_REG(_irq, _off, _mask)		\
	[_irq] = { .reg_offset = (_off), .mask = (_mask) }

#define REGMAP_IRQ_REG_LINE(_id, _reg_bits) \
	[_id] = {				\
		.mask = BIT((_id) % (_reg_bits)),	\
		.reg_offset = (_id) / (_reg_bits),	\
	}

/**
 * struct regmap_irq_chip - Description of a generic regmap irq_chip.
 *