syna,rmi4.yaml 6.4 KB

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