st,stmpe.yaml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mfd/st,stmpe.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: STMicroelectonics Port Expander (STMPE)
  7. description: STMicroelectronics Port Expander (STMPE) is a series of slow
  8. bus controllers for various expanded peripherals such as GPIO, keypad,
  9. touchscreen, ADC, PWM or rotator. It can contain one or several different
  10. peripherals connected to SPI or I2C.
  11. maintainers:
  12. - Linus Walleij <linus.walleij@linaro.org>
  13. allOf:
  14. - $ref: /schemas/spi/spi-peripheral-props.yaml#
  15. properties:
  16. compatible:
  17. enum:
  18. - st,stmpe601
  19. - st,stmpe801
  20. - st,stmpe811
  21. - st,stmpe1600
  22. - st,stmpe1601
  23. - st,stmpe2401
  24. - st,stmpe2403
  25. reg:
  26. maxItems: 1
  27. interrupts:
  28. maxItems: 1
  29. vcc-supply: true
  30. vio-supply: true
  31. reset-gpios:
  32. maxItems: 1
  33. wakeup-source: true
  34. st,autosleep-timeout:
  35. $ref: /schemas/types.yaml#/definitions/uint32
  36. enum: [ 4, 16, 32, 64, 128, 256, 512, 1024 ]
  37. description: Time idle before going to automatic sleep to save power
  38. st,sample-time:
  39. $ref: /schemas/types.yaml#/definitions/uint32
  40. enum: [ 0, 1, 2, 3, 4, 5, 6 ]
  41. description: |
  42. Sample time per iteration
  43. 0 = 36 clock ticks
  44. 1 = 44 clock ticks
  45. 2 = 56 clock ticks
  46. 3 = 64 clock ticks
  47. 4 = 80 clock ticks - recommended
  48. 5 = 96 clock ticks
  49. 6 = 124 clock ticks
  50. st,mod-12b:
  51. $ref: /schemas/types.yaml#/definitions/uint32
  52. enum: [ 0, 1 ]
  53. description: ADC bit mode 0 = 10bit ADC, 1 = 12bit ADC
  54. st,ref-sel:
  55. $ref: /schemas/types.yaml#/definitions/uint32
  56. enum: [ 0, 1 ]
  57. description: ADC reference source 0 = internal, 1 = external
  58. st,adc-freq:
  59. $ref: /schemas/types.yaml#/definitions/uint32
  60. enum: [ 0, 1, 2, 3 ]
  61. description: |
  62. ADC clock speed
  63. 0 = 1.625 MHz
  64. 1 = 3.25 MHz
  65. 2, 3 = 6.5 MHz
  66. adc:
  67. type: object
  68. $ref: /schemas/iio/adc/st,stmpe-adc.yaml#
  69. gpio:
  70. type: object
  71. $ref: /schemas/gpio/st,stmpe-gpio.yaml#
  72. keyboard-controller:
  73. type: object
  74. $ref: /schemas/input/matrix-keymap.yaml#
  75. unevaluatedProperties: false
  76. properties:
  77. compatible:
  78. const: st,stmpe-keypad
  79. debounce-interval:
  80. description: Debouncing interval in milliseconds
  81. $ref: /schemas/types.yaml#/definitions/uint32
  82. st,no-autorepeat:
  83. description: If present, the keys will not autorepeat when pressed
  84. $ref: /schemas/types.yaml#/definitions/flag
  85. st,scan-count:
  86. description: Scanning cycles elapsed before key data is updated
  87. $ref: /schemas/types.yaml#/definitions/uint32
  88. required:
  89. - compatible
  90. - linux,keymap
  91. pwm:
  92. type: object
  93. $ref: /schemas/pwm/pwm.yaml#
  94. unevaluatedProperties: false
  95. properties:
  96. compatible:
  97. const: st,stmpe-pwm
  98. "#pwm-cells":
  99. const: 2
  100. touchscreen:
  101. type: object
  102. $ref: /schemas/input/touchscreen/touchscreen.yaml#
  103. unevaluatedProperties: false
  104. properties:
  105. compatible:
  106. const: st,stmpe-ts
  107. st,ave-ctrl:
  108. $ref: /schemas/types.yaml#/definitions/uint32
  109. enum: [ 0, 1, 2, 3 ]
  110. description: |
  111. Sample average control
  112. 0 = 1 sample
  113. 1 = 2 samples
  114. 2 = 4 samples
  115. 3 = 8 samples
  116. st,touch-det-delay:
  117. $ref: /schemas/types.yaml#/definitions/uint32
  118. enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
  119. description: |
  120. Touch detection delay
  121. 0 = 10 us
  122. 1 = 50 us
  123. 2 = 100 us
  124. 3 = 500 us - recommended
  125. 4 = 1 ms
  126. 5 = 5 ms
  127. 6 = 10 ms
  128. 7 = 50 ms
  129. st,settling:
  130. $ref: /schemas/types.yaml#/definitions/uint32
  131. enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
  132. description: |
  133. Panel driver settling time
  134. 0 = 10 us
  135. 1 = 100 us
  136. 2 = 500 us - recommended
  137. 3 = 1 ms
  138. 4 = 5 ms
  139. 5 = 10 ms
  140. 6 = 50 ms
  141. 7 = 100 ms
  142. st,fraction-z:
  143. $ref: /schemas/types.yaml#/definitions/uint32
  144. enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
  145. description: Length of the fractional part in z, recommended is 7
  146. (fraction-z ([0..7]) = Count of the fractional part)
  147. st,i-drive:
  148. $ref: /schemas/types.yaml#/definitions/uint32
  149. enum: [ 0, 1 ]
  150. description: |
  151. current limit value of the touchscreen drivers
  152. 0 = 20 mA (typical 35 mA max)
  153. 1 = 50 mA (typical 80 mA max)
  154. required:
  155. - compatible
  156. additionalProperties: false
  157. required:
  158. - compatible
  159. - reg
  160. - interrupts
  161. examples:
  162. - |
  163. #include <dt-bindings/gpio/gpio.h>
  164. #include <dt-bindings/interrupt-controller/irq.h>
  165. #include <dt-bindings/input/input.h>
  166. i2c {
  167. #address-cells = <1>;
  168. #size-cells = <0>;
  169. port-expander@43 {
  170. compatible = "st,stmpe2401";
  171. reg = <0x43>;
  172. reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
  173. interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
  174. interrupt-parent = <&gpio>;
  175. vcc-supply = <&db8500_vsmps2_reg>;
  176. vio-supply = <&db8500_vsmps2_reg>;
  177. wakeup-source;
  178. st,autosleep-timeout = <1024>;
  179. gpio {
  180. compatible = "st,stmpe-gpio";
  181. gpio-controller;
  182. #gpio-cells = <2>;
  183. interrupt-controller;
  184. #interrupt-cells = <2>;
  185. st,norequest-mask = <0xf0f002>;
  186. };
  187. keyboard-controller {
  188. compatible = "st,stmpe-keypad";
  189. debounce-interval = <64>;
  190. st,scan-count = <8>;
  191. st,no-autorepeat;
  192. keypad,num-rows = <8>;
  193. keypad,num-columns = <8>;
  194. linux,keymap = <
  195. MATRIX_KEY(0x00, 0x00, KEY_1)
  196. MATRIX_KEY(0x00, 0x01, KEY_2)
  197. MATRIX_KEY(0x00, 0x02, KEY_3)
  198. MATRIX_KEY(0x00, 0x03, KEY_4)
  199. MATRIX_KEY(0x00, 0x04, KEY_5)
  200. MATRIX_KEY(0x00, 0x05, KEY_6)
  201. MATRIX_KEY(0x00, 0x06, KEY_7)
  202. MATRIX_KEY(0x00, 0x07, KEY_8)
  203. MATRIX_KEY(0x00, 0x08, KEY_9)
  204. MATRIX_KEY(0x00, 0x09, KEY_0)
  205. >;
  206. };
  207. pwm {
  208. compatible = "st,stmpe-pwm";
  209. #pwm-cells = <2>;
  210. };
  211. };
  212. port-expander@41 {
  213. compatible = "st,stmpe811";
  214. reg = <0x41>;
  215. interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
  216. interrupt-parent = <&gpio>;
  217. st,adc-freq = <1>;
  218. st,mod-12b = <1>;
  219. st,ref-sel = <0>;
  220. st,sample-time = <4>;
  221. adc {
  222. compatible = "st,stmpe-adc";
  223. st,norequest-mask = <0x0f>;
  224. #io-channel-cells = <1>;
  225. };
  226. gpio {
  227. compatible = "st,stmpe-gpio";
  228. gpio-controller;
  229. #gpio-cells = <2>;
  230. interrupt-controller;
  231. #interrupt-cells = <2>;
  232. };
  233. pwm {
  234. compatible = "st,stmpe-pwm";
  235. #pwm-cells = <2>;
  236. };
  237. touchscreen {
  238. compatible = "st,stmpe-ts";
  239. st,ave-ctrl = <3>;
  240. st,touch-det-delay = <5>;
  241. st,settling = <3>;
  242. st,fraction-z = <7>;
  243. st,i-drive = <1>;
  244. };
  245. };
  246. };
  247. ...