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 92 rmi4-f1a@1a: 93 type: object 94 additionalProperties: false 95 $ref: input.yaml# 96 description: 97 RMI4 Function 1A is for capacitive keys. 98 99 properties: 100 reg: 101 maxItems: 1 102 103 linux,keycodes: 104 minItems: 1 105 maxItems: 4 106 107 required: 108 - reg 109 110patternProperties: 111 "^rmi4-f1[12]@1[12]$": 112 type: object 113 unevaluatedProperties: false 114 $ref: /schemas/input/touchscreen/touchscreen.yaml# 115 description: 116 RMI4 Function 11 and Function 12 are for 2D touch position sensing. 117 118 properties: 119 reg: 120 maxItems: 1 121 122 syna,clip-x-low: 123 $ref: /schemas/types.yaml#/definitions/uint32 124 description: 125 Minimum value for X. 126 127 syna,clip-y-low: 128 $ref: /schemas/types.yaml#/definitions/uint32 129 description: 130 Minimum value for Y. 131 132 syna,clip-x-high: 133 $ref: /schemas/types.yaml#/definitions/uint32 134 description: 135 Maximum value for X. 136 137 syna,clip-y-high: 138 $ref: /schemas/types.yaml#/definitions/uint32 139 description: 140 Maximum value for Y. 141 142 syna,offset-x: 143 $ref: /schemas/types.yaml#/definitions/uint32 144 description: 145 Add an offset to X. 146 147 syna,offset-y: 148 $ref: /schemas/types.yaml#/definitions/uint32 149 description: 150 Add an offset to Y. 151 152 syna,delta-x-threshold: 153 $ref: /schemas/types.yaml#/definitions/uint32 154 description: 155 Minimum distance on the X axis required to generate an interrupt in 156 reduced reporting mode. 157 158 syna,delta-y-threshold: 159 $ref: /schemas/types.yaml#/definitions/uint32 160 description: 161 Minimum distance on the Y axis required to generate an interrupt in 162 reduced reporting mode. 163 164 syna,sensor-type: 165 $ref: /schemas/types.yaml#/definitions/uint32 166 enum: [1, 2] 167 description: | 168 Sensor type: 1 for touchscreen 2 for touchpad. 169 170 syna,disable-report-mask: 171 $ref: /schemas/types.yaml#/definitions/uint32 172 description: 173 Mask for disabling posiiton reporting. Used to disable reporing 174 absolute position data. 175 176 syna,rezero-wait-ms: 177 description: 178 Time to wait after issuing a rezero command. 179 180 required: 181 - reg 182 183 "^rmi4-f[0-9a-f]+@[0-9a-f]+$": 184 type: object 185 additionalProperties: true 186 187 description: 188 Other functions, not documented yet. 189 190 properties: 191 reg: 192 maxItems: 1 193 194 required: 195 - reg 196 197required: 198 - compatible 199 - reg 200 201unevaluatedProperties: false 202 203allOf: 204 - $ref: /schemas/spi/spi-peripheral-props.yaml# 205 206 - if: 207 properties: 208 compatible: 209 contains: 210 const: syna,rmi4-i2c 211 then: 212 properties: 213 spi-rx-delay-us: false 214 spi-tx-delay-us: false 215 else: 216 properties: 217 syna,reset-delay-ms: false 218 syna,startup-delay-ms: false 219 220examples: 221 - | 222 #include <dt-bindings/input/linux-event-codes.h> 223 #include <dt-bindings/interrupt-controller/irq.h> 224 225 i2c { 226 #address-cells = <1>; 227 #size-cells = <0>; 228 229 touchscreen@20 { 230 compatible = "syna,rmi4-i2c"; 231 reg = <0x20>; 232 interrupt-parent = <&gpx1>; 233 interrupts = <6 IRQ_TYPE_EDGE_FALLING>; 234 235 syna,startup-delay-ms = <100>; 236 vdd-supply = <&tsp_vdd>; 237 vio-supply = <&ldo32_reg>; 238 239 pinctrl-0 = <&touch_irq>; 240 pinctrl-names = "default"; 241 #address-cells = <1>; 242 #size-cells = <0>; 243 244 rmi4-f01@1 { 245 reg = <0x1>; 246 syna,nosleep-mode = <1>; 247 }; 248 249 rmi4-f12@12 { 250 reg = <0x12>; 251 syna,sensor-type = <1>; 252 }; 253 254 rmi4-f1a@1a { 255 reg = <0x1a>; 256 linux,keycodes = <KEY_BACK KEY_HOME KEY_MENU>; 257 }; 258 }; 259 }; 260 261 - | 262 #include <dt-bindings/interrupt-controller/irq.h> 263 264 spi { 265 #address-cells = <1>; 266 #size-cells = <0>; 267 268 touchscreen@0 { 269 compatible = "syna,rmi4-spi"; 270 reg = <0x0>; 271 interrupt-parent = <&gpx1>; 272 interrupts = <6 IRQ_TYPE_EDGE_FALLING>; 273 274 spi-max-frequency = <4000000>; 275 spi-rx-delay-us = <30>; 276 spi-cpha; 277 spi-cpol; 278 279 #address-cells = <1>; 280 #size-cells = <0>; 281 282 rmi4-f01@1 { 283 reg = <0x1>; 284 syna,nosleep-mode = <1>; 285 }; 286 287 rmi4-f11@11 { 288 reg = <0x11>; 289 touchscreen-inverted-y; 290 syna,sensor-type = <2>; 291 }; 292 }; 293 }; 294