Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Nuno Sá and committed by
Lee Jones
adf4932b 75024f97

+186 -2
+186 -2
Documentation/devicetree/bindings/mfd/adi,adp5585.yaml
··· 49 49 "#pwm-cells": 50 50 const: 3 51 51 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 + 52 130 patternProperties: 53 131 "-hog(-[0-9]+)?$": 54 132 type: object ··· 134 56 required: 135 57 - gpio-hog 136 58 59 + dependencies: 60 + linux,keymap: 61 + - adi,keypad-pins 62 + - interrupts 63 + interrupt-controller: 64 + - interrupts 65 + adi,unlock-trigger-sec: 66 + - adi,unlock-events 67 + adi,reset1-active-high: 68 + - adi,reset1-events 69 + adi,rst-passtrough-enable: 70 + - adi,reset1-events 71 + adi,reset2-active-high: 72 + - adi,reset2-events 73 + 137 74 required: 138 75 - compatible 139 76 - reg 140 77 141 78 allOf: 79 + - $ref: /schemas/input/matrix-keymap.yaml# 80 + - $ref: /schemas/input/input.yaml# 142 81 - if: 143 82 properties: 144 83 compatible: ··· 163 68 const: adi,adp5585-01 164 69 then: 165 70 properties: 71 + adi,unlock-events: false 72 + adi,unlock-trigger-sec: false 166 73 gpio-reserved-ranges: false 167 - 74 + adi,keypad-pins: 75 + minItems: 2 76 + maxItems: 11 77 + items: 78 + minimum: 0 79 + maximum: 10 80 + adi,reset1-events: 81 + items: 82 + anyOf: 83 + - minimum: 1 84 + maximum: 30 85 + - minimum: 37 86 + maximum: 47 87 + adi,reset2-events: 88 + items: 89 + anyOf: 90 + - minimum: 1 91 + maximum: 30 92 + - minimum: 37 93 + maximum: 47 168 94 - if: 169 95 properties: 170 96 compatible: ··· 197 81 - adi,adp5585-04 198 82 then: 199 83 properties: 84 + adi,unlock-events: false 85 + adi,unlock-trigger-sec: false 86 + adi,keypad-pins: 87 + minItems: 2 88 + maxItems: 10 89 + items: 90 + enum: [0, 1, 2, 3, 4, 6, 7, 8, 9, 10] 91 + adi,reset1-events: 92 + items: 93 + anyOf: 94 + - minimum: 1 95 + maximum: 25 96 + - enum: [37, 38, 39, 40, 41, 43, 44, 45, 46, 47] 97 + adi,reset2-events: 98 + items: 99 + anyOf: 100 + - minimum: 1 101 + maximum: 25 102 + - enum: [37, 38, 39, 40, 41, 43, 44, 45, 46, 47] 200 103 gpio-reserved-ranges: 201 104 maxItems: 1 202 105 items: ··· 234 99 then: 235 100 properties: 236 101 gpio-reserved-ranges: false 102 + adi,keypad-pins: 103 + minItems: 2 104 + maxItems: 19 105 + items: 106 + minimum: 0 107 + maximum: 18 108 + adi,reset1-events: 109 + items: 110 + anyOf: 111 + - minimum: 1 112 + maximum: 88 113 + - minimum: 97 114 + maximum: 115 115 + adi,reset2-events: 116 + items: 117 + anyOf: 118 + - minimum: 1 119 + maximum: 88 120 + - minimum: 97 121 + maximum: 115 237 122 238 - additionalProperties: false 123 + unevaluatedProperties: false 239 124 240 125 examples: 241 126 - | 127 + #include <dt-bindings/input/input.h> 128 + #include <dt-bindings/interrupt-controller/irq.h> 242 129 i2c { 243 130 #address-cells = <1>; 244 131 #size-cells = <0>; ··· 276 119 gpio-reserved-ranges = <5 1>; 277 120 278 121 #pwm-cells = <3>; 122 + 123 + interrupts = <16 IRQ_TYPE_EDGE_FALLING>; 124 + interrupt-parent = <&gpio>; 125 + 126 + adi,reset1-events = <1 43>; 127 + adi,reset2-events = <2 3>; 128 + adi,reset-trigger-ms = <2000>; 129 + 130 + /* 131 + * col0, col1, col2 132 + * row0, row1, row2 133 + */ 134 + adi,keypad-pins = <0 1 2 6 7 8>; 135 + 136 + linux,keymap = < 137 + MATRIX_KEY(0x00, 0x00, KEY_1) 138 + MATRIX_KEY(0x00, 0x01, KEY_2) 139 + MATRIX_KEY(0x00, 0x02, KEY_3) 140 + 141 + MATRIX_KEY(0x01, 0x00, KEY_A) 142 + MATRIX_KEY(0x01, 0x01, KEY_B) 143 + MATRIX_KEY(0x01, 0x02, KEY_C) 144 + 145 + MATRIX_KEY(0x02, 0x00, BTN_1) 146 + MATRIX_KEY(0x02, 0x01, BTN_2) 147 + MATRIX_KEY(0x02, 0x02, BTN_3) 148 + >; 279 149 }; 280 150 }; 281 151