linux/Documentation/devicetree/bindings/input/adi,adp5588.yaml
Utsav Agarwal 739b847dbe 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>
2024-08-28 18:50:45 -07:00

140 lines
3.5 KiB
YAML

# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/adi,adp5588.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADP5588 Keypad Controller
maintainers:
- Nuno Sá <nuno.sa@analog.com>
description: |
Analog Devices Mobile I/O Expander and QWERTY Keypad Controller
https://www.analog.com/media/en/technical-documentation/data-sheets/ADP5588.pdf
allOf:
- $ref: matrix-keymap.yaml#
- $ref: input.yaml#
properties:
compatible:
enum:
- adi,adp5587
- adi,adp5588
reg:
maxItems: 1
vcc-supply:
description: Supply Voltage Input
reset-gpios:
description:
If specified, it will be asserted during driver probe. As the line is
active low, it should be marked GPIO_ACTIVE_LOW.
maxItems: 1
interrupts:
maxItems: 1
gpio-controller:
description:
This property applies if either keypad,num-rows lower than 8 or
keypad,num-columns lower than 10.
'#gpio-cells':
const: 2
interrupt-controller:
description:
This property applies if either keypad,num-rows lower than 8 or
keypad,num-columns lower than 10. This property is optional if
keypad,num-rows or keypad,num-columns are not specified as the
device is then configured to be used purely for gpio during which
interrupts may or may not be utilized.
'#interrupt-cells':
const: 2
adi,unlock-keys:
description:
Specifies a maximum of 2 keys that can be used to unlock the keypad.
If this property is set, the keyboard will be locked and only unlocked
after these keys are pressed. If only one key is set, a double click is
needed to unlock the keypad. The value of this property cannot be bigger
or equal than keypad,num-rows * keypad,num-columns.
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 2
dependencies:
keypad,num-rows:
- linux,keymap
- keypad,num-columns
keypad,num-columns:
- linux,keymap
- keypad,num-rows
linux,keymap:
- keypad,num-rows
- keypad,num-columns
- interrupts
interrupt-controller:
- interrupts
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
keys@34 {
compatible = "adi,adp5588";
reg = <0x34>;
vcc-supply = <&vcc>;
interrupts = <21 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio>;
reset-gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
keypad,num-rows = <1>;
keypad,num-columns = <9>;
linux,keymap = <
MATRIX_KEY(0x00, 0x00, KEY_1)
MATRIX_KEY(0x00, 0x01, KEY_2)
MATRIX_KEY(0x00, 0x02, KEY_3)
MATRIX_KEY(0x00, 0x03, KEY_4)
MATRIX_KEY(0x00, 0x04, KEY_5)
MATRIX_KEY(0x00, 0x05, KEY_6)
MATRIX_KEY(0x00, 0x06, KEY_7)
MATRIX_KEY(0x00, 0x07, KEY_8)
MATRIX_KEY(0x00, 0x08, KEY_9)
>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
gpio@34 {
compatible = "adi,adp5588";
reg = <0x34>;
#gpio-cells = <2>;
gpio-controller;
};
};
...