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: 83850 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp65704qgi; Thu, 24 Nov 2016 02:26:50 -0800 (PST) X-Received: by 10.84.218.6 with SMTP id q6mr3772213pli.139.1479983210547; Thu, 24 Nov 2016 02:26:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si26705178pgk.62.2016.11.24.02.26.50; Thu, 24 Nov 2016 02:26:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936175AbcKXK0f (ORCPT + 4 others); Thu, 24 Nov 2016 05:26:35 -0500 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34201 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938654AbcKXKZi (ORCPT ); Thu, 24 Nov 2016 05:25:38 -0500 Received: by mail-pf0-f177.google.com with SMTP id c4so9591284pfb.1 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=eEOKcOPjtdxdF88yGRbbxcedcu5I74Wkl2e06cYjsrH2BhB6b5wUD2plESsJR9+uJ0 uX/kzWVBx8xF3uCgB2TgT9c024oN0qlCiZHpOE/hGOYmRQ+dtjVuH7XTIz7dJDHSB4Ys NqXDsSOtuFaUZNdDHyxijSB/lb9DYKgczZuCzH1aJUDKixNVMvxIvTQ9+Tl51uBtrNfI SFAzcb0q7VMP+fGVGjNEfd4Y0xmKEOFKdvs3CPqKt1GvkYM8QWU7Eo0U8abNH6owqh+h DzNi7RQnOnbhEKZj6WNQqI4OTQnwWXwzMv3nhTWsdRNUkVu6E5fT/3kUUfSkDiOD10jP aVNw== X-Gm-Message-State: AKaTC02BFIQfmKS/5D794JE1UQhrkrgeUVBO0gJfbIaN8RC5Fibo7C0Vk6P1qgiJGmT2Lfo/ 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 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 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> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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 --- 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(-) -- 2.10.0.297.gf6727b0 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);