From patchwork Tue Dec 5 14:46:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 120664 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5839001qgn; Tue, 5 Dec 2017 06:50:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMa4YmQOwomL8QaSHbMBau+9ZXy8jPsH3ekSs1eBUc4aq73yCqcBXkkSmk/HlKv6IIS5f/PN X-Received: by 10.159.207.139 with SMTP id z11mr6000801plo.432.1512485457331; Tue, 05 Dec 2017 06:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512485457; cv=none; d=google.com; s=arc-20160816; b=F5g/ibSNo+4b5/EsPPjiubiNbEeOTKlW4dq05y1OTyE4RQ2PfSDv8/2xn2jWr2nfgm LlEJtAQhl9k7EjJBo9SkXELi+TH4Lz2F6HnIRh51zHmNJV/rFMLRiNPSPmCeylQXyjOz kCR3u0/nrRUotwNFaKUq4MXBWb5NoJ/M4YHkhQv2Nccxa6uDG/c1lIyEc3iNSAIjUA9I dHqjxNsLRLYO/o2jlWxqxj8qKj0oDOnHcz0v2vbBq1P1FhVsHmwLZSKjDwQeJsH1uAnB 4hrYkCRH/29/Ensljhtm5mOmVT4xLF/S9eOVtwCFrF4jlUWZJJ1NTUQVy9wIU4Ya2ncW VspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5anXhM6EIyZGKbJNw/mirt2DyrFtyObDdPJOKsW0Fds=; b=KXyzvqoDk3K4F8tJekVd4HV09KdeWlLDlYEzsmkqwSqNJSzPMm7yIyK1tS5a0DXIob /CHCopUPJRg6MAN4Lg4V/4mVGdAtP2RoHQGnV9zPmcYPJLbRw/1zaA6Lj8m1B5M6qcYt VsZH8RfRIHl9zvpfaqZBgCurDvq1Q/rB2llwb+OHhqyh94G7hqB2xgj38eG8/VT07nDS vH446TT7cXzTBBx0QhE9vDZbN6nWAGlxr7lJa6KxAqikVne1i/ARdkWA7TU3f2HoJbNx Y21DkvcvPxIOPNHJU9dmD46UFhdr3ClZ5MNLAXVPU4D/00jjmpVIUvuPBQTm/wF2hZtO ETww== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si181101pgf.275.2017.12.05.06.50.57; Tue, 05 Dec 2017 06: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbdLEOuy (ORCPT + 28 others); Tue, 5 Dec 2017 09:50:54 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:54798 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673AbdLEOsg (ORCPT ); Tue, 5 Dec 2017 09:48:36 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 818F220758; Tue, 5 Dec 2017 15:48:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 2E82F2055D; Tue, 5 Dec 2017 15:48:34 +0100 (CET) From: Quentin Schulz To: linus.walleij@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, Quentin Schulz Subject: [PATCH v5 4/9] dt-bindings: gpio: gpio-axp209: add pinctrl features Date: Tue, 5 Dec 2017 15:46:42 +0100 Message-Id: <20171205144647.17594-5-quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171205144647.17594-1-quentin.schulz@free-electrons.com> References: <20171205144647.17594-1-quentin.schulz@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The X-Powers AXP209 has 3 GPIOs. GPIO0/1 can each act either as a GPIO, an ADC or a LDO regulator. GPIO2 can only act as a GPIO. This adds the pinctrl features to the driver so GPIO0/1 can be used as ADC or LDO regulator. Signed-off-by: Quentin Schulz Acked-by: Rob Herring Acked-by: Maxime Ripard --- .../devicetree/bindings/gpio/gpio-axp209.txt | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/Documentation/devicetree/bindings/gpio/gpio-axp209.txt b/Documentation/devicetree/bindings/gpio/gpio-axp209.txt index a6611304dd3c..0d77597c3f92 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-axp209.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-axp209.txt @@ -1,8 +1,13 @@ -AXP209 GPIO controller +AXP209 GPIO & pinctrl controller This driver follows the usual GPIO bindings found in Documentation/devicetree/bindings/gpio/gpio.txt +This driver follows the usual pinctrl bindings found in +Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt + +This driver employs the per-pin muxing pattern. + Required properties: - compatible: Should be "x-powers,axp209-gpio" - #gpio-cells: Should be two. The first cell is the pin number and the @@ -28,3 +33,32 @@ axp209: pmic@34 { #gpio-cells = <2>; }; }; + +The GPIOs can be muxed to other functions and therefore, must be a subnode of +axp_gpio. + +Example: + +&axp_gpio { + gpio0_adc: gpio0-adc { + pins = "GPIO0"; + function = "adc"; + }; +}; + +&example_node { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_adc>; +}; + +GPIOs and their functions +------------------------- + +Each GPIO is independent from the other (i.e. GPIO0 in gpio_in function does +not force GPIO1 and GPIO2 to be in gpio_in function as well). + +GPIO | Functions +------------------------ +GPIO0 | gpio_in, gpio_out, ldo, adc +GPIO1 | gpio_in, gpio_out, ldo, adc +GPIO2 | gpio_in, gpio_out