microchip,cap11xx.yaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/input/microchip,cap11xx.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Microchip CAP11xx based capacitive touch sensors
  7. description: |
  8. The Microchip CAP1xxx Family of RightTouchTM multiple-channel capacitive
  9. touch controllers and LED drivers. The device communication via I2C only.
  10. maintainers:
  11. - Rob Herring <robh@kernel.org>
  12. properties:
  13. compatible:
  14. enum:
  15. - microchip,cap1106
  16. - microchip,cap1126
  17. - microchip,cap1188
  18. - microchip,cap1203
  19. - microchip,cap1206
  20. - microchip,cap1293
  21. - microchip,cap1298
  22. reg:
  23. maxItems: 1
  24. '#address-cells':
  25. const: 1
  26. '#size-cells':
  27. const: 0
  28. interrupts:
  29. maxItems: 1
  30. description: |
  31. Property describing the interrupt line the
  32. device's ALERT#/CM_IRQ# pin is connected to.
  33. The device only has one interrupt source.
  34. autorepeat:
  35. description: |
  36. Enables the Linux input system's autorepeat feature on the input device.
  37. linux,keycodes:
  38. minItems: 3
  39. maxItems: 8
  40. description: |
  41. Specifies an array of numeric keycode values to
  42. be used for the channels. If this property is
  43. omitted, KEY_A, KEY_B, etc are used as defaults.
  44. The number of entries must correspond to the number of channels.
  45. microchip,sensor-gain:
  46. $ref: /schemas/types.yaml#/definitions/uint32
  47. default: 1
  48. enum: [1, 2, 4, 8]
  49. description: |
  50. Defines the gain of the sensor circuitry. This
  51. effectively controls the sensitivity, as a
  52. smaller delta capacitance is required to
  53. generate the same delta count values.
  54. microchip,irq-active-high:
  55. type: boolean
  56. description: |
  57. By default the interrupt pin is active low
  58. open drain. This property allows using the active
  59. high push-pull output.
  60. microchip,sensitivity-delta-sense:
  61. $ref: /schemas/types.yaml#/definitions/uint32
  62. default: 32
  63. enum: [1, 2, 4, 8, 16, 32, 64, 128]
  64. description:
  65. Controls the sensitivity multiplier of a touch detection.
  66. Higher value means more sensitive settings.
  67. At the more sensitive settings, touches are detected for a smaller delta
  68. capacitance corresponding to a "lighter" touch.
  69. microchip,signal-guard:
  70. $ref: /schemas/types.yaml#/definitions/uint32-array
  71. minItems: 3
  72. maxItems: 8
  73. items:
  74. enum: [0, 1]
  75. description: |
  76. 0 - off
  77. 1 - on
  78. The signal guard isolates the signal from virtual grounds.
  79. If enabled then the behavior of the channel is changed to signal guard.
  80. The number of entries must correspond to the number of channels.
  81. microchip,input-threshold:
  82. $ref: /schemas/types.yaml#/definitions/uint32-array
  83. minItems: 3
  84. maxItems: 8
  85. items:
  86. minimum: 0
  87. maximum: 127
  88. description:
  89. Specifies the delta threshold that is used to determine if a touch has
  90. been detected. A higher value means a larger difference in capacitance
  91. is required for a touch to be registered, making the touch sensor less
  92. sensitive.
  93. The number of entries must correspond to the number of channels.
  94. microchip,calib-sensitivity:
  95. $ref: /schemas/types.yaml#/definitions/uint32-array
  96. minItems: 3
  97. maxItems: 8
  98. items:
  99. enum: [1, 2, 4]
  100. description: |
  101. Specifies an array of numeric values that controls the gain
  102. used by the calibration routine to enable sensor inputs
  103. to be more sensitive for proximity detection.
  104. Gain is based on touch pad capacitance range
  105. 1 - 5-50pF
  106. 2 - 0-25pF
  107. 4 - 0-12.5pF
  108. The number of entries must correspond to the number of channels.
  109. patternProperties:
  110. "^led@[0-7]$":
  111. type: object
  112. description: CAP11xx LEDs
  113. $ref: /schemas/leds/common.yaml#
  114. properties:
  115. reg:
  116. enum: [0, 1, 2, 3, 4, 5, 6, 7]
  117. label: true
  118. linux,default-trigger: true
  119. default-state: true
  120. required:
  121. - reg
  122. additionalProperties: false
  123. allOf:
  124. - $ref: input.yaml
  125. - if:
  126. properties:
  127. compatible:
  128. contains:
  129. enum:
  130. - microchip,cap1106
  131. - microchip,cap1203
  132. - microchip,cap1206
  133. - microchip,cap1293
  134. - microchip,cap1298
  135. then:
  136. patternProperties:
  137. "^led@[0-7]$": false
  138. - if:
  139. properties:
  140. compatible:
  141. contains:
  142. enum:
  143. - microchip,cap1106
  144. - microchip,cap1126
  145. - microchip,cap1188
  146. - microchip,cap1203
  147. - microchip,cap1206
  148. then:
  149. properties:
  150. microchip,signal-guard: false
  151. microchip,calib-sensitivity: false
  152. required:
  153. - compatible
  154. - interrupts
  155. additionalProperties: false
  156. examples:
  157. - |
  158. i2c {
  159. #address-cells = <1>;
  160. #size-cells = <0>;
  161. touch@28 {
  162. compatible = "microchip,cap1188";
  163. interrupt-parent = <&gpio1>;
  164. interrupts = <0 0>;
  165. reg = <0x28>;
  166. autorepeat;
  167. microchip,sensor-gain = <2>;
  168. microchip,sensitivity-delta-sense = <16>;
  169. microchip,input-threshold = <21>, <18>, <46>, <46>, <46>, <21>;
  170. linux,keycodes = <103>, /* KEY_UP */
  171. <106>, /* KEY_RIGHT */
  172. <108>, /* KEY_DOWN */
  173. <105>, /* KEY_LEFT */
  174. <109>, /* KEY_PAGEDOWN */
  175. <104>; /* KEY_PAGEUP */
  176. #address-cells = <1>;
  177. #size-cells = <0>;
  178. led@0 {
  179. label = "cap11xx:green:usr0";
  180. reg = <0>;
  181. };
  182. led@1 {
  183. label = "cap11xx:green:usr1";
  184. reg = <1>;
  185. };
  186. led@2 {
  187. label = "cap11xx:green:alive";
  188. reg = <2>;
  189. linux,default-trigger = "heartbeat";
  190. };
  191. };
  192. };