Skip to content

Commit e8ec34e

Browse files
JihedChaibidtor
authored andcommitted
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>
1 parent 3c29727 commit e8ec34e

2 files changed

Lines changed: 59 additions & 27 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
};

Documentation/devicetree/bindings/input/twl4030-keypad.txt

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)