From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFC7DC433F5 for ; Wed, 23 Feb 2022 15:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GAdyFYb4fwRaolfZHjBw5rwPjnWw1iiBWClCqsKp1/Y=; b=yG7Am5hzUG4TXm noohtZe3KwB9ICvuJvw5tGi6V6dow6f2gJuPF57TCqe6tHmJ+dtXpfg1kqaYon16r+7POQN2I7D4V dcceOXWwDz9ja6RNDNNjHko944UZl593K97HP6oXp6sJV0iN3OJp7e7Q2AV0PVOy0FSe0RbOe79Hc 3vD3sncl8S7KmWK7tpwOjAAs0Ew+OM3H9gx5NC/gysmdMYkGUCYwFdXE9WVeyPnOMDPkuwLmWmxjB qU1kDlMEuFtRLiseyv8giP8isbBLprtiFGGOz73bBz8wujwvB+kGWnUezoNiym463yQxt1RPVVGSv hEiDBY6lO/mWp34R9evQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMtod-00F6qC-8R; Wed, 23 Feb 2022 15:44:31 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nMtoW-00F6nf-Oz for linux-arm-kernel@lists.infradead.org; Wed, 23 Feb 2022 15:44:26 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5CAA6618C2; Wed, 23 Feb 2022 15:44:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAAE5C340F4; Wed, 23 Feb 2022 15:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645631063; bh=Qfdv6adW74CN704wOxVv3M2DoN5MT3Ou0BkWhDGVEyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPiA2G1VQMiKzHixzoxIVSA8sDLUzgBQ7SskBO4Sr51RGpDl/lqZNxmO9CvJGe50n z8ABeO1WumlYLrKX/lcRdlIh20cVGMyd4uCnCuOX2SoQyCW2t36GKA9Er/aSAsO53u 7yD5rqlSdf3zXxx6V9jsZFSBcmSOMCzs+/5cwFJJH7iF7iRRQmmzUTCA7R3c5HX+c1 XTaVLThvgFHIGJRSev/v7o+xGZbeDo7Ne/kBPQIY3NnFjBxklYVzD9tREZh0HBE780 WsXgjDUwxWxMZfnPEpF09ZkWrnhIzBgbdHFc/MwMN5V1naLh3xP6RnjoFefySWPSFj fnzIz9HDsHlNQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nMtoT-009wgt-P3; Wed, 23 Feb 2022 15:44:21 +0000 From: Marc Zyngier To: linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Thierry Reding , Joey Gouly , Jonathan Hunter , Hector Martin , Sven Peter , Alyssa Rosenzweig , Bjorn Andersson , Andy Gross , Thomas Gleixner , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com Subject: [PATCH 2/5] gpio: Expose the gpiochip_irq_re[ql]res helpers Date: Wed, 23 Feb 2022 15:44:02 +0000 Message-Id: <20220223154405.54912-3-maz@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220223154405.54912-1-maz@kernel.org> References: <20220223154405.54912-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linus.walleij@linaro.org, brgl@bgdev.pl, thierry.reding@gmail.com, joey.gouly@arm.com, jonathanh@nvidia.com, marcan@marcan.st, sven@svenpeter.dev, alyssa@rosenzweig.io, bjorn.andersson@linaro.org, agross@kernel.org, tglx@linutronix.de, linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220223_074424_939870_58D7C305 X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The GPIO subsystem has a couple of internal helpers to manage resources on behalf of the irqchip. Expose them so that GPIO drivers can use them directly. Signed-off-by: Marc Zyngier --- drivers/gpio/gpiolib.c | 6 ++++-- include/linux/gpio/driver.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 515838708b00..408ff8f262d3 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1423,19 +1423,21 @@ static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset) return irq_create_mapping(domain, offset); } -static int gpiochip_irq_reqres(struct irq_data *d) +int gpiochip_irq_reqres(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); return gpiochip_reqres_irq(gc, d->hwirq); } +EXPORT_SYMBOL(gpiochip_irq_reqres); -static void gpiochip_irq_relres(struct irq_data *d) +void gpiochip_irq_relres(struct irq_data *d) { struct gpio_chip *gc = irq_data_get_irq_chip_data(d); gpiochip_relres_irq(gc, d->hwirq); } +EXPORT_SYMBOL(gpiochip_irq_relres); static void gpiochip_irq_mask(struct irq_data *d) { diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index b0728c8ad90c..89291c02854d 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -576,6 +576,10 @@ void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset); void gpiochip_disable_irq(struct gpio_chip *gc, unsigned int offset); void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset); +/* irq_data versions of the above */ +int gpiochip_irq_reqres(struct irq_data *data); +void gpiochip_irq_relres(struct irq_data *data); + /* Line status inquiry for drivers */ bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset); bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel