From patchwork Tue Nov 7 18:15:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 835405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IdX3lx3D"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWd2K2rTPz9sQl for ; Wed, 8 Nov 2017 05:17:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757468AbdKGSRb (ORCPT ); Tue, 7 Nov 2017 13:17:31 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:56793 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755709AbdKGSQT (ORCPT ); Tue, 7 Nov 2017 13:16:19 -0500 Received: by mail-wm0-f66.google.com with SMTP id z3so5820453wme.5; Tue, 07 Nov 2017 10:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m4lJJJd6I4GVozBi5ps0NyK1StdLDXNiXaWdOuJ3uc0=; b=IdX3lx3D7TTFG9xHimwOaDBe8ne+HpWN5hxBmnzj4mh1042BQJVh+pcQYRK2eWJ5w/ iYe8TPo/shZChJL3cCyJCZpLGvrLMtt0dywHm04H+s62xWG8J3khXu0b48CR2ffjgovQ Kno2hfPFvM9MJOXcbMGoz9WjrOsmKwc71Ns6csfkkVFiWtsRoBH70ToR/5W9O2lz80Jr EUk+QNUapxoo3INAifX3O4Zf8Npub1OLZD1cEm8mGJw91GJRbMCu+Zp9oyD52FkWiAmH N/ZgOA7Wimg5I06RMsjy3RQFS13Y3jY2+k5//h1OT6rn/OtfgwiYwtmNqBFehz8ngRUT uPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=m4lJJJd6I4GVozBi5ps0NyK1StdLDXNiXaWdOuJ3uc0=; b=Bi4E6f6vFogsvwynWmksOuqjbSikWUmGtbwuAeORLjV6eIgzxZh9mS4nzL+bFstGZs nU3ipBuWhRvQHz7S3tA6kDLuivdWuH8aNWmlqbhRWHEQXLL9MUdD+LFfPrLlTXEfP0BF KgWE+HlvPxdI3slYWUMN3DUowhioKBvK1S1pZ5+409fxHH+jiufCaCxVeOA7KPGykXdX 3js05dZm5s96TmVyhN14JtAKglZVF6B7T6heVKN+h7oMz+o9OZfRrNykAz6M0ub7IWR9 7JbNsNVjtPTp4N4mRaI3HFFCG2mw/Nb5wKJf+/IkmGCPyFk3lctSdK0p5DzojYGP6X/o oZvg== X-Gm-Message-State: AJaThX4o4mC0IDIK8SBKIJ1cAiRuZY/iRAtG0VF4QqITmC8ysfbq3o++ 6WrrL4oDoKKnYS1eUpE8mlKmwg== X-Google-Smtp-Source: ABhQp+TrJkb9qWo2NxIiUtFUuR2aQ7M5QkLhvN4TvkSJMu0gAY6SfJgoEm459Zo0sshZlfZCbcU/PA== X-Received: by 10.28.13.15 with SMTP id 15mr55981wmn.72.1510078578129; Tue, 07 Nov 2017 10:16:18 -0800 (PST) Received: from localhost (p200300E41BC8E9001FF851737372D2C2.dip0.t-ipconnect.de. [2003:e4:1bc8:e900:1ff8:5173:7372:d2c2]) by smtp.gmail.com with ESMTPSA id 128sm2470447wmi.28.2017.11.07.10.16.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:16:17 -0800 (PST) From: Thierry Reding To: Linus Walleij , Grygorii Strashko Cc: Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 11/15] gpio: Export gpiochip_irq_{map,unmap}() Date: Tue, 7 Nov 2017 19:15:55 +0100 Message-Id: <20171107181559.6318-12-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107181559.6318-1-thierry.reding@gmail.com> References: <20171107181559.6318-1-thierry.reding@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Export these functions so that drivers can explicitly use these when setting up their IRQ domain. Signed-off-by: Thierry Reding --- drivers/gpio/gpiolib.c | 8 +++++--- include/linux/gpio/driver.h | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index d809d9e7df0f..f4b30883eefc 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1638,8 +1638,8 @@ EXPORT_SYMBOL_GPL(gpiochip_set_nested_irqchip); * gpiochip by assigning the gpiochip as chip data, and using the irqchip * stored inside the gpiochip. */ -static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, - irq_hw_number_t hwirq) +int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hwirq) { struct gpio_chip *chip = d->host_data; int err = 0; @@ -1676,8 +1676,9 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, return 0; } +EXPORT_SYMBOL_GPL(gpiochip_irq_map); -static void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq) +void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq) { struct gpio_chip *chip = d->host_data; @@ -1686,6 +1687,7 @@ static void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq) irq_set_chip_and_handler(irq, NULL, NULL); irq_set_chip_data(irq, NULL); } +EXPORT_SYMBOL_GPL(gpiochip_irq_unmap); static const struct irq_domain_ops gpiochip_domain_ops = { .map = gpiochip_irq_map, diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index fbfcff676b05..ebc1a02c989a 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -368,6 +368,10 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev, #ifdef CONFIG_GPIOLIB_IRQCHIP +int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, + irq_hw_number_t hwirq); +void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq); + void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, struct irq_chip *irqchip, unsigned int parent_irq,