From patchwork Wed Feb 3 11:04:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 8200451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 062A29F6DA for ; Wed, 3 Feb 2016 11:07:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED8BD20221 for ; Wed, 3 Feb 2016 11:07:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 027A2201C0 for ; Wed, 3 Feb 2016 11:07:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQvFo-0000Zy-7j; Wed, 03 Feb 2016 11:05:44 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQvFO-0007cO-Gi for linux-arm-kernel@lists.infradead.org; Wed, 03 Feb 2016 11:05:21 +0000 Received: by mail-wm0-x244.google.com with SMTP id 128so6821083wmz.3 for ; Wed, 03 Feb 2016 03:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CAw3efKJmac2ClDlMHuPbk3vnr8B7enksH95ZLu1B+A=; b=B44UllNljCNwFQy4mV73kPgY8dzHxiOxJ1qGSp9vrI2BokzgU/Id5zw/Edwjh3ZhuU RoShKxpAaXS1wOHof25lomg2y3aiJlpPkVIAUZYFtBphpyj23onJV0pmepVPjnmxQMXf UTN8UIy3fOvbt1S0eQKqm+vMoTXNE0Ey39KT4vxb+M5XQsMTXPNMJkuGEV8Y5NhfbtnB ND5mzVCbI5wOR271M9gGHBjMWKaV4k8ESsqCWQ2auQTHrIKWFHnDg2Q8ULyvsapKzLJX tqmO3bd1a4BaRE8K2wm34YWjOQCVuDIRIP9crFq82xo6xlZj6WF0SXWnEOkXC2F4OznF F47A== 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=CAw3efKJmac2ClDlMHuPbk3vnr8B7enksH95ZLu1B+A=; b=fCeR3spO5n4HosvJd0rMAzB2M3+tL1z50N877UPeDh3D0reutrv6Ym5WcTn8Gm8BEj jL68e5mfGNwWrmFBFLoR6XaPOsECZOUc6CuocM9+TSvhdfmBlNpx9nFwB7cS9s4FPGy4 D+vVfDG+FL68rRHhe5J0XRAyNLOdI9WNEo1KIAiQxQ7263yUJx++ovkJ40MODSfmiCE3 ZQevd1D9MypMVNqok25c7PSn53wJGdnWL5fFkqCT/eTt0O5jkCnmWK+T4yAwYIQrBmFP ZHkGPiArE1dqcw4AQ7Cy8pq0Z1LtMHlzuLoD6oQRplVWEuy7ImhQisejzzNcSEMUFuAO P8dQ== X-Gm-Message-State: AG10YOSNS2PY2vZM9P0iH9jWj4FCGDCx3rTeFqS3qBhTI1hfvG2ozZcvDhYO5mXBtawK5g== X-Received: by 10.28.182.133 with SMTP id g127mr22673262wmf.61.1454497496858; Wed, 03 Feb 2016 03:04:56 -0800 (PST) Received: from lmecul0520.st.com. (238.204.154.77.rev.sfr.net. [77.154.204.238]) by smtp.gmail.com with ESMTPSA id p9sm5911996wjy.41.2016.02.03.03.04.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Feb 2016 03:04:56 -0800 (PST) From: Maxime Coquelin To: patrice.chotard@st.com, Linus Walleij , Mark Rutland , Rob Herring , linux-gpio@vger.kernel.org, arnd@arndb.de Subject: [PATCH v5 2/9] Documentation: dt-bindings: Document STM32 pinctrl driver DT bindings Date: Wed, 3 Feb 2016 12:04:38 +0100 Message-Id: <1454497485-464-3-git-send-email-mcoquelin.stm32@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454497485-464-1-git-send-email-mcoquelin.stm32@gmail.com> References: <1454497485-464-1-git-send-email-mcoquelin.stm32@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160203_030518_916804_F3B54764 X-CRM114-Status: GOOD ( 16.90 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Daniel Thompson , bruherrera@gmail.com, linux-kernel@vger.kernel.org, afaerber@suse.de, 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Acked-by: Patrice Chotard Acked-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Maxime Coquelin --- .../bindings/pinctrl/st,stm32-pinctrl.txt | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt new file mode 100644 index 0000000..7b4800c --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt @@ -0,0 +1,126 @@ +* STM32 GPIO and Pin Mux/Config controller + +STMicroelectronics's STM32 MCUs intregrate a GPIO and Pin mux/config hardware +controller. It controls the input/output settings on the available pins and +also provides ability to multiplex and configure the output of various on-chip +controllers onto these pads. + +Pin controller node: +Required properies: + - compatible: value should be one of the following: + (a) "st,stm32f429-pinctrl" + - #address-cells: The value of this property must be 1 + - #size-cells : The value of this property must be 1 + - ranges : defines mapping between pin controller node (parent) to + gpio-bank node (children). + - pins-are-numbered: Specify the subnodes are using numbered pinmux to + specify pins. + +GPIO controller/bank node: +Required properties: + - gpio-controller : Indicates this device is a GPIO controller + - #gpio-cells : Should be two. + The first cell is the pin number + The second one is the polarity: + - 0 for active high + - 1 for active low + - reg : The gpio address range, relative to the pinctrl range + - clocks : clock that drives this bank + - st,bank-name : Should be a name string for this bank as specified in + the datasheet + +Optional properties: + - reset: : Reference to the reset controller + +Example: +#include +... + + pin-controller { + #address-cells = <1>; + #size-cells = <1>; + compatible = "st,stm32f429-pinctrl"; + ranges = <0 0x40020000 0x3000>; + pins-are-numbered; + + gpioa: gpio@40020000 { + gpio-controller; + #gpio-cells = <2>; + reg = <0x0 0x400>; + resets = <&reset_ahb1 0>; + st,bank-name = "GPIOA"; + }; + ... + pin-functions nodes follow... + }; + +Contents of function subnode node: +---------------------------------- +Subnode format +A pinctrl node should contain at least one subnode representing the +pinctrl group available on the machine. Each subnode will list the +pins it needs, and how they should be configured, with regard to muxer +configuration, pullups, drive, output high/low and output speed. + + node { + pinmux = ; + GENERIC_PINCONFIG; + }; + +Required properties: +- pinmux: integer array, represents gpio pin number and mux setting. + Supported pin number and mux varies for different SoCs, and are defined in + dt-bindings/pinctrl/-pinfunc.h directly. + These defines are calculated as: + ((port * 16 + line) << 8) | function + With: + - port: The gpio port index (PA = 0, PB = 1, ..., PK = 11) + - line: The line offset within the port (PA0 = 0, PA1 = 1, ..., PA15 = 15) + - function: The function number, can be: + * 0 : GPIO + * 1 : Alternate Function 0 + * 2 : Alternate Function 1 + * 3 : Alternate Function 2 + * ... + * 16 : Alternate Function 15 + * 17 : Analog + +Optional properties: +- GENERIC_PINCONFIG: is the generic pinconfig options to use. + Available options are: + - bias-disable, + - bias-pull-down, + - bias-pull-up, + - drive-push-pull, + - drive-open-drain, + - output-low + - output-high + - slew-rate = , with x being: + < 0 > : Low speed + < 1 > : Medium speed + < 2 > : Fast speed + < 3 > : High speed + +Example: + +pin-controller { +... + usart1_pins_a: usart1@0 { + pins1 { + pinmux = ; + bias-disable; + drive-push-pull; + slew-rate = <0>; + }; + pins2 { + pinmux = ; + bias-disable; + }; + }; +}; + +&usart1 { + pinctrl-0 = <&usart1_pins_a>; + pinctrl-names = "default"; + status = "okay"; +};