adi,ad7879.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/input/touchscreen/adi,ad7879.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C)
  7. maintainers:
  8. - Frank Li <Frank.Li@nxp.com>
  9. properties:
  10. compatible:
  11. description: |
  12. for SPI slave, use "adi,ad7879"
  13. for I2C slave, use "adi,ad7879-1"
  14. enum:
  15. - adi,ad7879
  16. - adi,ad7879-1
  17. reg:
  18. maxItems: 1
  19. interrupts:
  20. maxItems: 1
  21. touchscreen-max-pressure:
  22. $ref: /schemas/types.yaml#/definitions/uint32
  23. description: maximum reported pressure
  24. adi,resistance-plate-x:
  25. $ref: /schemas/types.yaml#/definitions/uint32
  26. description: total resistance of X-plate (for pressure calculation)
  27. touchscreen-swapped-x-y:
  28. $ref: /schemas/types.yaml#/definitions/flag
  29. description: X and Y axis are swapped (boolean)
  30. adi,first-conversion-delay:
  31. $ref: /schemas/types.yaml#/definitions/uint8
  32. default: 0
  33. minimum: 0
  34. maximum: 15
  35. description: |
  36. 0-12: In 128us steps (starting with 128us)
  37. 13 : 2.560ms
  38. 14 : 3.584ms
  39. 15 : 4.096ms
  40. This property has to be a '/bits/ 8' value
  41. adi,acquisition-time:
  42. $ref: /schemas/types.yaml#/definitions/uint8
  43. default: 0
  44. enum: [0, 1, 2, 3]
  45. description: |
  46. 0: 2us
  47. 1: 4us
  48. 2: 8us
  49. 3: 16us
  50. This property has to be a '/bits/ 8' value
  51. adi,median-filter-size:
  52. $ref: /schemas/types.yaml#/definitions/uint8
  53. default: 0
  54. enum: [0, 1, 2, 3]
  55. description: |
  56. 0: disabled
  57. 1: 4 measurements
  58. 2: 8 measurements
  59. 3: 16 measurements
  60. This property has to be a '/bits/ 8' value
  61. adi,averaging:
  62. $ref: /schemas/types.yaml#/definitions/uint8
  63. default: 0
  64. enum: [0, 1, 2, 3]
  65. description: |
  66. 0: 2 middle values (1 if median disabled)
  67. 1: 4 middle values
  68. 2: 8 middle values
  69. 3: 16 values
  70. This property has to be a '/bits/ 8' value
  71. adi,conversion-interval:
  72. $ref: /schemas/types.yaml#/definitions/uint8
  73. default: 0
  74. description: |
  75. 0 : convert one time only
  76. 1-255: 515us + val * 35us (up to 9.440ms)
  77. This property has to be a '/bits/ 8' value
  78. gpio-controller: true
  79. "#gpio-cells":
  80. const: 1
  81. required:
  82. - compatible
  83. - reg
  84. allOf:
  85. - $ref: /schemas/spi/spi-peripheral-props.yaml
  86. unevaluatedProperties: false
  87. examples:
  88. - |
  89. #include <dt-bindings/interrupt-controller/irq.h>
  90. i2c {
  91. #address-cells = <1>;
  92. #size-cells = <0>;
  93. touchscreen0@2c {
  94. compatible = "adi,ad7879-1";
  95. reg = <0x2c>;
  96. interrupt-parent = <&gpio1>;
  97. interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
  98. touchscreen-max-pressure = <4096>;
  99. adi,resistance-plate-x = <120>;
  100. adi,first-conversion-delay = /bits/ 8 <3>;
  101. adi,acquisition-time = /bits/ 8 <1>;
  102. adi,median-filter-size = /bits/ 8 <2>;
  103. adi,averaging = /bits/ 8 <1>;
  104. adi,conversion-interval = /bits/ 8 <255>;
  105. };
  106. };
  107. - |
  108. #include <dt-bindings/interrupt-controller/irq.h>
  109. spi {
  110. #address-cells = <1>;
  111. #size-cells = <0>;
  112. touchscreen1@1 {
  113. compatible = "adi,ad7879";
  114. reg = <1>;
  115. spi-max-frequency = <5000000>;
  116. gpio-controller;
  117. #gpio-cells = <1>;
  118. interrupt-parent = <&gpio1>;
  119. interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
  120. touchscreen-max-pressure = <4096>;
  121. adi,resistance-plate-x = <120>;
  122. adi,first-conversion-delay = /bits/ 8 <3>;
  123. adi,acquisition-time = /bits/ 8 <1>;
  124. adi,median-filter-size = /bits/ 8 <2>;
  125. adi,averaging = /bits/ 8 <1>;
  126. adi,conversion-interval = /bits/ 8 <255>;
  127. };
  128. };