From patchwork Fri Oct 13 15:49:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 825526 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-gpio-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="LaRDtSW0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yDBy31Jqwz9t2V for ; Sat, 14 Oct 2017 02:50:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758407AbdJMPuU (ORCPT ); Fri, 13 Oct 2017 11:50:20 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:45495 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758670AbdJMPts (ORCPT ); Fri, 13 Oct 2017 11:49:48 -0400 Received: by mail-qt0-f195.google.com with SMTP id p1so20391996qtg.2; Fri, 13 Oct 2017 08:49:48 -0700 (PDT) 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=IA/0E7GlLRqcE4J3VHssn4WDLM8ZqHUboAk0kliX1WQ=; b=LaRDtSW05tYit2fG/R4b1goQgJwjglEIG5kXKIqU6h+1LLEoKdgt3NCBaDlbTGDZwm ClHzKT7OoNgqfoBPWPIi73l7O97JHIu9HN+ZDNcoRVuqgf/SeT/ZOJXKK9n+/de49BQ+ EGRp2wq2ucb3e204tmpgMkdKAjxsGUQSBmWSq7WmzM+8k74/JJNAd5KWxCOaKs9SbUgv Lx6oWQ24wDnQIsPot+idv2rwuRcSHzaNDwSZGTfl6h0Zysw4CYmAE2gAPCRZNn8k8EyN YuoTNDh4nr0QwKwT8onsFspzw91U9Qq6+D5xLY154Y2iIMmn15ccpY0JgrkQX5rATx9T IwTw== 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=IA/0E7GlLRqcE4J3VHssn4WDLM8ZqHUboAk0kliX1WQ=; b=ZRCeMwE9P6HRSH6jQGIDmOFqvsTBoWMT7t7zl9Z5r3Td4MSSte9e8IxcanwoNB//mc gdzGeMOj3/Px1XB2u5+FAdDlDKhJCNfhWIMMSHclx1l2XdEhZPArAY6KDBjNJthoT+c2 RLmMaRQYV0vWE7a8+cH5J6+dvdjpvi8F1uQmKSYjo/SI0iEyYh0W2qzwCXIPKWOM5Nny HBeNWA5niq1V8rgrKqsFabTudxWn7ZR1QkdWdsXiX/5vOA/4dXZSsR+WTXjdra2GxmaO 0Z9aZLk/NfmRjv6J+8f4BffqcEY+w7eABV2sDR/pSJcNEJVmg0YoXyF7nDfTcWzmMLRE vPIg== X-Gm-Message-State: AMCzsaUVF5ai+7VBUpg3z69+RhFSbfNLwFHhUQ9I27ocOGAnhtzwDowf KEhLnWJClrQ7IckbIxKxUhQ= X-Google-Smtp-Source: AOwi7QCwx3K7a+Z6bE4rlC5MxG7SyHiLDUPsTic4wd58oq0qaJJ8x/XFsjvTTo50hvkQIIfrn3X1TA== X-Received: by 10.200.49.195 with SMTP id i3mr2582924qte.104.1507909787863; Fri, 13 Oct 2017 08:49:47 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id m5sm688427qkd.97.2017.10.13.08.49.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 08:49:47 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Jonathan Hunter , Grygorii Strashko , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 12/13] gpio: Export gpiochip_irq_{map,unmap}() Date: Fri, 13 Oct 2017 17:49:12 +0200 Message-Id: <20171013154913.29448-13-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013154913.29448-1-thierry.reding@gmail.com> References: <20171013154913.29448-1-thierry.reding@gmail.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 672b61024413..c7d0637569d1 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1632,8 +1632,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; @@ -1661,8 +1661,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; @@ -1671,6 +1672,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 6e344ddd4df5..c453e0716228 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -370,6 +370,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,