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,msm8960-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm MSM8960 TLMM pin controller
8
9maintainers:
10  - Bjorn Andersson <andersson@kernel.org>
11  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
12
13description:
14  Top Level Mode Multiplexer pin controller in Qualcomm MSM8960 SoC.
15
16properties:
17  compatible:
18    const: qcom,msm8960-pinctrl
19
20  reg:
21    maxItems: 1
22
23  interrupts:
24    maxItems: 1
25
26  interrupt-controller: true
27  "#interrupt-cells": true
28  gpio-controller: true
29  "#gpio-cells": true
30  gpio-ranges: true
31  wakeup-parent: true
32
33  gpio-reserved-ranges:
34    minItems: 1
35    maxItems: 76
36
37  gpio-line-names:
38    maxItems: 152
39
40patternProperties:
41  "-state$":
42    oneOf:
43      - $ref: "#/$defs/qcom-msm8960-tlmm-state"
44      - patternProperties:
45          "-pins$":
46            $ref: "#/$defs/qcom-msm8960-tlmm-state"
47        additionalProperties: false
48
49$defs:
50  qcom-msm8960-tlmm-state:
51    type: object
52    description:
53      Pinctrl node's client devices use subnodes for desired pin configuration.
54      Client device subnodes use below standard properties.
55    $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
56    unevaluatedProperties: false
57
58    properties:
59      pins:
60        description:
61          List of gpio pins affected by the properties specified in this
62          subnode.
63        items:
64          oneOf:
65            - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-1])$"
66            - enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc3_clk, sdc3_cmd,
67                      sdc3_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
76        enum: [ gpio, audio_pcm, bt, cam_mclk0, cam_mclk1, cam_mclk2,
77                codec_mic_i2s, codec_spkr_i2s, ext_gps, fm, gps_blanking,
78                gps_pps_in, gps_pps_out, gp_clk_0a, gp_clk_0b, gp_clk_1a,
79                gp_clk_1b, gp_clk_2a, gp_clk_2b, gp_mn, gp_pdm_0a, gp_pdm_0b,
80                gp_pdm_1a, gp_pdm_1b, gp_pdm_2a, gp_pdm_2b, gsbi1,
81                gsbi1_spi_cs1_n, gsbi1_spi_cs2a_n, gsbi1_spi_cs2b_n,
82                gsbi1_spi_cs3_n, gsbi2, gsbi2_spi_cs1_n, gsbi2_spi_cs2_n,
83                gsbi2_spi_cs3_n, gsbi3, gsbi4, gsbi4_3d_cam_i2c_l,
84                gsbi4_3d_cam_i2c_r, gsbi5, gsbi5_3d_cam_i2c_l,
85                gsbi5_3d_cam_i2c_r, gsbi6, gsbi7, gsbi8, gsbi9, gsbi10, gsbi11,
86                gsbi11_spi_cs1a_n, gsbi11_spi_cs1b_n, gsbi11_spi_cs2a_n,
87                gsbi11_spi_cs2b_n, gsbi11_spi_cs3_n, gsbi12, hdmi_cec,
88                hdmi_ddc_clock, hdmi_ddc_data, hdmi_hot_plug_detect, hsic,
89                mdp_vsync, mi2s, mic_i2s, pmb_clk, pmb_ext_ctrl, ps_hold,
90                rpm_wdog, sdc2, sdc4, sdc5, slimbus1, slimbus2, spkr_i2s,
91                ssbi1, ssbi2, ssbi_ext_gps, ssbi_pmic2, ssbi_qpa1, ssbi_ts,
92                tsif1, tsif2, ts_eoc, usb_fs1, usb_fs1_oe, usb_fs1_oe_n,
93                usb_fs2, usb_fs2_oe, usb_fs2_oe_n, vfe_camif_timer1_a,
94                vfe_camif_timer1_b, vfe_camif_timer2, vfe_camif_timer3_a,
95                vfe_camif_timer3_b, vfe_camif_timer4_a, vfe_camif_timer4_b,
96                vfe_camif_timer4_c, vfe_camif_timer5_a, vfe_camif_timer5_b,
97                vfe_camif_timer6_a, vfe_camif_timer6_b, vfe_camif_timer6_c,
98                vfe_camif_timer7_a, vfe_camif_timer7_b, vfe_camif_timer7_c,
99                wlan ]
100
101    required:
102      - pins
103
104allOf:
105  - $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
106
107required:
108  - compatible
109  - reg
110
111additionalProperties: false
112
113examples:
114  - |
115    #include <dt-bindings/interrupt-controller/arm-gic.h>
116
117    msmgpio: pinctrl@800000 {
118        compatible = "qcom,msm8960-pinctrl";
119        reg = <0x800000 0x4000>;
120        #gpio-cells = <2>;
121        gpio-controller;
122        gpio-ranges = <&msmgpio 0 0 152>;
123        interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
124        interrupt-controller;
125        #interrupt-cells = <2>;
126
127        spi1-default-state {
128            mosi-pins {
129                pins = "gpio6";
130                function = "gsbi1";
131                drive-strength = <12>;
132                bias-disable;
133            };
134
135            miso-pins {
136                pins = "gpio7";
137                function = "gsbi1";
138                drive-strength = <12>;
139                bias-disable;
140            };
141
142            cs-pins {
143                pins = "gpio8";
144                function = "gpio";
145                drive-strength = <12>;
146                bias-disable;
147                output-low;
148            };
149
150            clk-pins {
151                pins = "gpio9";
152                function = "gsbi1";
153                drive-strength = <12>;
154                bias-disable;
155            };
156        };
157    };
158