From patchwork Wed Jan 10 01:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10153795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0755160223 for ; Wed, 10 Jan 2018 01:59:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDAE0201B0 for ; Wed, 10 Jan 2018 01:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2064212E8; Wed, 10 Jan 2018 01:59:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3BC40212DB for ; Wed, 10 Jan 2018 01:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8Xzd4D3/gpsOWGUyp0eiQCwgK2kp7McisXg/fgS6HWI=; b=UFTroyJBKFmnZ83/a0AlU49HbV vEG8nyhThOj6VDF8BIVmUVAlpsWp53Zsr+N7qR6ydBl86of5fUrU+C4IFK9KvbP649yBvMasD7zG3 0rcQeNRxcBvCtD1UvzWSAmZRPR+LysPwl8GgQTFd41Aa/SeGp2gcfqG2UFsph2JsNPFWY1Sd4/6/d fIU0ViOBpprAmpy7rnHWn+QDtTl4EbfckZA1AqMiekbjKHlxS6n2b8EBflPn5PyuL02ehaejy0kYt OSnhkKc877322341NQgCiD56eupA+ZLExIzVXITfZGhC0yV6zYWb4e/MCbUTqAU8ZwO4pn9rB/5ML UcSBcUvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZ5fy-0003YZ-34; Wed, 10 Jan 2018 01:59:34 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZ5fQ-0002vj-MM for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2018 01:59:04 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C73EA60BE2; Wed, 10 Jan 2018 01:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1515549530; bh=CojsltZld/h7GpOu9RfUgbhCR8H/Uj7UBu0Wkdy1YLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CFTvQAEgZPeqXjhcBGQnOJHOnWqQ5uqR6SgR8uda9tX21il+DmtUHbwq+o/kANmDv gcbB9cWG0Kr73T3MpzoTOh8J63LucmurPZiUORPCyYu16F16bJNjxzZYjtZwLSu56Z zqPHFgUFYMddOpF251cmmtXLc3w5m3Cr7Nuyz2hY= Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BAD2B60B1B; Wed, 10 Jan 2018 01:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1515549530; bh=CojsltZld/h7GpOu9RfUgbhCR8H/Uj7UBu0Wkdy1YLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CFTvQAEgZPeqXjhcBGQnOJHOnWqQ5uqR6SgR8uda9tX21il+DmtUHbwq+o/kANmDv gcbB9cWG0Kr73T3MpzoTOh8J63LucmurPZiUORPCyYu16F16bJNjxzZYjtZwLSu56Z zqPHFgUFYMddOpF251cmmtXLc3w5m3Cr7Nuyz2hY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BAD2B60B1B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Linus Walleij Subject: [PATCH 1/3] gpiolib: Export gpiochip_irqchip_irq_valid() to drivers Date: Tue, 9 Jan 2018 17:58:46 -0800 Message-Id: <20180110015848.11480-2-sboyd@codeaurora.org> X-Mailer: git-send-email 2.15.0.374.g5f9953d2c365 In-Reply-To: <20180110015848.11480-1-sboyd@codeaurora.org> References: <20180110015848.11480-1-sboyd@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180109_175900_797962_1F9E234D X-CRM114-Status: GOOD ( 12.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Timur Tabi , linux-kernel@vger.kernel.org, Bjorn Andersson , linux-gpio@vger.kernel.org, Andy Shevchenko , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some pinctrl drivers can use the gpiochip irq valid information to figure out if certain gpios are exposed to the kernel for usage or not. Expose this API so we can use it in the pinmux_ops::request ops. Signed-off-by: Stephen Boyd Acked-by: Bjorn Andersson --- drivers/gpio/gpiolib.c | 5 +++-- include/linux/gpio/driver.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b80936a25caa..c18b7b60ea1d 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1503,14 +1503,15 @@ static void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip) gpiochip->irq.valid_mask = NULL; } -static bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip, - unsigned int offset) +bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip, + unsigned int offset) { /* No mask means all valid */ if (likely(!gpiochip->irq.valid_mask)) return true; return test_bit(offset, gpiochip->irq.valid_mask); } +EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid); /** * gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 7258cd676df4..1ba9a331ec51 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -436,6 +436,9 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, struct lock_class_key *lock_key, struct lock_class_key *request_key); +bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gpiochip, + unsigned int offset); + #ifdef CONFIG_LOCKDEP /*