diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-20 16:45:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-10-14 20:49:23 -0400 |
commit | 90f790d2dc96f5a61855ae65b90e30c40c893a20 (patch) | |
tree | 5d88bc300043bf8a9925569b43f4686961bcd4c2 /drivers | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
regmap: irq: Allow users to retrieve the irq_domain
This is useful for integration with other subsystems, especially MFD,
and provides an alternative API for users that request their own IRQs.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 19 |
1 files changed, 19 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); | ||