maxim,max7360.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mfd/maxim,max7360.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Maxim MAX7360 Keypad, Rotary encoder, PWM and GPIO controller
  7. maintainers:
  8. - Kamel Bouhara <kamel.bouhara@bootlin.com>
  9. - Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
  10. description: |
  11. Maxim MAX7360 device, with following functions:
  12. - keypad controller
  13. - rotary controller
  14. - GPIO and GPO controller
  15. - PWM controller
  16. https://www.analog.com/en/products/max7360.html
  17. allOf:
  18. - $ref: /schemas/input/matrix-keymap.yaml#
  19. - $ref: /schemas/input/input.yaml#
  20. properties:
  21. compatible:
  22. enum:
  23. - maxim,max7360
  24. reg:
  25. maxItems: 1
  26. interrupts:
  27. maxItems: 2
  28. interrupt-names:
  29. items:
  30. - const: inti
  31. - const: intk
  32. keypad-debounce-delay-ms:
  33. description: Keypad debounce delay in ms
  34. minimum: 9
  35. maximum: 40
  36. default: 9
  37. rotary-debounce-delay-ms:
  38. description: Rotary encoder debounce delay in ms
  39. minimum: 0
  40. maximum: 15
  41. default: 0
  42. linux,axis:
  43. $ref: /schemas/input/rotary-encoder.yaml#/properties/linux,axis
  44. rotary-encoder,relative-axis:
  45. $ref: /schemas/types.yaml#/definitions/flag
  46. description:
  47. Register a relative axis rather than an absolute one.
  48. rotary-encoder,steps:
  49. $ref: /schemas/types.yaml#/definitions/uint32
  50. default: 24
  51. description:
  52. Number of steps in a full turnaround of the
  53. encoder. Only relevant for absolute axis. Defaults to 24 which is a
  54. typical value for such devices.
  55. rotary-encoder,rollover:
  56. $ref: /schemas/types.yaml#/definitions/flag
  57. description:
  58. Automatic rollover when the rotary value becomes
  59. greater than the specified steps or smaller than 0. For absolute axis only.
  60. "#pwm-cells":
  61. const: 3
  62. gpio:
  63. $ref: /schemas/gpio/maxim,max7360-gpio.yaml#
  64. description:
  65. PORT0 to PORT7 general purpose input/output pins configuration.
  66. gpo:
  67. $ref: /schemas/gpio/maxim,max7360-gpio.yaml#
  68. description: >
  69. COL2 to COL7 general purpose output pins configuration. Allows to use
  70. unused keypad columns as outputs.
  71. The MAX7360 has 8 column lines and 6 of them can be used as GPOs. GPIOs
  72. numbers used for this gpio-controller node do correspond to the column
  73. numbers: values 0 and 1 are never valid, values from 2 to 7 might be valid
  74. depending on the value of the keypad,num-column property.
  75. patternProperties:
  76. '-pins$':
  77. type: object
  78. description:
  79. Pinctrl node's client devices use subnodes for desired pin configuration.
  80. Client device subnodes use below standard properties.
  81. $ref: /schemas/pinctrl/pincfg-node.yaml
  82. properties:
  83. pins:
  84. description:
  85. List of gpio pins affected by the properties specified in this
  86. subnode.
  87. items:
  88. pattern: '^(PORT[0-7]|ROTARY)$'
  89. minItems: 1
  90. maxItems: 8
  91. function:
  92. description:
  93. Specify the alternative function to be configured for the specified
  94. pins.
  95. enum: [gpio, pwm, rotary]
  96. additionalProperties: false
  97. required:
  98. - compatible
  99. - reg
  100. - interrupts
  101. - interrupt-names
  102. - linux,keymap
  103. - linux,axis
  104. - "#pwm-cells"
  105. - gpio
  106. - gpo
  107. unevaluatedProperties: false
  108. examples:
  109. - |
  110. #include <dt-bindings/input/input.h>
  111. #include <dt-bindings/interrupt-controller/arm-gic.h>
  112. i2c {
  113. #address-cells = <1>;
  114. #size-cells = <0>;
  115. io-expander@38 {
  116. compatible = "maxim,max7360";
  117. reg = <0x38>;
  118. interrupt-parent = <&gpio1>;
  119. interrupts = <23 IRQ_TYPE_LEVEL_LOW>,
  120. <24 IRQ_TYPE_LEVEL_LOW>;
  121. interrupt-names = "inti", "intk";
  122. keypad,num-rows = <8>;
  123. keypad,num-columns = <4>;
  124. linux,keymap = <
  125. MATRIX_KEY(0x00, 0x00, KEY_F5)
  126. MATRIX_KEY(0x01, 0x00, KEY_F4)
  127. MATRIX_KEY(0x02, 0x01, KEY_F6)
  128. >;
  129. keypad-debounce-delay-ms = <10>;
  130. autorepeat;
  131. rotary-debounce-delay-ms = <2>;
  132. linux,axis = <0>; /* REL_X */
  133. rotary-encoder,relative-axis;
  134. #pwm-cells = <3>;
  135. max7360_gpio: gpio {
  136. compatible = "maxim,max7360-gpio";
  137. gpio-controller;
  138. #gpio-cells = <2>;
  139. maxim,constant-current-disable = <0x06>;
  140. interrupt-controller;
  141. #interrupt-cells = <0x2>;
  142. };
  143. max7360_gpo: gpo {
  144. compatible = "maxim,max7360-gpo";
  145. gpio-controller;
  146. #gpio-cells = <2>;
  147. };
  148. backlight_pins: backlight-pins {
  149. pins = "PORT2";
  150. function = "pwm";
  151. };
  152. };
  153. };