From patchwork Mon Jan 23 20:48:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9533431 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 D3A99604A2 for ; Mon, 23 Jan 2017 20:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C630628375 for ; Mon, 23 Jan 2017 20:51:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9611283FD; Mon, 23 Jan 2017 20:51:57 +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=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no 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 7CD9528375 for ; Mon, 23 Jan 2017 20:51:57 +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 1cVlak-0007CL-RJ; Mon, 23 Jan 2017 20:51:54 +0000 Received: from mail-pg0-f53.google.com ([74.125.83.53]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVlZC-0004m0-Kc for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2017 20:50:20 +0000 Received: by mail-pg0-f53.google.com with SMTP id 204so47879806pge.0 for ; Mon, 23 Jan 2017 12:49:57 -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=jN9uW6vO7fZgpUrj/RYCqT5gzW41hafz/MKcIK4IrVY=; b=F+iU4jAaHiikxvp5neoKdfO5JeP7Xs6MSjzQA2BR56fV8OzdTjeRaDgRSqhB3IS1tK XxKELwvVApc+1nozDomQiPllAZ2w7LrpPmxIGeBY7h8fdWA2Bvzjbry2udOf2XGo67Ej w2moRdRC/BNdPdqai9P/R965rerJzd+mnvrQ8= 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=jN9uW6vO7fZgpUrj/RYCqT5gzW41hafz/MKcIK4IrVY=; b=qYbkxPiGb04sU31APKdeLViw3ybnYhqYYsE7jcBT0/zhtNoejEfen1e/b39uiCu+nr MwVoLYUmyL/hkFWrcyGrSVS92crgKrJPnehs0PAPMqmrfokp+nVuIpqbHAM1lCmhIwPC QVG9wVpR/kxCB7LPqzAqJdstaW8iVpmOT1F7T6Chjm5k5/lsHodVchvxguCKdRIQdC2O Yt1Y9QKd5ZfHavzl9Qor45HyR731P0rJBVpfMA0jiZTkOP8mmSyNF36p0VnHccX72xl6 FKrrZqQCDieDPhsLuzb4XqX5YJ/lvfKisY8BPyAGz4WAUgtWqR3pZSjsBeH5XJzSrdwL 0WMA== X-Gm-Message-State: AIkVDXLPXTDaChPBpG3jkCEHkUdQ3ke5jvPeAvOV7o7sFRGbXyiSz1DrQG3k/4XIutFVaxjX X-Received: by 10.98.152.218 with SMTP id d87mr33824265pfk.17.1485204536659; Mon, 23 Jan 2017 12:48:56 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id l12sm38935728pfj.37.2017.01.23.12.48.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 12:48:56 -0800 (PST) From: Stephen Boyd To: Rob Herring , Frank Rowand Subject: [PATCH v3 3/3] gpio: Support gpio nexus dt bindings Date: Mon, 23 Jan 2017 12:48:51 -0800 Message-Id: <20170123204851.12808-4-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20170123204851.12808-1-stephen.boyd@linaro.org> References: <20170123204851.12808-1-stephen.boyd@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_125018_741209_6F6E8D01 X-CRM114-Status: GOOD ( 11.76 ) 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, 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 Acked-by: Linus Walleij Cc: Mark Brown Signed-off-by: Stephen Boyd --- 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);