From 9b0a63db137e8d7124139f237b02255f436b46ef Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Tue, 20 Nov 2012 12:20:47 +0100 Subject: [PATCH] --- yaml --- r: 344969 b: refs/heads/master c: ea2590e24364a5d153464d443aa25347e5d17695 h: refs/heads/master i: 344967: 42396c243d1dec6422f44785a80ca20b221bd7ad v: v3 --- [refs] | 2 +- trunk/drivers/base/regmap/regmap-irq.c | 19 +++++++++++++++++++ trunk/include/linux/regmap.h | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 536dd43c881a..4f2bc1422cc3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fe39f2f4dc8481d3aa4561ba649b0c0a4429a49e +refs/heads/master: ea2590e24364a5d153464d443aa25347e5d17695 diff --git a/trunk/drivers/base/regmap/regmap-irq.c b/trunk/drivers/base/regmap/regmap-irq.c index 5b6b1d8e6cc0..5972ad958544 100644 --- a/trunk/drivers/base/regmap/regmap-irq.c +++ b/trunk/drivers/base/regmap/regmap-irq.c @@ -458,3 +458,22 @@ int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq) return irq_create_mapping(data->domain, irq); } EXPORT_SYMBOL_GPL(regmap_irq_get_virq); + +/** + * regmap_irq_get_domain(): Retrieve the irq_domain for the chip + * + * Useful for drivers to request their own IRQs and for integration + * with subsystems. For ease of integration NULL is accepted as a + * domain, allowing devices to just call this even if no domain is + * allocated. + * + * @data: regmap_irq controller to operate on. + */ +struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data) +{ + if (data) + return data->domain; + else + return NULL; +} +EXPORT_SYMBOL_GPL(regmap_irq_get_domain); diff --git a/trunk/include/linux/regmap.h b/trunk/include/linux/regmap.h index e3bcc3f4dcb8..b9e99799965d 100644 --- a/trunk/include/linux/regmap.h +++ b/trunk/include/linux/regmap.h @@ -19,6 +19,7 @@ struct module; struct device; struct i2c_client; +struct irq_domain; struct spi_device; struct regmap; struct regmap_range_cfg; @@ -317,6 +318,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, 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); int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); +struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); #else