regmap: Add irq_base accessor to regmap_irq
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Dec 2011 16:10:15 +0000 (16:10 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Dec 2011 16:13:31 +0000 (16:13 +0000)
Allows devices to discover their own interrupt without having to remember
it themselves.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-irq.c
include/linux/regmap.h

index 6b8a74c3ed18f29f81a0621be2fe95d2a5b48777..428836fc58356e8857ada8029e6d2df5cf1e63b9 100644 (file)
@@ -287,3 +287,16 @@ void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
        kfree(d);
 }
 EXPORT_SYMBOL_GPL(regmap_del_irq_chip);
+
+/**
+ * regmap_irq_chip_get_base(): Retrieve interrupt base for a regmap IRQ chip
+ *
+ * Useful for drivers to request their own IRQs.
+ *
+ * @data: regmap_irq controller to operate on.
+ */
+int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data)
+{
+       return data->irq_base;
+}
+EXPORT_SYMBOL_GPL(regmap_irq_chip_get_base);
index bd54cecdfdf8fb935a7af0d5ef568ca4f8de8689..e7e8953e8c2a459d1126305cc7b324a212ef4398 100644 (file)
@@ -190,5 +190,6 @@ 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