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