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

dt-bindings: input: ti,twl4030-keypad: convert to DT schema

Convert the legacy TXT binding for the TWL4030 keypad module
to the modern YAML DT schema format. This adds formal validation
and improves documentation by inheriting from the matrix-keymap schema.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250819222823.157943-1-jihed.chaibi.dev@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jihed Chaibi and committed by
Dmitry Torokhov
e8ec34ed 3c297278

+59 -27
+59
Documentation/devicetree/bindings/input/ti,twl4030-keypad.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/ti,twl4030-keypad.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments TWL4030-family Keypad Controller 8 + 9 + maintainers: 10 + - Peter Ujfalusi <peter.ujfalusi@gmail.com> 11 + 12 + description: 13 + TWL4030's Keypad controller is used to interface a SoC with a matrix-type 14 + keypad device. The keypad controller supports multiple row and column lines. 15 + A key can be placed at each intersection of a unique row and a unique column. 16 + The keypad controller can sense a key-press and key-release and report the 17 + event using a interrupt to the cpu. 18 + 19 + allOf: 20 + - $ref: matrix-keymap.yaml# 21 + 22 + properties: 23 + compatible: 24 + const: ti,twl4030-keypad 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + required: 30 + - compatible 31 + - interrupts 32 + - keypad,num-rows 33 + - keypad,num-columns 34 + - linux,keymap 35 + 36 + unevaluatedProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/input/input.h> 41 + 42 + keypad { 43 + compatible = "ti,twl4030-keypad"; 44 + interrupts = <1>; 45 + keypad,num-rows = <8>; 46 + keypad,num-columns = <8>; 47 + linux,keymap = < 48 + /* row 0 */ 49 + MATRIX_KEY(0, 0, KEY_1) 50 + MATRIX_KEY(0, 1, KEY_2) 51 + MATRIX_KEY(0, 2, KEY_3) 52 + 53 + /* ...and so on for a full 8x8 matrix... */ 54 + 55 + /* row 7 */ 56 + MATRIX_KEY(7, 6, KEY_Y) 57 + MATRIX_KEY(7, 7, KEY_Z) 58 + >; 59 + };
-27
Documentation/devicetree/bindings/input/twl4030-keypad.txt
··· 1 - * TWL4030's Keypad Controller device tree bindings 2 - 3 - TWL4030's Keypad controller is used to interface a SoC with a matrix-type 4 - keypad device. The keypad controller supports multiple row and column lines. 5 - A key can be placed at each intersection of a unique row and a unique column. 6 - The keypad controller can sense a key-press and key-release and report the 7 - event using a interrupt to the cpu. 8 - 9 - This binding is based on the matrix-keymap binding with the following 10 - changes: 11 - 12 - * keypad,num-rows and keypad,num-columns are required. 13 - 14 - Required SoC Specific Properties: 15 - - compatible: should be one of the following 16 - - "ti,twl4030-keypad": For controllers compatible with twl4030 keypad 17 - controller. 18 - - interrupt: should be one of the following 19 - - <1>: For controllers compatible with twl4030 keypad controller. 20 - 21 - Example: 22 - twl_keypad: keypad { 23 - compatible = "ti,twl4030-keypad"; 24 - interrupts = <1>; 25 - keypad,num-rows = <8>; 26 - keypad,num-columns = <8>; 27 - };