From patchwork Thu Jan 14 12:16:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 8031311 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 886A29F32E for ; Thu, 14 Jan 2016 12:19:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9783C20430 for ; Thu, 14 Jan 2016 12:19:14 +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 A2A022042B for ; Thu, 14 Jan 2016 12:19:13 +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 1aJgqZ-0005AK-0j; Thu, 14 Jan 2016 12:17:47 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aJgq1-0004Qo-CS for linux-arm-kernel@lists.infradead.org; Thu, 14 Jan 2016 12:17:16 +0000 Received: by mail-wm0-x243.google.com with SMTP id f206so43115726wmf.2 for ; Thu, 14 Jan 2016 04:16:55 -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=gHZFSfSKmsufC/n4UAiAGxk20PADNPdYZt2Hyiendko=; b=GHZdSDjb8vuh5+LHR0B+rU91E9hpSDEGynSLQ3XIZHdHd+0nRhW2FNT5E+Saev8WPe YxweLQq62qu0dZnr++tV9itYeVjq1C0RPxNqWpuzH7dvYuoLkgl614KUB/5KZRYf97nO xJ2ud+tfUZlyccnSZC/YNxTQikKEc/Nm3Rhx23ID7/E26O2UZO7ogdsIRJ/M9k6THjs6 n7Kdq9FyXqDKO218CcQ9FQ23iVZx5TkeCRzYfOA+Z5shxfRxodTF4oP8ziIH3MqwdJN9 VAwScegLDwauXJUgdN8wq8jBSyVgMwoCGwwVE7QhK97e/QZkpaV/KZZZy0xztz5oEqF/ PTTg== 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=gHZFSfSKmsufC/n4UAiAGxk20PADNPdYZt2Hyiendko=; b=iqityCgWmDeCpTTAoI/q8K4Ij8s50NXMQ1eDiNZpVflTQk0cbEs4aMSDTgIu23MWs3 ddqRxFUJwpVpiUnPxToBPIStIIFIsJcrM1Aa/fqC6ftk9zi9LkMiI3sr8d5kQoEVA4Y3 ymLUNv0OPuoqfk2iD39VPkj6GdE+L+OA8XyfQcQMDKyTuphbhSbsDPgmvI9vz/lZQMQX drelm9RxkCNGwaaZRK3zUg2EAJyXIP/GOFW5V2E/Ns/PKVrMh/i94n2HfaCx0Su1iwWp plBstOM3oHhkFAUgQdRUzYYLU7bNXR9ogGHSZD0Dp/1kxx8LVg9rF8s6JG91YhGiY2WM 1RAw== X-Gm-Message-State: ALoCoQm4p768Gl8C4ISWLV9vHMdOZaAJvOn1Vd/fJt7wW/mDpo3Wr+fdX2fpKg5QRePCLhM4AwAjlDAZpJk7c4NkfNElHHSnMA== X-Received: by 10.28.134.147 with SMTP id i141mr4786276wmd.87.1452773814646; Thu, 14 Jan 2016 04:16:54 -0800 (PST) Received: from lmecul0520.st.com. (101.204.154.77.rev.sfr.net. [77.154.204.101]) by smtp.gmail.com with ESMTPSA id t9sm5822917wjf.33.2016.01.14.04.16.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 04:16:54 -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 v4 2/9] Documentation: dt-bindings: Document STM32 pinctrl driver DT bindings Date: Thu, 14 Jan 2016 13:16:28 +0100 Message-Id: <1452773795-24216-3-git-send-email-mcoquelin.stm32@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452773795-24216-1-git-send-email-mcoquelin.stm32@gmail.com> References: <1452773795-24216-1-git-send-email-mcoquelin.stm32@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160114_041713_783798_9D0A8436 X-CRM114-Status: GOOD ( 16.48 ) 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.1 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 Signed-off-by: Maxime Coquelin Acked-by: Rob Herring --- .../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"; +};