diff options
author | Tony Xie <tony.xie@rock-chips.com> | 2018-10-30 06:07:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-11-14 17:20:45 -0500 |
commit | 43fac3238c1d9363b2a93d8d56c2be0c29c64e6c (patch) | |
tree | cd92edbc17e84b16904ec38f23b69b4324e79b41 /include/linux/regmap.h | |
parent | 651022382c7f8da46cb4872a545ee1da6d097d2a (diff) |
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: Tony Xie <tony.xie@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index a367d59c301d..3930f3331652 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -1110,6 +1110,12 @@ struct regmap_irq { | |||
1110 | #define REGMAP_IRQ_REG(_irq, _off, _mask) \ | 1110 | #define REGMAP_IRQ_REG(_irq, _off, _mask) \ |
1111 | [_irq] = { .reg_offset = (_off), .mask = (_mask) } | 1111 | [_irq] = { .reg_offset = (_off), .mask = (_mask) } |
1112 | 1112 | ||
1113 | #define REGMAP_IRQ_REG_LINE(_id, _reg_bits) \ | ||
1114 | [_id] = { \ | ||
1115 | .mask = BIT((_id) % (_reg_bits)), \ | ||
1116 | .reg_offset = (_id) / (_reg_bits), \ | ||
1117 | } | ||
1118 | |||
1113 | /** | 1119 | /** |
1114 | * struct regmap_irq_chip - Description of a generic regmap irq_chip. | 1120 | * struct regmap_irq_chip - Description of a generic regmap irq_chip. |
1115 | * | 1121 | * |