diff options
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 19 | ||||
-rw-r--r-- | include/linux/regmap.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 5b6b1d8e6cc0..5972ad958544 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c | |||
@@ -458,3 +458,22 @@ int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq) | |||
458 | return irq_create_mapping(data->domain, irq); | 458 | return irq_create_mapping(data->domain, irq); |
459 | } | 459 | } |
460 | EXPORT_SYMBOL_GPL(regmap_irq_get_virq); | 460 | EXPORT_SYMBOL_GPL(regmap_irq_get_virq); |
461 | |||
462 | /** | ||
463 | * regmap_irq_get_domain(): Retrieve the irq_domain for the chip | ||
464 | * | ||
465 | * Useful for drivers to request their own IRQs and for integration | ||
466 | * with subsystems. For ease of integration NULL is accepted as a | ||
467 | * domain, allowing devices to just call this even if no domain is | ||
468 | * allocated. | ||
469 | * | ||
470 | * @data: regmap_irq controller to operate on. | ||
471 | */ | ||
472 | struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data) | ||
473 | { | ||
474 | if (data) | ||
475 | return data->domain; | ||
476 | else | ||
477 | return NULL; | ||
478 | } | ||
479 | EXPORT_SYMBOL_GPL(regmap_irq_get_domain); | ||
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index e3bcc3f4dcb8..b9e99799965d 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -19,6 +19,7 @@ | |||
19 | struct module; | 19 | struct module; |
20 | struct device; | 20 | struct device; |
21 | struct i2c_client; | 21 | struct i2c_client; |
22 | struct irq_domain; | ||
22 | struct spi_device; | 23 | struct spi_device; |
23 | struct regmap; | 24 | struct regmap; |
24 | struct regmap_range_cfg; | 25 | struct regmap_range_cfg; |
@@ -317,6 +318,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, | |||
317 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); | 318 | void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); |
318 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); | 319 | int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); |
319 | int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); | 320 | int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); |
321 | struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); | ||
320 | 322 | ||
321 | #else | 323 | #else |
322 | 324 | ||