From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbcBFOtR (ORCPT ); Sat, 6 Feb 2016 09:49:17 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:2978 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbcBFOtK (ORCPT ); Sat, 6 Feb 2016 09:49:10 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Sat, 06 Feb 2016 06:48:51 -0800 From: Laxman Dewangan To: , , , , , , CC: , , , Laxman Dewangan Subject: [PATCH V4 1/6] regmap: irq: add apis to unmap the mapped irq Date: Sat, 6 Feb 2016 20:07:22 +0530 Message-ID: <1454769447-785-2-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454769447-785-1-git-send-email-ldewangan@nvidia.com> References: <1454769447-785-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before removing irq domains, it is require to unmap all mapped interrupt from that domain. Currently there is API to map the interrupt on chip as regmap_irq_get_virq() for creating mapping. Add equivalent API to dispose the mapped irq in irq domains. Signed-off-by: Laxman Dewangan CC: Krzysztof Kozlowski CC: Javier Martinez Canillas --- This is new in the series which was identified when testing V3 series that it is require to unmap virq before deleting irq chip domain. Adding this APIs in regmap irq framework. drivers/base/regmap/regmap-irq.c | 14 ++++++++++++++ include/linux/regmap.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 9b0d202..9b36fc8 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -707,6 +707,20 @@ int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq) EXPORT_SYMBOL_GPL(regmap_irq_get_virq); /** + * regmap_irq_put_virq(): Unmap mapped interrupt of a chip in irq-domain. + * + * This routine is used to dispose the created mapping from irq domain + * which must be call before removing irq domain. + * + * @irq: virtual irq number which was mapped with irq domains. + */ +void regmap_irq_put_virq(int virq) +{ + irq_dispose_mapping(virq); +} +EXPORT_SYMBOL_GPL(regmap_irq_put_virq); + +/** * regmap_irq_get_domain(): Retrieve the irq_domain for the chip * * Useful for drivers to request their own IRQs and for integration diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 27aaac9..546eab5 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -870,6 +870,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); +void regmap_irq_put_virq(int virq); struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data); #else -- 2.1.4