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