From patchwork Thu Nov 24 10:25:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9445143 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 4C4E660235 for ; Thu, 24 Nov 2016 10:28:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FE62279E0 for ; Thu, 24 Nov 2016 10:28:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4301227C7A; Thu, 24 Nov 2016 10:28:27 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3F801279E0 for ; Thu, 24 Nov 2016 10:28:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9rF0-00016h-Ra; Thu, 24 Nov 2016 10:26:54 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9rE5-0000gv-TW for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2016 10:26:00 +0000 Received: by mail-pf0-x22e.google.com with SMTP id 189so9568110pfz.3 for ; Thu, 24 Nov 2016 02:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SM/Awc3NBpIMsr6BoLf49Vd1h6/CwgdgsJ0JbaeTF6k=; b=PBQbHvdjgJaxLc0sHNFiGXaaBL2MRBcsAHZlA7dVpDWWXtovkg9rHZA8LQfMua5sqJ 2DNCLNlNMKfE8yd5FhSa+0HK0I9FTWVX1HUGYmamsGfz9FL6FPpd2sApg649YvQDGc8G OLABk64dD05qnM53eHBsyJ3bIVxdxEgcxQibY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SM/Awc3NBpIMsr6BoLf49Vd1h6/CwgdgsJ0JbaeTF6k=; b=S8hxG1phlTv3vrcpKS1v5hzA7vcNr1jneIbaPgccGXns45x6/Dza6q5kUmZHzm8wfK ZEIm3l9zkTPJQKDHG0YsC6iODFRiVDD6AdewOVzPzwXxgh8i8G+DO2w02X+S1y1GZ9bK WAAQh3Wn9Y4IydVc12tymUREeaY1x1inK+WkKHbwdOjR+k/s40RLrroJalXSnzbVXtsQ nfbAJG0Vg4/ORDOw28hFUBI5oPhYYORog1rVv62k0tdCRDNT1zeqPd9yJy8x6wYbkAMW Uad4j0o+dnRMowV6/evAW/C6vooWgrOVZ5a+OxISsGL1rKiytmVpuHUm+EXEkhYzfGZo GnAw== X-Gm-Message-State: AKaTC01RMfIBF/9uXfQbNb+tACzgEzbxFf0gdNObfK/a81cy8msaEFXFPfqrqBTr25IGlISA X-Received: by 10.84.137.1 with SMTP id 1mr3820227plm.8.1479983137051; Thu, 24 Nov 2016 02:25:37 -0800 (PST) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id x26sm38694248pge.24.2016.11.24.02.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Nov 2016 02:25:36 -0800 (PST) From: Stephen Boyd To: Rob Herring , Frank Rowand Subject: [PATCH 3/3] gpio: Support gpio nexus dt bindings Date: Thu, 24 Nov 2016 02:25:29 -0800 Message-Id: <20161124102529.20212-4-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20161124102529.20212-1-stephen.boyd@linaro.org> References: <20161124102529.20212-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161124_022558_082325_5122F6F5 X-CRM114-Status: GOOD ( 11.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Linus Walleij , Pantelis Antoniou , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Mark Brown , 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 Platforms like 96boards have a standardized connector/expansion slot that exposes signals like GPIOs to expansion boards in an SoC agnostic way. We'd like the DT overlays for the expansion boards to be written once without knowledge of the SoC on the other side of the connector. This avoids the unscalable combinatorial explosion of a different DT overlay for each expansion board and SoC pair. Now that we have nexus support in the OF core let's change the function call here that parses the phandle lists of gpios to use the nexus variant. This allows us to remap phandles and their arguments through any number of nexus nodes and end up with the actual gpio provider being used. Cc: Pantelis Antoniou Cc: Linus Walleij Cc: Mark Brown Signed-off-by: Stephen Boyd --- TODO: Document gpio-map and gpio-map-mask in GPIO devicetree binding drivers/gpio/gpiolib-of.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index ecad3f0e3b77..3117397c4c41 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -71,8 +71,9 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, struct gpio_desc *desc; int ret; - ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index, - &gpiospec); + ret = of_parse_phandle_with_args_map(np, propname, "#gpio-cells", + "gpio-map", "gpio-map-mask", + index, &gpiospec); if (ret) { pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n", __func__, propname, np->full_name, index);