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: 91722 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp773249qgi; Tue, 17 Jan 2017 16:50:57 -0800 (PST) X-Received: by 10.84.193.131 with SMTP id f3mr871140pld.26.1484700657300; Tue, 17 Jan 2017 16:50:57 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k73si26531077pge.47.2017.01.17.16.50.57; Tue, 17 Jan 2017 16:50:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751858AbdARAuz (ORCPT + 25 others); Tue, 17 Jan 2017 19:50:55 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33065 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbdARAuw (ORCPT ); Tue, 17 Jan 2017 19:50:52 -0500 Received: by mail-pf0-f175.google.com with SMTP id y143so66028977pfb.0 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=NHEB5fs5m/ww/Wu0eqP+Q/+OiiW9i4KEVrCO7rrqWdoc1/m4T+voVMfj7CSa7PRfdE 4Z0oa7atGZsd470PI2ma7PSDCPOBC6AtEwc5/6GWzAnORCdiSRYosvPjOU78MO6VMfLH 6T91qw/Kfoku3JjkrFR4aDimymKEo4S57bYksYWtMcjZczPJ1No0X6yt/5GbOBechFdY zZ5R+E3jBsUzb+lSshCMFWNNWKAN5XjS8wLKRlfGF7aNWD4/WI8U2ODx1KYPnlDrflDr sAIZsTUNTjph2Dh2HFTNQN+Y3DJ71/AV9yerf0mcnNEuUStNNGJ9nbH5QNNMNrZ9kwf4 SHCQ== X-Gm-Message-State: AIkVDXIkxJqP8lABRA2627atzgYm5goz154B+zRtzDYY2Qb33sWXAVv2+4571Q56ychdGG0w 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, Pantelis Antoniou , Linus Walleij , Mark Brown 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpio/gpiolib-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.10.0.297.gf6727b0 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);