diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 00:12:48 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 00:12:48 +0800 |
commit | e292b578c9bd587ad8fe230aa0500bde7be3c68a (patch) | |
tree | 997e77d1f7455b6dafc7493a98a3535b4aed1030 /include | |
parent | 7ed5849c2861faf9c13f027868f635bd782a50e5 (diff) | |
parent | 209a600623cf13a8168b2f6b83643db7825abb9a (diff) | |
download | linux-e292b578c9bd587ad8fe230aa0500bde7be3c68a.tar.gz linux-e292b578c9bd587ad8fe230aa0500bde7be3c68a.tar.bz2 linux-e292b578c9bd587ad8fe230aa0500bde7be3c68a.zip |
Merge branch 'topic/irq' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into wm8994-mfd
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/regmap.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 86923a98a766..946868c67cd6 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -147,4 +147,52 @@ void regcache_cache_only(struct regmap *map, bool enable); void regcache_cache_bypass(struct regmap *map, bool enable); void regcache_mark_dirty(struct regmap *map); +/** + * Description of an IRQ for the generic regmap irq_chip. + * + * @reg_offset: Offset of the status/mask register within the bank + * @mask: Mask used to flag/control the register. + */ +struct regmap_irq { + unsigned int reg_offset; + unsigned int mask; +}; + +/** + * Description of a generic regmap irq_chip. This is not intended to + * handle every possible interrupt controller, but it should handle a + * substantial proportion of those that are found in the wild. + * + * @name: Descriptive name for IRQ controller. + * + * @status_base: Base status register address. + * @mask_base: Base mask register address. + * @ack_base: Base ack address. If zero then the chip is clear on read. + * + * @num_regs: Number of registers in each control bank. + * @irqs: Descriptors for individual IRQs. Interrupt numbers are + * assigned based on the index in the array of the interrupt. + * @num_irqs: Number of descriptors. + */ +struct regmap_irq_chip { + const char *name; + + unsigned int status_base; + unsigned int mask_base; + unsigned int ack_base; + + int num_regs; + + const struct regmap_irq *irqs; + int num_irqs; +}; + +struct regmap_irq_chip_data; + +int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, + int irq_base, struct regmap_irq_chip *chip, + struct regmap_irq_chip_data **data); +void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); +int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); + #endif |