Skip to content

Commit adf4932

Browse files
nunojsalag-linaro
authored andcommitted
dt-bindings: mfd: adp5585: add properties for input events
Add properties related to input events. These devices can act as keyboards and can support events either via a keymap Matrix or through GPIs. Note that the device needs to be an interrupt controller for GPIs based events. We specifically need a property specifying the pins used by the keymap matrix since these devices have no requirement for rows and columns to be contiguous without holes which is enforced by the standard input properties. Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-11-b1fcfe9e9826@analog.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 75024f9 commit adf4932

1 file changed

Lines changed: 186 additions & 2 deletions

File tree

Documentation/devicetree/bindings/mfd/adi,adp5585.yaml

Lines changed: 186 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,143 @@ properties:
4949
"#pwm-cells":
5050
const: 3
5151

52+
interrupt-controller: true
53+
54+
'#interrupt-cells':
55+
const: 2
56+
57+
poll-interval:
58+
enum: [10, 20, 30, 40]
59+
default: 10
60+
61+
adi,keypad-pins:
62+
description: Specifies the pins used for the keypad matrix.
63+
$ref: /schemas/types.yaml#/definitions/uint32-array
64+
65+
adi,unlock-events:
66+
description:
67+
Specifies a maximum of 2 events that can be used to unlock the keypad.
68+
If this property is set, the keyboard will be locked and only unlocked
69+
after these keys/gpis are pressed. The value 127 serves as a wildcard which
70+
means any key can be used for unlocking.
71+
$ref: /schemas/types.yaml#/definitions/uint32-array
72+
minItems: 1
73+
maxItems: 2
74+
items:
75+
anyOf:
76+
- minimum: 1
77+
maximum: 88
78+
- minimum: 97
79+
maximum: 115
80+
- const: 127
81+
82+
adi,unlock-trigger-sec:
83+
description:
84+
Defines the time in which the second unlock event must occur after the
85+
first unlock event has occurred.
86+
maximum: 7
87+
default: 0
88+
89+
adi,reset1-events:
90+
description:
91+
Defines the trigger events (key/gpi presses) that can generate reset
92+
conditions one the reset1 block.
93+
$ref: /schemas/types.yaml#/definitions/uint32-array
94+
minItems: 1
95+
maxItems: 3
96+
97+
adi,reset2-events:
98+
description:
99+
Defines the trigger events (key/gpi presses) that can generate reset
100+
conditions one the reset2 block.
101+
$ref: /schemas/types.yaml#/definitions/uint32-array
102+
minItems: 1
103+
maxItems: 2
104+
105+
adi,reset1-active-high:
106+
description: Sets the reset1 signal as active high.
107+
type: boolean
108+
109+
adi,reset2-active-high:
110+
description: Sets the reset2 signal as active high.
111+
type: boolean
112+
113+
adi,rst-passthrough-enable:
114+
description: Allows the RST pin to override (OR with) the reset1 signal.
115+
type: boolean
116+
117+
adi,reset-trigger-ms:
118+
description:
119+
Defines the length of time that the reset events must be active before a
120+
reset signal is generated. All events must be active at the same time for
121+
the same duration.
122+
enum: [0, 1000, 1500, 2000, 2500, 3000, 3500, 4000]
123+
default: 0
124+
125+
adi,reset-pulse-width-us:
126+
description: Defines the pulse width of the reset signals.
127+
enum: [500, 1000, 2000, 10000]
128+
default: 500
129+
52130
patternProperties:
53131
"-hog(-[0-9]+)?$":
54132
type: object
55133

56134
required:
57135
- gpio-hog
58136

137+
dependencies:
138+
linux,keymap:
139+
- adi,keypad-pins
140+
- interrupts
141+
interrupt-controller:
142+
- interrupts
143+
adi,unlock-trigger-sec:
144+
- adi,unlock-events
145+
adi,reset1-active-high:
146+
- adi,reset1-events
147+
adi,rst-passtrough-enable:
148+
- adi,reset1-events
149+
adi,reset2-active-high:
150+
- adi,reset2-events
151+
59152
required:
60153
- compatible
61154
- reg
62155

63156
allOf:
157+
- $ref: /schemas/input/matrix-keymap.yaml#
158+
- $ref: /schemas/input/input.yaml#
64159
- if:
65160
properties:
66161
compatible:
67162
contains:
68163
const: adi,adp5585-01
69164
then:
70165
properties:
166+
adi,unlock-events: false
167+
adi,unlock-trigger-sec: false
71168
gpio-reserved-ranges: false
72-
169+
adi,keypad-pins:
170+
minItems: 2
171+
maxItems: 11
172+
items:
173+
minimum: 0
174+
maximum: 10
175+
adi,reset1-events:
176+
items:
177+
anyOf:
178+
- minimum: 1
179+
maximum: 30
180+
- minimum: 37
181+
maximum: 47
182+
adi,reset2-events:
183+
items:
184+
anyOf:
185+
- minimum: 1
186+
maximum: 30
187+
- minimum: 37
188+
maximum: 47
73189
- if:
74190
properties:
75191
compatible:
@@ -81,6 +197,25 @@ allOf:
81197
- adi,adp5585-04
82198
then:
83199
properties:
200+
adi,unlock-events: false
201+
adi,unlock-trigger-sec: false
202+
adi,keypad-pins:
203+
minItems: 2
204+
maxItems: 10
205+
items:
206+
enum: [0, 1, 2, 3, 4, 6, 7, 8, 9, 10]
207+
adi,reset1-events:
208+
items:
209+
anyOf:
210+
- minimum: 1
211+
maximum: 25
212+
- enum: [37, 38, 39, 40, 41, 43, 44, 45, 46, 47]
213+
adi,reset2-events:
214+
items:
215+
anyOf:
216+
- minimum: 1
217+
maximum: 25
218+
- enum: [37, 38, 39, 40, 41, 43, 44, 45, 46, 47]
84219
gpio-reserved-ranges:
85220
maxItems: 1
86221
items:
@@ -99,11 +234,33 @@ allOf:
99234
then:
100235
properties:
101236
gpio-reserved-ranges: false
237+
adi,keypad-pins:
238+
minItems: 2
239+
maxItems: 19
240+
items:
241+
minimum: 0
242+
maximum: 18
243+
adi,reset1-events:
244+
items:
245+
anyOf:
246+
- minimum: 1
247+
maximum: 88
248+
- minimum: 97
249+
maximum: 115
250+
adi,reset2-events:
251+
items:
252+
anyOf:
253+
- minimum: 1
254+
maximum: 88
255+
- minimum: 97
256+
maximum: 115
102257

103-
additionalProperties: false
258+
unevaluatedProperties: false
104259

105260
examples:
106261
- |
262+
#include <dt-bindings/input/input.h>
263+
#include <dt-bindings/interrupt-controller/irq.h>
107264
i2c {
108265
#address-cells = <1>;
109266
#size-cells = <0>;
@@ -119,6 +276,33 @@ examples:
119276
gpio-reserved-ranges = <5 1>;
120277
121278
#pwm-cells = <3>;
279+
280+
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
281+
interrupt-parent = <&gpio>;
282+
283+
adi,reset1-events = <1 43>;
284+
adi,reset2-events = <2 3>;
285+
adi,reset-trigger-ms = <2000>;
286+
287+
/*
288+
* col0, col1, col2
289+
* row0, row1, row2
290+
*/
291+
adi,keypad-pins = <0 1 2 6 7 8>;
292+
293+
linux,keymap = <
294+
MATRIX_KEY(0x00, 0x00, KEY_1)
295+
MATRIX_KEY(0x00, 0x01, KEY_2)
296+
MATRIX_KEY(0x00, 0x02, KEY_3)
297+
298+
MATRIX_KEY(0x01, 0x00, KEY_A)
299+
MATRIX_KEY(0x01, 0x01, KEY_B)
300+
MATRIX_KEY(0x01, 0x02, KEY_C)
301+
302+
MATRIX_KEY(0x02, 0x00, BTN_1)
303+
MATRIX_KEY(0x02, 0x01, BTN_2)
304+
MATRIX_KEY(0x02, 0x02, BTN_3)
305+
>;
122306
};
123307
};
124308

0 commit comments

Comments
 (0)