diff options
| author | Alexandre TORGUE <alexandre.torgue@st.com> | 2017-01-27 11:15:16 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2017-02-06 03:47:17 -0500 |
| commit | d4168be73c8fdc3e9cdc61aa4b513e6c9b7bcf10 (patch) | |
| tree | eb35d9d6250d59bf1f54c58b73144ef496f3a587 | |
| parent | 117bd6e842a8d52e48f0d18be260a05bf96dc854 (diff) | |
pinctrl: Amend bindings for STM32 pinctrl
Adds "ngpios" and "gpio-ranges" bindings definition.
Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt index 620c09b3d801..eac20aa33907 100644 --- a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt | |||
| @@ -38,8 +38,23 @@ Optional properties: | |||
| 38 | - st,syscfg: Should be phandle/offset pair. The phandle to the syscon node | 38 | - st,syscfg: Should be phandle/offset pair. The phandle to the syscon node |
| 39 | which includes IRQ mux selection register, and the offset of the IRQ mux | 39 | which includes IRQ mux selection register, and the offset of the IRQ mux |
| 40 | selection register. | 40 | selection register. |
| 41 | - ngpios: Number of gpios in a bank (to use if bank gpio numbers is less | ||
| 42 | than 16). | ||
| 43 | - gpio-ranges: Define a dedicated mapping between a pin-controller and | ||
| 44 | a gpio controller. Format is <&phandle a b c> with: | ||
| 45 | -(phandle): phandle of pin-controller. | ||
| 46 | -(a): gpio base offset in range. | ||
| 47 | -(b): pin base offset in range. | ||
| 48 | -(c): gpio count in range | ||
| 49 | This entry has to be used either if there are holes inside a bank: | ||
| 50 | GPIOB0/B1/B2/B14/B15 (see example 2) | ||
| 51 | or if banks are not contiguous: | ||
| 52 | GPIOA/B/C/E... | ||
| 53 | NOTE: If "gpio-ranges" is used for a gpio controller, all gpio-controller | ||
| 54 | have to use a "gpio-ranges" entry. | ||
| 55 | More details in Documentation/devicetree/bindings/gpio/gpio.txt. | ||
| 41 | 56 | ||
| 42 | Example: | 57 | Example 1: |
| 43 | #include <dt-bindings/pinctrl/stm32f429-pinfunc.h> | 58 | #include <dt-bindings/pinctrl/stm32f429-pinfunc.h> |
| 44 | ... | 59 | ... |
| 45 | 60 | ||
| @@ -61,6 +76,43 @@ Example: | |||
| 61 | pin-functions nodes follow... | 76 | pin-functions nodes follow... |
| 62 | }; | 77 | }; |
| 63 | 78 | ||
| 79 | Example 2: | ||
| 80 | #include <dt-bindings/pinctrl/stm32f429-pinfunc.h> | ||
| 81 | ... | ||
| 82 | |||
| 83 | pinctrl: pin-controller { | ||
| 84 | #address-cells = <1>; | ||
| 85 | #size-cells = <1>; | ||
| 86 | compatible = "st,stm32f429-pinctrl"; | ||
| 87 | ranges = <0 0x40020000 0x3000>; | ||
| 88 | pins-are-numbered; | ||
| 89 | |||
| 90 | gpioa: gpio@40020000 { | ||
| 91 | gpio-controller; | ||
| 92 | #gpio-cells = <2>; | ||
| 93 | reg = <0x0 0x400>; | ||
| 94 | resets = <&reset_ahb1 0>; | ||
| 95 | st,bank-name = "GPIOA"; | ||
| 96 | gpio-ranges = <&pinctrl 0 0 16>; | ||
| 97 | }; | ||
| 98 | |||
| 99 | gpiob: gpio@40020400 { | ||
| 100 | gpio-controller; | ||
| 101 | #gpio-cells = <2>; | ||
| 102 | reg = <0x0 0x400>; | ||
| 103 | resets = <&reset_ahb1 0>; | ||
| 104 | st,bank-name = "GPIOB"; | ||
| 105 | ngpios = 4; | ||
| 106 | gpio-ranges = <&pinctrl 0 16 3>, | ||
| 107 | <&pinctrl 14 30 2>; | ||
| 108 | }; | ||
| 109 | |||
| 110 | |||
| 111 | ... | ||
| 112 | pin-functions nodes follow... | ||
| 113 | }; | ||
| 114 | |||
| 115 | |||
| 64 | Contents of function subnode node: | 116 | Contents of function subnode node: |
| 65 | ---------------------------------- | 117 | ---------------------------------- |
| 66 | Subnode format | 118 | Subnode format |
