adi,adp5588.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/input/adi,adp5588.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Analog Devices ADP5588 Keypad Controller
  7. maintainers:
  8. - Nuno Sá <nuno.sa@analog.com>
  9. description: |
  10. Analog Devices Mobile I/O Expander and QWERTY Keypad Controller
  11. https://www.analog.com/media/en/technical-documentation/data-sheets/ADP5588.pdf
  12. allOf:
  13. - $ref: matrix-keymap.yaml#
  14. - $ref: input.yaml#
  15. properties:
  16. compatible:
  17. enum:
  18. - adi,adp5587
  19. - adi,adp5588
  20. reg:
  21. maxItems: 1
  22. vcc-supply:
  23. description: Supply Voltage Input
  24. reset-gpios:
  25. description:
  26. If specified, it will be asserted during driver probe. As the line is
  27. active low, it should be marked GPIO_ACTIVE_LOW.
  28. maxItems: 1
  29. interrupts:
  30. maxItems: 1
  31. gpio-controller:
  32. description:
  33. This property applies if either keypad,num-rows lower than 8 or
  34. keypad,num-columns lower than 10.
  35. '#gpio-cells':
  36. const: 2
  37. interrupt-controller:
  38. description:
  39. This property applies if either keypad,num-rows lower than 8 or
  40. keypad,num-columns lower than 10. This property is optional if
  41. keypad,num-rows or keypad,num-columns are not specified as the
  42. device is then configured to be used purely for gpio during which
  43. interrupts may or may not be utilized.
  44. '#interrupt-cells':
  45. const: 2
  46. adi,unlock-keys:
  47. description:
  48. Specifies a maximum of 2 keys that can be used to unlock the keypad.
  49. If this property is set, the keyboard will be locked and only unlocked
  50. after these keys are pressed. If only one key is set, a double click is
  51. needed to unlock the keypad. The value of this property cannot be bigger
  52. or equal than keypad,num-rows * keypad,num-columns.
  53. $ref: /schemas/types.yaml#/definitions/uint32-array
  54. minItems: 1
  55. maxItems: 2
  56. dependencies:
  57. keypad,num-rows:
  58. - linux,keymap
  59. - keypad,num-columns
  60. keypad,num-columns:
  61. - linux,keymap
  62. - keypad,num-rows
  63. linux,keymap:
  64. - keypad,num-rows
  65. - keypad,num-columns
  66. - interrupts
  67. interrupt-controller:
  68. - interrupts
  69. required:
  70. - compatible
  71. - reg
  72. unevaluatedProperties: false
  73. examples:
  74. - |
  75. #include <dt-bindings/interrupt-controller/irq.h>
  76. #include <dt-bindings/input/input.h>
  77. #include <dt-bindings/gpio/gpio.h>
  78. i2c {
  79. #address-cells = <1>;
  80. #size-cells = <0>;
  81. keys@34 {
  82. compatible = "adi,adp5588";
  83. reg = <0x34>;
  84. vcc-supply = <&vcc>;
  85. interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
  86. interrupt-parent = <&gpio>;
  87. reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
  88. keypad,num-rows = <1>;
  89. keypad,num-columns = <9>;
  90. linux,keymap = <
  91. MATRIX_KEY(0x00, 0x00, KEY_1)
  92. MATRIX_KEY(0x00, 0x01, KEY_2)
  93. MATRIX_KEY(0x00, 0x02, KEY_3)
  94. MATRIX_KEY(0x00, 0x03, KEY_4)
  95. MATRIX_KEY(0x00, 0x04, KEY_5)
  96. MATRIX_KEY(0x00, 0x05, KEY_6)
  97. MATRIX_KEY(0x00, 0x06, KEY_7)
  98. MATRIX_KEY(0x00, 0x07, KEY_8)
  99. MATRIX_KEY(0x00, 0x08, KEY_9)
  100. >;
  101. };
  102. };
  103. - |
  104. #include <dt-bindings/gpio/gpio.h>
  105. i2c {
  106. #address-cells = <1>;
  107. #size-cells = <0>;
  108. gpio@34 {
  109. compatible = "adi,adp5588";
  110. reg = <0x34>;
  111. #gpio-cells = <2>;
  112. gpio-controller;
  113. };
  114. };
  115. ...