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: 577826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8E94D140328 for ; Wed, 3 Feb 2016 22:07:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=B44UllNl; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753497AbcBCLFB (ORCPT ); Wed, 3 Feb 2016 06:05:01 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32886 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035AbcBCLE6 (ORCPT ); Wed, 3 Feb 2016 06:04:58 -0500 Received: by mail-wm0-f66.google.com with SMTP id r129so6828680wmr.0; 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=hpwrHxhuezABxEj1lcVTp/aZGSnCtJZZu1Q47a3ZTGWqYQ1xO8/nSY2CUPgm4pHzx/ etIJZtDtlCyrHjQW9Ohha4nJJ6McTE0TpMjzbuJdGMqlYJCi5sXnhYNshvFv5xibPs5H 6HZv4xI+IocQ0EkIb+OtFyUtQ2btxE9ggpJW02SE6VWacZ9e8Rai+14ObptCMvKKZiA0 EFOrb5i2DfcLE06HBJaiyvAQuYuP3JrxFGcJjJ1TyJIN+kn+maLsIpTE/D0tfgMyuEP1 uHaJOsJqL2gxB2uT1gw4JENvluqsiZhcy/x19jepu1AjrrfQ/51mFOgNHNAvUgmcWYEC K2gg== X-Gm-Message-State: AG10YOTx1ZrFUL+n+sMd9dp3rGS3Z337grvYtgme7VkpRCG1HOn0TVh2R8Jf04J9adeO7A== 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, afaerber@suse.de, devicetree@vger.kernel.org, Daniel Thompson , bruherrera@gmail.com 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> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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"; +};