aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-02-10 03:59:50 -0500
committerMark Brown <broonie@kernel.org>2016-03-05 00:32:27 -0500
commit045b98480cbe9d8dfe80983013591769f8a112cc (patch)
treee657e3858d6bb9d621a7828ad3a1e3e886e24757 /include/linux/regmap.h
parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
regmap: irq: add devm apis for regmap_{add,del}_irq_chip
Add device managed APIs for regmap_add_irq_chip() and regmap_del_irq_chip() so that it can be managed by device framework for freeing it. This helps on following: 1. Maintaining the sequence of resource allocation and deallocation regmap_add_irq_chip(&d); devm_requested_threaded_irq(virq) On free path: regmap_del_irq_chip(d); and then removing the irq registration. On this case, regmap irq is deleted before the irq is free. This force to use normal irq registration. By using devm apis, the sequence can be maintain properly: devm_regmap_add_irq_chip(&d); devm_requested_threaded_irq(virq); and resource deallocation will be done in reverse order by device framework. 2. No need to delete the regmap_irq_chip in error path or remove callback and hence there is less code on this path. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 18394343f489..de428962bfe6 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -868,6 +868,14 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
868 int irq_base, const struct regmap_irq_chip *chip, 868 int irq_base, const struct regmap_irq_chip *chip,
869 struct regmap_irq_chip_data **data); 869 struct regmap_irq_chip_data **data);
870void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 870void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
871
872int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq,
873 int irq_flags, int irq_base,
874 const struct regmap_irq_chip *chip,
875 struct regmap_irq_chip_data **data);
876void devm_regmap_del_irq_chip(struct device *dev, int irq,
877 struct regmap_irq_chip_data *data);
878
871int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 879int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
872int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); 880int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq);
873struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); 881struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data);