xref: /linux/Documentation/devicetree/bindings/input/syna,rmi4.yaml (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/input/syna,rmi4.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Synaptics RMI4 compliant devices
8
9maintainers:
10  - Jason A. Donenfeld <Jason@zx2c4.com>
11  - Matthias Schiffer <matthias.schiffer@ew.tq-group.com
12  - Vincent Huang <vincent.huang@tw.synaptics.com>
13
14description: |
15  The Synaptics RMI4 (Register Mapped Interface 4) core is able to support RMI4
16  devices using different transports (I2C, SPI) and different functions (e.g.
17  Function 1, 2D sensors using Function 11 or 12).
18
19properties:
20  compatible:
21    enum:
22      - syna,rmi4-i2c
23      - syna,rmi4-spi
24
25  reg:
26    maxItems: 1
27
28  '#address-cells':
29    const: 1
30
31  '#size-cells':
32    const: 0
33
34  interrupts:
35    maxItems: 1
36
37  reset-gpios:
38    maxItems: 1
39    description: Active low signal
40
41  spi-cpha: true
42  spi-cpol: true
43
44  syna,reset-delay-ms:
45    description:
46      Delay to wait after resetting the device.
47
48  syna,startup-delay-ms:
49    description:
50      Delay to wait after powering on the device.
51
52  vdd-supply: true
53  vio-supply: true
54
55  rmi4-f01@1:
56    type: object
57    additionalProperties: false
58    description:
59      Function 1
60
61    properties:
62      reg:
63        maxItems: 1
64
65      syna,nosleep-mode:
66        $ref: /schemas/types.yaml#/definitions/uint32
67        enum: [0, 1, 2]
68        description:
69          If set the device will run at full power without sleeping.  nosleep
70          has 3 modes, 0 will not change the default setting, 1 will disable
71          nosleep (allow sleeping), and 2 will enable nosleep (disabling
72          sleep).
73
74      syna,wakeup-threshold:
75        $ref: /schemas/types.yaml#/definitions/uint32
76        description:
77          Defines the amplitude of the disturbance to the background
78          capacitance that will cause the device to wake from dozing.
79
80      syna,doze-holdoff-ms:
81        description:
82          The delay to wait after the last finger lift and the first doze
83          cycle.
84
85      syna,doze-interval-ms:
86        description:
87          The time period that the device sleeps between finger activity.
88
89    required:
90      - reg
91
92patternProperties:
93  "^rmi4-f1[12]@1[12]$":
94    type: object
95    unevaluatedProperties: false
96    $ref: /schemas/input/touchscreen/touchscreen.yaml#
97    description:
98      RMI4 Function 11 and Function 12 are for 2D touch position sensing.
99
100    properties:
101      reg:
102        maxItems: 1
103
104      syna,clip-x-low:
105        $ref: /schemas/types.yaml#/definitions/uint32
106        description:
107          Minimum value for X.
108
109      syna,clip-y-low:
110        $ref: /schemas/types.yaml#/definitions/uint32
111        description:
112          Minimum value for Y.
113
114      syna,clip-x-high:
115        $ref: /schemas/types.yaml#/definitions/uint32
116        description:
117          Maximum value for X.
118
119      syna,clip-y-high:
120        $ref: /schemas/types.yaml#/definitions/uint32
121        description:
122          Maximum value for Y.
123
124      syna,offset-x:
125        $ref: /schemas/types.yaml#/definitions/uint32
126        description:
127          Add an offset to X.
128
129      syna,offset-y:
130        $ref: /schemas/types.yaml#/definitions/uint32
131        description:
132          Add an offset to Y.
133
134      syna,delta-x-threshold:
135        $ref: /schemas/types.yaml#/definitions/uint32
136        description:
137          Minimum distance on the X axis required to generate an interrupt in
138          reduced reporting mode.
139
140      syna,delta-y-threshold:
141        $ref: /schemas/types.yaml#/definitions/uint32
142        description:
143          Minimum distance on the Y axis required to generate an interrupt in
144          reduced reporting mode.
145
146      syna,sensor-type:
147        $ref: /schemas/types.yaml#/definitions/uint32
148        enum: [1, 2]
149        description: |
150          Sensor type: 1 for touchscreen 2 for touchpad.
151
152      syna,disable-report-mask:
153        $ref: /schemas/types.yaml#/definitions/uint32
154        description:
155          Mask for disabling posiiton reporting. Used to disable reporing
156          absolute position data.
157
158      syna,rezero-wait-ms:
159        description:
160          Time to wait after issuing a rezero command.
161
162    required:
163      - reg
164
165  "^rmi4-f[0-9a-f]+@[0-9a-f]+$":
166    type: object
167    additionalProperties: true
168
169    description:
170      Other functions, not documented yet.
171
172    properties:
173      reg:
174        maxItems: 1
175
176    required:
177      - reg
178
179required:
180  - compatible
181  - reg
182
183unevaluatedProperties: false
184
185allOf:
186  - $ref: /schemas/spi/spi-peripheral-props.yaml#
187
188  - if:
189      properties:
190        compatible:
191          contains:
192            const: syna,rmi4-i2c
193    then:
194      properties:
195        spi-rx-delay-us: false
196        spi-tx-delay-us: false
197    else:
198      properties:
199        syna,reset-delay-ms: false
200        syna,startup-delay-ms: false
201
202examples:
203  - |
204    #include <dt-bindings/interrupt-controller/irq.h>
205
206    i2c {
207        #address-cells = <1>;
208        #size-cells = <0>;
209
210        touchscreen@20 {
211            compatible = "syna,rmi4-i2c";
212            reg = <0x20>;
213            interrupt-parent = <&gpx1>;
214            interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
215
216            syna,startup-delay-ms = <100>;
217            vdd-supply = <&tsp_vdd>;
218            vio-supply = <&ldo32_reg>;
219
220            pinctrl-0 = <&touch_irq>;
221            pinctrl-names = "default";
222            #address-cells = <1>;
223            #size-cells = <0>;
224
225            rmi4-f01@1 {
226                reg = <0x1>;
227                syna,nosleep-mode = <1>;
228            };
229
230            rmi4-f12@12 {
231                reg = <0x12>;
232                syna,sensor-type = <1>;
233            };
234
235            rmi4-f1a@1a {
236                reg = <0x1a>;
237            };
238        };
239    };
240
241  - |
242    #include <dt-bindings/interrupt-controller/irq.h>
243
244    spi {
245        #address-cells = <1>;
246        #size-cells = <0>;
247
248        touchscreen@0 {
249            compatible = "syna,rmi4-spi";
250            reg = <0x0>;
251            interrupt-parent = <&gpx1>;
252            interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
253
254            spi-max-frequency = <4000000>;
255            spi-rx-delay-us = <30>;
256            spi-cpha;
257            spi-cpol;
258
259            #address-cells = <1>;
260            #size-cells = <0>;
261
262            rmi4-f01@1 {
263                reg = <0x1>;
264                syna,nosleep-mode = <1>;
265            };
266
267            rmi4-f11@11 {
268                reg = <0x11>;
269                touchscreen-inverted-y;
270                syna,sensor-type = <2>;
271            };
272        };
273    };
274