From patchwork Wed Jan 18 00:50:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9522373 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 CB0306020A for ; Wed, 18 Jan 2017 00:51:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B62192855A for ; Wed, 18 Jan 2017 00:51:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAECC2856F; Wed, 18 Jan 2017 00:51:44 +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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67D252855A for ; Wed, 18 Jan 2017 00:51:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTeTW-00015n-F4; Wed, 18 Jan 2017 00:51:42 +0000 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTeSv-0008NP-6l for linux-arm-kernel@lists.infradead.org; Wed, 18 Jan 2017 00:51:06 +0000 Received: by mail-pf0-x22c.google.com with SMTP id f144so65937016pfa.2 for ; Tue, 17 Jan 2017 16:50:44 -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=/pcHVFWLYxad60OzMtW3P5A1CRBQetuYQDifULgApJY=; b=PMVI1PycEjPAep4VMbBExbBJ8AGeTg+yduJKN8kipN0fIkqA8WRIiYdbVG8Zd0g0dY NOPJ54s0jBYevQqdI5p08JPJgm999/m0krwbZXkk8QDhWrud7bvUFPOGP7AusvGW0jk4 FoTUmnkAa9V5idT9c63PxbbaBc6E9hLGBJTmw= 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=/pcHVFWLYxad60OzMtW3P5A1CRBQetuYQDifULgApJY=; b=WCGBIUvTOeHwof85w/Rb1ozg72bsWWA+TYdDaILhVLh6irCOAhSc4rHU/tSeLdt4Rl 6WnTUt18ncLYZeJendjeChE4blEVEDFPtF3Avt7kXfC6WaztmRJMk5Z2AxTM/kgTxHen LCJiZhFOxe88+dp2FfwlWySjpYcjYNUYafO5i2p3TXBsRuQxiu1goxJGDXmH6xbXyAh+ 3lN8BvzSEjzDgTrWL6Y9rZHsaZABrYw2SuJGWurXStdh/84gL5ddjZ/59hMidOy2U2qZ McbczC8qDeQdLloC14/m2lkccDx9DeJycBhzMhmVkmfj4tW5Lqe6Whbj8RM5bK4/BuCR noYA== X-Gm-Message-State: AIkVDXJETZNanePYq60zMrW46P2La19HaAX8mcTTHOf2Kvo4wJhIdScZ/FtUB+GGvxsOmvpB X-Received: by 10.99.43.136 with SMTP id r130mr624281pgr.83.1484700644389; Tue, 17 Jan 2017 16:50:44 -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 m19sm58413171pfk.72.2017.01.17.16.50.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 16:50:43 -0800 (PST) From: Stephen Boyd To: Rob Herring , Frank Rowand Subject: [PATCH v2 3/3] gpio: Support gpio nexus dt bindings Date: Tue, 17 Jan 2017 16:50:38 -0800 Message-Id: <20170118005038.9216-4-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20170118005038.9216-1-stephen.boyd@linaro.org> References: <20170118005038.9216-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170117_165105_318716_34606374 X-CRM114-Status: GOOD ( 12.24 ) 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, 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 Acked-by: Linus Walleij --- drivers/gpio/gpiolib-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 92b185f19232..17bca36d4ebb 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -75,8 +75,8 @@ 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", index, + &gpiospec); if (ret) { pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n", __func__, propname, np->full_name, index);