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

dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq

Allow configuring an optional dedicated wakeirq for gpio-keys that
some SoCs have.

Let's use the common interrupt naming "irq" and "wakeup" that we already
have in use for some drivers and subsystems like i2c framework.

Note that the gpio-keys interrupt property is optional. If only a gpio
property is specified, the driver tries to translate the gpio into an
interrupt.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231129110618.27551-1-tony@atomide.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Tony Lindgren and committed by
Dmitry Torokhov
d2ff98b7 a42b4bd5

+40 -1
+40 -1
Documentation/devicetree/bindings/input/gpio-keys.yaml
··· 31 31 maxItems: 1 32 32 33 33 interrupts: 34 - maxItems: 1 34 + oneOf: 35 + - items: 36 + - description: Optional key interrupt or wakeup interrupt 37 + - items: 38 + - description: Key interrupt 39 + - description: Wakeup interrupt 40 + 41 + interrupt-names: 42 + description: 43 + Optional interrupt names, can be used to specify a separate dedicated 44 + wake-up interrupt in addition to the gpio irq 45 + oneOf: 46 + - items: 47 + - enum: [ irq, wakeup ] 48 + - items: 49 + - const: irq 50 + - const: wakeup 35 51 36 52 label: 37 53 description: Descriptive name of the key. ··· 113 97 - required: 114 98 - gpios 115 99 100 + allOf: 101 + - if: 102 + properties: 103 + interrupts: 104 + minItems: 2 105 + required: 106 + - interrupts 107 + then: 108 + properties: 109 + interrupt-names: 110 + minItems: 2 111 + required: 112 + - interrupt-names 113 + 116 114 dependencies: 117 115 wakeup-event-action: [ wakeup-source ] 118 116 linux,input-value: [ gpios ] ··· 166 136 label = "GPIO Key DOWN"; 167 137 linux,code = <108>; 168 138 interrupts = <1 IRQ_TYPE_EDGE_FALLING>; 139 + }; 140 + 141 + key-wakeup { 142 + label = "GPIO Key WAKEUP"; 143 + linux,code = <143>; 144 + interrupts-extended = <&intc 2 IRQ_TYPE_EDGE_FALLING>, 145 + <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; 146 + interrupt-names = "irq", "wakeup"; 147 + wakeup-source; 169 148 }; 170 149 }; 171 150