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

dt-bindings: input: pure gpio support for adp5588

Adding software support for enabling the pure gpio capability of the
device - which allows all I/O to be used as GPIO. Previously, I/O
configuration was limited by software to partial GPIO support only.

When working in a pure gpio mode, the device does not require the
certain properties and hence, the following are now made optional:
- interrupts
- keypad,num-rows
- keypad,num-columns
- linux,keymap

However, note that the above are required to be specified when
configuring the device as a keypad, for which dependencies have been added
such that specifying either one requires the remaining as well.

Also, note that interrupts are made optional, but required when the device
has either been configured in keypad mode or as an interrupt controller.
This has been done since they may not necessarily be used when leveraging
the device purely for GPIO.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Link: https://lore.kernel.org/r/20240826-adp5588_gpio_support-v11-3-3e5ac2bd31b7@analog.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Utsav Agarwal and committed by
Dmitry Torokhov
739b847d dc748812

+33 -5
+33 -5
Documentation/devicetree/bindings/input/adi,adp5588.yaml
··· 49 49 interrupt-controller: 50 50 description: 51 51 This property applies if either keypad,num-rows lower than 8 or 52 - keypad,num-columns lower than 10. 52 + keypad,num-columns lower than 10. This property is optional if 53 + keypad,num-rows or keypad,num-columns are not specified as the 54 + device is then configured to be used purely for gpio during which 55 + interrupts may or may not be utilized. 53 56 54 57 '#interrupt-cells': 55 58 const: 2 ··· 68 65 minItems: 1 69 66 maxItems: 2 70 67 68 + dependencies: 69 + keypad,num-rows: 70 + - linux,keymap 71 + - keypad,num-columns 72 + keypad,num-columns: 73 + - linux,keymap 74 + - keypad,num-rows 75 + linux,keymap: 76 + - keypad,num-rows 77 + - keypad,num-columns 78 + - interrupts 79 + interrupt-controller: 80 + - interrupts 81 + 71 82 required: 72 83 - compatible 73 84 - reg 74 - - interrupts 75 - - keypad,num-rows 76 - - keypad,num-columns 77 - - linux,keymap 78 85 79 86 unevaluatedProperties: false 80 87 ··· 121 108 >; 122 109 }; 123 110 }; 111 + 112 + - | 113 + #include <dt-bindings/gpio/gpio.h> 114 + i2c { 115 + #address-cells = <1>; 116 + #size-cells = <0>; 117 + gpio@34 { 118 + compatible = "adi,adp5588"; 119 + reg = <0x34>; 120 + 121 + #gpio-cells = <2>; 122 + gpio-controller; 123 + }; 124 + }; 125 + 124 126 ...