adc-joystick.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. # Copyright 2019-2020 Artur Rojek
  3. %YAML 1.2
  4. ---
  5. $id: http://devicetree.org/schemas/input/adc-joystick.yaml#
  6. $schema: http://devicetree.org/meta-schemas/core.yaml#
  7. title: ADC attached joystick
  8. maintainers:
  9. - Artur Rojek <contact@artur-rojek.eu>
  10. description: >
  11. Bindings for joystick devices connected to ADC controllers supporting
  12. the Industrial I/O subsystem.
  13. allOf:
  14. - $ref: input.yaml#
  15. properties:
  16. compatible:
  17. const: adc-joystick
  18. io-channels:
  19. minItems: 1
  20. maxItems: 1024
  21. description: >
  22. List of phandle and IIO specifier pairs.
  23. Each pair defines one ADC channel to which a joystick axis is connected.
  24. See
  25. https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml
  26. for details.
  27. poll-interval: true
  28. '#address-cells':
  29. const: 1
  30. '#size-cells':
  31. const: 0
  32. required:
  33. - compatible
  34. - io-channels
  35. - '#address-cells'
  36. - '#size-cells'
  37. additionalProperties: false
  38. patternProperties:
  39. "^axis@[0-9a-f]+$":
  40. type: object
  41. $ref: input.yaml#
  42. description: >
  43. Represents a joystick axis bound to the given ADC channel.
  44. For each entry in the io-channels list, one axis subnode with a matching
  45. reg property must be specified.
  46. properties:
  47. reg:
  48. minimum: 0
  49. maximum: 1023
  50. description: Index of an io-channels list entry bound to this axis.
  51. linux,code:
  52. description: EV_ABS specific event code generated by the axis.
  53. abs-range:
  54. $ref: /schemas/types.yaml#/definitions/uint32-array
  55. items:
  56. - description: minimum value
  57. - description: maximum value
  58. description: >
  59. Minimum and maximum values produced by the axis.
  60. For an ABS_X axis this will be the left-most and right-most
  61. inclination of the joystick. If min > max, it is left to userspace to
  62. treat the axis as inverted.
  63. This property is interpreted as two signed 32 bit values.
  64. abs-fuzz:
  65. $ref: /schemas/types.yaml#/definitions/uint32
  66. description: >
  67. Amount of noise in the input value.
  68. Omitting this property indicates the axis is precise.
  69. abs-flat:
  70. $ref: /schemas/types.yaml#/definitions/uint32
  71. description: >
  72. Axial "deadzone", or area around the center position, where the axis
  73. is considered to be at rest.
  74. Omitting this property indicates the axis always returns to exactly
  75. the center position.
  76. required:
  77. - reg
  78. - linux,code
  79. - abs-range
  80. additionalProperties: false
  81. examples:
  82. - |
  83. #include <dt-bindings/iio/adc/ingenic,adc.h>
  84. #include <dt-bindings/input/input.h>
  85. joystick: adc-joystick {
  86. compatible = "adc-joystick";
  87. io-channels = <&adc INGENIC_ADC_TOUCH_XP>,
  88. <&adc INGENIC_ADC_TOUCH_YP>;
  89. #address-cells = <1>;
  90. #size-cells = <0>;
  91. axis@0 {
  92. reg = <0>;
  93. linux,code = <ABS_X>;
  94. abs-range = <3300 0>;
  95. abs-fuzz = <4>;
  96. abs-flat = <200>;
  97. };
  98. axis@1 {
  99. reg = <1>;
  100. linux,code = <ABS_Y>;
  101. abs-range = <0 3300>;
  102. abs-fuzz = <4>;
  103. abs-flat = <200>;
  104. };
  105. };