From patchwork Thu Nov 2 17:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 833451 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="b4UblWG9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ySXhC6C3gz9sNV for ; Fri, 3 Nov 2017 04:51:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933129AbdKBRvX (ORCPT ); Thu, 2 Nov 2017 13:51:23 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:53870 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934182AbdKBRuC (ORCPT ); Thu, 2 Nov 2017 13:50:02 -0400 Received: by mail-wr0-f193.google.com with SMTP id u40so316088wrf.10; Thu, 02 Nov 2017 10:50:01 -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=aE5PD7/zl2xSwR6TB+40FN+h/+9xvulorb+Dbo2OYxk=; b=b4UblWG9+JbH0RHD1f03SGJhsM19bBxKd9QIKsh8ptr+xYRhjAYHUyMnFB0YL3mbcS RIdIcxmzCGQL9ZPzZHnWBuYfYCO8RAwNNSFflsqpREcjOESagBcbP7Tt8f6qe/g2dl99 kEsRT4TTgEO3KGVgYK0YeZMEi/G/UeabpmMM374qNRA16zDXHVglzp8WTffe2prZUem+ Vg7/6oSvyAVZmBRzioLpD0R/CsuyVnKmYaNnKEkDk6vz0g2VHO2ruwBN1yy0Bi/9fyUL 8E2/gCOeKLzw+UFr+F1xPdMguADv7tyv37vnd/jc0i6nArFudjANAxKqCQgzFlYe33BI 2kWQ== 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=aE5PD7/zl2xSwR6TB+40FN+h/+9xvulorb+Dbo2OYxk=; b=VLSPQrrv+ea03yAhWK4E/UNY1dtKWADrwjQhobapWjSTn1K7NHJB8Nz9sXo+zWPfzo XdcWOWBa9mOdslK8ZeeRxwly8Mpal8ArwSaZndxVI+q9BYZwMbyWbhoWqLT9tByihodI FJkC8tVrCNsi2PAFl9Ac66mUK/ZPBOM/buAjARM0tr0SpwGC8xO+H5MPunoTySEKuDQU SvSb0XUZQZahoiGXKO1iJbKCHVX7r2oFyPUzwRmpVf0y10FlfTqhKhZAW4Pt+LZBUjX/ zvds0CFFNRMtrYC1slzmmvbV6mX0UENGpyeMONOsJI0ar0BuM0w9RQTU0acIuPKjOq90 zZLQ== X-Gm-Message-State: AMCzsaX4O0Z1PNJ0SlfSUIqv9B05Rj+jzi4lhd1nTMBpdr8m0e7KcwUT LuYAjCVkmjE89Nl6Zsn2SdvfAQ== X-Google-Smtp-Source: ABhQp+Q/vGyCYl37kUGy5uY9YQ7iCYdDiwhS99J/csk4vt+9ZQcvQksNeCSi+CQbph/t3Y1mVbLN2A== X-Received: by 10.223.176.57 with SMTP id f54mr4076322wra.126.1509645000709; Thu, 02 Nov 2017 10:50:00 -0700 (PDT) Received: from localhost (p200300E41BC8E9001FF851737372D2C2.dip0.t-ipconnect.de. [2003:e4:1bc8:e900:1ff8:5173:7372:d2c2]) by smtp.gmail.com with ESMTPSA id 50sm3488410wry.84.2017.11.02.10.49.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Nov 2017 10:50:00 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Grygorii Strashko , Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 11/12] gpio: Export gpiochip_irq_{map,unmap}() Date: Thu, 2 Nov 2017 18:49:40 +0100 Message-Id: <20171102174941.3461-12-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171102174941.3461-1-thierry.reding@gmail.com> References: <20171102174941.3461-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 5bc99d08d538..c65322532906 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; @@ -1667,8 +1667,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; @@ -1677,6 +1678,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 51fc7b023364..bbe5c647f29d 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -367,6 +367,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,