Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: pinctrl: convert qcom,mdm9615-pinctrl.txt to dt-schema

Convert the MDM9515 pinctrl bindings to dt-schema.
Keep the parsing of pin configuration subnodes consistent with other Qualcomm
schemas (children named with '-state' suffix, optional children with '-pins').

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221005-mdm9615-pinctrl-yaml-v2-1-639fe67a04be@linaro.org
[krzk: drop function from required]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

authored by

Neil Armstrong and committed by
Krzysztof Kozlowski
19f7ad36 0eaaf138

+119 -161
-161
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.txt
··· 1 - Qualcomm MDM9615 TLMM block 2 - 3 - This binding describes the Top Level Mode Multiplexer block found in the 4 - MDM9615 platform. 5 - 6 - - compatible: 7 - Usage: required 8 - Value type: <string> 9 - Definition: must be "qcom,mdm9615-pinctrl" 10 - 11 - - reg: 12 - Usage: required 13 - Value type: <prop-encoded-array> 14 - Definition: the base address and size of the TLMM register space. 15 - 16 - - interrupts: 17 - Usage: required 18 - Value type: <prop-encoded-array> 19 - Definition: should specify the TLMM summary IRQ. 20 - 21 - - interrupt-controller: 22 - Usage: required 23 - Value type: <none> 24 - Definition: identifies this node as an interrupt controller 25 - 26 - - #interrupt-cells: 27 - Usage: required 28 - Value type: <u32> 29 - Definition: must be 2. Specifying the pin number and flags, as defined 30 - in <dt-bindings/interrupt-controller/irq.h> 31 - 32 - - gpio-controller: 33 - Usage: required 34 - Value type: <none> 35 - Definition: identifies this node as a gpio controller 36 - 37 - - #gpio-cells: 38 - Usage: required 39 - Value type: <u32> 40 - Definition: must be 2. Specifying the pin number and flags, as defined 41 - in <dt-bindings/gpio/gpio.h> 42 - 43 - - gpio-ranges: 44 - Usage: required 45 - Definition: see ../gpio/gpio.txt 46 - 47 - - gpio-reserved-ranges: 48 - Usage: optional 49 - Definition: see ../gpio/gpio.txt 50 - 51 - Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 52 - a general description of GPIO and interrupt bindings. 53 - 54 - Please refer to pinctrl-bindings.txt in this directory for details of the 55 - common pinctrl bindings used by client devices, including the meaning of the 56 - phrase "pin configuration node". 57 - 58 - The pin configuration nodes act as a container for an arbitrary number of 59 - subnodes. Each of these subnodes represents some desired configuration for a 60 - pin, a group, or a list of pins or groups. This configuration can include the 61 - mux function to select on those pin(s)/group(s), and various pin configuration 62 - parameters, such as pull-up, drive strength, etc. 63 - 64 - 65 - PIN CONFIGURATION NODES: 66 - 67 - The name of each subnode is not important; all subnodes should be enumerated 68 - and processed purely based on their content. 69 - 70 - Each subnode only affects those parameters that are explicitly listed. In 71 - other words, a subnode that lists a mux function but no pin configuration 72 - parameters implies no information about any pin configuration parameters. 73 - Similarly, a pin subnode that describes a pullup parameter implies no 74 - information about e.g. the mux function. 75 - 76 - 77 - The following generic properties as defined in pinctrl-bindings.txt are valid 78 - to specify in a pin configuration subnode: 79 - 80 - - pins: 81 - Usage: required 82 - Value type: <string-array> 83 - Definition: List of gpio pins affected by the properties specified in 84 - this subnode. Valid pins are: 85 - gpio0-gpio87 86 - 87 - - function: 88 - Usage: required 89 - Value type: <string> 90 - Definition: Specify the alternative function to be configured for the 91 - specified pins. 92 - Valid values are: 93 - gpio, gsbi2_i2c, gsbi3, gsbi4, gsbi5_i2c, gsbi5_uart, 94 - sdc2, ebi2_lcdc, ps_hold, prim_audio, sec_audio, 95 - cdc_mclk 96 - 97 - - bias-disable: 98 - Usage: optional 99 - Value type: <none> 100 - Definition: The specified pins should be configured as no pull. 101 - 102 - - bias-pull-down: 103 - Usage: optional 104 - Value type: <none> 105 - Definition: The specified pins should be configured as pull down. 106 - 107 - - bias-pull-up: 108 - Usage: optional 109 - Value type: <none> 110 - Definition: The specified pins should be configured as pull up. 111 - 112 - - output-high: 113 - Usage: optional 114 - Value type: <none> 115 - Definition: The specified pins are configured in output mode, driven 116 - high. 117 - 118 - - output-low: 119 - Usage: optional 120 - Value type: <none> 121 - Definition: The specified pins are configured in output mode, driven 122 - low. 123 - 124 - - drive-strength: 125 - Usage: optional 126 - Value type: <u32> 127 - Definition: Selects the drive strength for the specified pins, in mA. 128 - Valid values are: 2, 4, 6, 8, 10, 12, 14 and 16 129 - 130 - Example: 131 - 132 - msmgpio: pinctrl@800000 { 133 - compatible = "qcom,mdm9615-pinctrl"; 134 - reg = <0x800000 0x4000>; 135 - 136 - gpio-controller; 137 - #gpio-cells = <2>; 138 - gpio-ranges = <&msmgpio 0 0 88>; 139 - interrupt-controller; 140 - #interrupt-cells = <2>; 141 - interrupts = <0 16 0x4>; 142 - 143 - gsbi8_uart: gsbi8-uart { 144 - mux { 145 - pins = "gpio34", "gpio35"; 146 - function = "gsbi8"; 147 - }; 148 - 149 - tx { 150 - pins = "gpio34"; 151 - drive-strength = <4>; 152 - bias-disable; 153 - }; 154 - 155 - rx { 156 - pins = "gpio35"; 157 - drive-strength = <2>; 158 - bias-pull-up; 159 - }; 160 - }; 161 - };
+119
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pinctrl/qcom,mdm9615-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm Technologies, Inc. MDM9615 TLMM block 8 + 9 + maintainers: 10 + - Bjorn Andersson <andersson@kernel.org> 11 + 12 + description: Top Level Mode Multiplexer pin controller in Qualcomm MDM9615 SoC. 13 + 14 + $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 15 + 16 + properties: 17 + compatible: 18 + const: qcom,mdm9615-pinctrl 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: true 24 + interrupt-controller: true 25 + '#interrupt-cells': true 26 + gpio-controller: true 27 + '#gpio-cells': true 28 + gpio-ranges: true 29 + 30 + required: 31 + - compatible 32 + - reg 33 + 34 + additionalProperties: false 35 + 36 + patternProperties: 37 + "-state$": 38 + oneOf: 39 + - $ref: "#/$defs/qcom-mdm9615-pinctrl-state" 40 + - patternProperties: 41 + "-pins$": 42 + $ref: "#/$defs/qcom-mdm9615-pinctrl-state" 43 + additionalProperties: false 44 + 45 + $defs: 46 + qcom-mdm9615-pinctrl-state: 47 + type: object 48 + description: 49 + Pinctrl node's client devices use subnodes for desired pin configuration. 50 + Client device subnodes use below standard properties. 51 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 52 + 53 + properties: 54 + pins: 55 + description: 56 + List of gpio pins affected by the properties specified in this 57 + subnode. 58 + items: 59 + pattern: "^gpio([0-9]|[1-7][0-9]|8[0-7])$" 60 + minItems: 1 61 + maxItems: 16 62 + 63 + function: 64 + description: 65 + Specify the alternative function to be configured for the specified 66 + pins. 67 + 68 + enum: [ gpio, gsbi2_i2c, gsbi3, gsbi4, gsbi5_i2c, gsbi5_uart, 69 + sdc2, ebi2_lcdc, ps_hold, prim_audio, sec_audio, cdc_mclk, ] 70 + 71 + bias-disable: true 72 + bias-pull-down: true 73 + bias-pull-up: true 74 + drive-strength: true 75 + output-high: true 76 + output-low: true 77 + input-enable: true 78 + 79 + required: 80 + - pins 81 + 82 + additionalProperties: false 83 + 84 + examples: 85 + - | 86 + #include <dt-bindings/interrupt-controller/arm-gic.h> 87 + tlmm: pinctrl@1000000 { 88 + compatible = "qcom,mdm9615-pinctrl"; 89 + reg = <0x01000000 0x300000>; 90 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 91 + gpio-controller; 92 + gpio-ranges = <&msmgpio 0 0 88>; 93 + #gpio-cells = <2>; 94 + interrupt-controller; 95 + #interrupt-cells = <2>; 96 + 97 + gsbi3-state { 98 + pins = "gpio8", "gpio9", "gpio10", "gpio11"; 99 + function = "gsbi3"; 100 + drive-strength = <8>; 101 + bias-disable; 102 + }; 103 + 104 + gsbi5-i2c-state { 105 + sda-pins { 106 + pins = "gpio16"; 107 + function = "gsbi5_i2c"; 108 + drive-strength = <8>; 109 + bias-disable; 110 + }; 111 + 112 + scl-pins { 113 + pins = "gpio17"; 114 + function = "gsbi5_i2c"; 115 + drive-strength = <2>; 116 + bias-disable; 117 + }; 118 + }; 119 + };