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

dt-bindings: pinctrl: qcom,sdm845: convert to dtschema

Convert Qualcomm SDM845 pin controller bindings to DT schema. Keep
the parsing of pin configuration subnodes consistent with other Qualcomm
schemas (children named with '-state' suffix, their children with
'-pins').

Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220930200529.331223-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

+158 -176
-176
Documentation/devicetree/bindings/pinctrl/qcom,sdm845-pinctrl.txt
··· 1 - Qualcomm SDM845 TLMM block 2 - 3 - This binding describes the Top Level Mode Multiplexer block found in the 4 - SDM845 platform. 5 - 6 - - compatible: 7 - Usage: required 8 - Value type: <string> 9 - Definition: must be "qcom,sdm845-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 - Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 - a general description of GPIO and interrupt bindings. 45 - 46 - Please refer to pinctrl-bindings.txt in this directory for details of the 47 - common pinctrl bindings used by client devices, including the meaning of the 48 - phrase "pin configuration node". 49 - 50 - The pin configuration nodes act as a container for an arbitrary number of 51 - subnodes. Each of these subnodes represents some desired configuration for a 52 - pin, a group, or a list of pins or groups. This configuration can include the 53 - mux function to select on those pin(s)/group(s), and various pin configuration 54 - parameters, such as pull-up, drive strength, etc. 55 - 56 - 57 - PIN CONFIGURATION NODES: 58 - 59 - The name of each subnode is not important; all subnodes should be enumerated 60 - and processed purely based on their content. 61 - 62 - Each subnode only affects those parameters that are explicitly listed. In 63 - other words, a subnode that lists a mux function but no pin configuration 64 - parameters implies no information about any pin configuration parameters. 65 - Similarly, a pin subnode that describes a pullup parameter implies no 66 - information about e.g. the mux function. 67 - 68 - 69 - The following generic properties as defined in pinctrl-bindings.txt are valid 70 - to specify in a pin configuration subnode: 71 - 72 - - pins: 73 - Usage: required 74 - Value type: <string-array> 75 - Definition: List of gpio pins affected by the properties specified in 76 - this subnode. 77 - 78 - Valid pins are: 79 - gpio0-gpio149 80 - Supports mux, bias and drive-strength 81 - 82 - sdc2_clk, sdc2_cmd, sdc2_data, ufs_reset 83 - Supports bias and drive-strength 84 - 85 - - function: 86 - Usage: required 87 - Value type: <string> 88 - Definition: Specify the alternative function to be configured for the 89 - specified pins. Functions are only valid for gpio pins. 90 - Valid values are: 91 - 92 - gpio, adsp_ext, agera_pll, atest_char, atest_tsens, 93 - atest_tsens2, atest_usb1, atest_usb10, atest_usb11, 94 - atest_usb12, atest_usb13, atest_usb2, atest_usb20, 95 - atest_usb21, atest_usb22, atest_usb23, audio_ref, 96 - btfm_slimbus, cam_mclk, cci_async, cci_i2c, cci_timer0, 97 - cci_timer1, cci_timer2, cci_timer3, cci_timer4, cri_trng, 98 - cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0, 99 - ddr_pxi1, ddr_pxi2, ddr_pxi3, edp_hot, edp_lcd, gcc_gp1, 100 - gcc_gp2, gcc_gp3, jitter_bist, ldo_en, ldo_update, 101 - lpass_slimbus, m_voc, mdp_vsync, mdp_vsync0, mdp_vsync1, 102 - mdp_vsync2, mdp_vsync3, mss_lte, nav_pps, pa_indicator, 103 - pci_e0, pci_e1, phase_flag, pll_bist, pll_bypassnl, 104 - pll_reset, pri_mi2s, pri_mi2s_ws, prng_rosc, qdss_cti, 105 - qdss, qlink_enable, qlink_request, qua_mi2s, qup0, qup1, 106 - qup10, qup11, qup12, qup13, qup14, qup15, qup2, qup3, qup4, 107 - qup5, qup6, qup7, qup8, qup9, qup_l4, qup_l5, qup_l6, 108 - qspi_clk, qspi_cs, qspi_data, sd_write, sdc4_clk, sdc4_cmd, 109 - sdc4_data, sec_mi2s, sp_cmu, spkr_i2s, ter_mi2s, tgu_ch0, 110 - tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm1, tsense_pwm2, 111 - tsif1_clk, tsif1_data, tsif1_en, tsif1_error, tsif1_sync, 112 - tsif2_clk, tsif2_data, tsif2_en, tsif2_error, tsif2_sync, 113 - uim1_clk, uim1_data, uim1_present, uim1_reset, uim2_clk, 114 - uim2_data, uim2_present, uim2_reset, uim_batt, usb_phy, 115 - vfr_1, vsense_trigger, wlan1_adc0, wlan1_adc1, wlan2_adc0, 116 - wlan2_adc1, 117 - 118 - - bias-disable: 119 - Usage: optional 120 - Value type: <none> 121 - Definition: The specified pins should be configured as no pull. 122 - 123 - - bias-pull-down: 124 - Usage: optional 125 - Value type: <none> 126 - Definition: The specified pins should be configured as pull down. 127 - 128 - - bias-pull-up: 129 - Usage: optional 130 - Value type: <none> 131 - Definition: The specified pins should be configured as pull up. 132 - 133 - - output-high: 134 - Usage: optional 135 - Value type: <none> 136 - Definition: The specified pins are configured in output mode, driven 137 - high. 138 - Not valid for sdc pins. 139 - 140 - - output-low: 141 - Usage: optional 142 - Value type: <none> 143 - Definition: The specified pins are configured in output mode, driven 144 - low. 145 - Not valid for sdc pins. 146 - 147 - - drive-strength: 148 - Usage: optional 149 - Value type: <u32> 150 - Definition: Selects the drive strength for the specified pins, in mA. 151 - Valid values are: 2, 4, 6, 8, 10, 12, 14 and 16 152 - 153 - Example: 154 - 155 - tlmm: pinctrl@3400000 { 156 - compatible = "qcom,sdm845-pinctrl"; 157 - reg = <0x03400000 0xc00000>; 158 - interrupts = <GIC_SPI 208 0>; 159 - gpio-controller; 160 - #gpio-cells = <2>; 161 - interrupt-controller; 162 - #interrupt-cells = <2>; 163 - 164 - qup9_active: qup9-active { 165 - mux { 166 - pins = "gpio4", "gpio5"; 167 - function = "qup9"; 168 - }; 169 - 170 - config { 171 - pins = "gpio4", "gpio5"; 172 - drive-strength = <2>; 173 - bias-disable; 174 - }; 175 - }; 176 - };
+158
Documentation/devicetree/bindings/pinctrl/qcom,sdm845-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,sdm845-pinctrl.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm SDM845 TLMM pin controller 8 + 9 + maintainers: 10 + - Bjorn Andersson <andersson@kernel.org> 11 + - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 12 + 13 + description: 14 + Top Level Mode Multiplexer pin controller in Qualcomm SDM845 SoC. 15 + 16 + allOf: 17 + - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml# 18 + 19 + properties: 20 + compatible: 21 + const: qcom,sdm845-pinctrl 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: true 27 + interrupt-controller: true 28 + "#interrupt-cells": true 29 + gpio-controller: true 30 + 31 + gpio-reserved-ranges: 32 + minItems: 1 33 + maxItems: 75 34 + 35 + gpio-line-names: 36 + maxItems: 150 37 + 38 + "#gpio-cells": true 39 + gpio-ranges: true 40 + wakeup-parent: true 41 + 42 + patternProperties: 43 + "-state$": 44 + oneOf: 45 + - $ref: "#/$defs/qcom-sdm845-tlmm-state" 46 + - patternProperties: 47 + "-pins$": 48 + $ref: "#/$defs/qcom-sdm845-tlmm-state" 49 + additionalProperties: false 50 + 51 + $defs: 52 + qcom-sdm845-tlmm-state: 53 + type: object 54 + description: 55 + Pinctrl node's client devices use subnodes for desired pin configuration. 56 + Client device subnodes use below standard properties. 57 + $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state 58 + 59 + properties: 60 + pins: 61 + description: 62 + List of gpio pins affected by the properties specified in this 63 + subnode. 64 + items: 65 + oneOf: 66 + - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9])$" 67 + - enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ] 68 + minItems: 1 69 + maxItems: 36 70 + 71 + function: 72 + description: 73 + Specify the alternative function to be configured for the specified 74 + pins. 75 + enum: [ adsp_ext, agera_pll, atest_char, atest_tsens, atest_tsens2, 76 + atest_usb1, atest_usb10, atest_usb11, atest_usb12, atest_usb13, 77 + atest_usb2, atest_usb20, atest_usb21, atest_usb22, atest_usb23, 78 + audio_ref, btfm_slimbus, cam_mclk, cci_async, cci_i2c, 79 + cci_timer0, cci_timer1, cci_timer2, cci_timer3, cci_timer4, 80 + cri_trng, cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0, 81 + ddr_pxi1, ddr_pxi2, ddr_pxi3, edp_hot, edp_lcd, gcc_gp1, 82 + gcc_gp2, gcc_gp3, gpio, jitter_bist, ldo_en, ldo_update, 83 + lpass_slimbus, mdp_vsync, mdp_vsync0, mdp_vsync1, mdp_vsync2, 84 + mdp_vsync3, mss_lte, m_voc, nav_pps, pa_indicator, pci_e0, 85 + pci_e1, phase_flag, pll_bist, pll_bypassnl, pll_reset, 86 + pri_mi2s, pri_mi2s_ws, prng_rosc, qdss, qdss_cti, qlink_enable, 87 + qlink_request, qspi_clk, qspi_cs, qspi_data, qua_mi2s, qup0, 88 + qup1, qup10, qup11, qup12, qup13, qup14, qup15, qup2, qup3, 89 + qup4, qup5, qup6, qup7, qup8, qup9, qup_l4, qup_l5, qup_l6, 90 + sdc4_clk, sdc4_cmd, sdc4_data, sd_write, sec_mi2s, sp_cmu, 91 + spkr_i2s, ter_mi2s, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, 92 + tsense_pwm1, tsense_pwm2, tsif1_clk, tsif1_data, tsif1_en, 93 + tsif1_error, tsif1_sync, tsif2_clk, tsif2_data, tsif2_en, 94 + tsif2_error, tsif2_sync, uim1_clk, uim1_data, uim1_present, 95 + uim1_reset, uim2_clk, uim2_data, uim2_present, uim2_reset, 96 + uim_batt, usb_phy, vfr_1, vsense_trigger, wlan1_adc0, 97 + wlan1_adc1, wlan2_adc0, wlan2_adc1] 98 + 99 + bias-disable: true 100 + bias-pull-down: true 101 + bias-pull-up: true 102 + drive-strength: true 103 + input-enable: true 104 + output-high: true 105 + output-low: true 106 + 107 + required: 108 + - pins 109 + 110 + additionalProperties: false 111 + 112 + required: 113 + - compatible 114 + - reg 115 + 116 + additionalProperties: false 117 + 118 + examples: 119 + - | 120 + #include <dt-bindings/interrupt-controller/arm-gic.h> 121 + 122 + pinctrl@3400000 { 123 + compatible = "qcom,sdm845-pinctrl"; 124 + reg = <0x03400000 0xc00000>; 125 + interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 126 + gpio-controller; 127 + #gpio-cells = <2>; 128 + interrupt-controller; 129 + #interrupt-cells = <2>; 130 + gpio-ranges = <&tlmm 0 0 151>; 131 + wakeup-parent = <&pdc_intc>; 132 + 133 + cci0-default-state { 134 + pins = "gpio17", "gpio18"; 135 + function = "cci_i2c"; 136 + 137 + bias-pull-up; 138 + drive-strength = <2>; 139 + }; 140 + 141 + cam0-default-state { 142 + rst-pins { 143 + pins = "gpio9"; 144 + function = "gpio"; 145 + 146 + drive-strength = <16>; 147 + bias-disable; 148 + }; 149 + 150 + mclk0-pins { 151 + pins = "gpio13"; 152 + function = "cam_mclk"; 153 + 154 + drive-strength = <16>; 155 + bias-disable; 156 + }; 157 + }; 158 + };