Skip to content

Commit d61dbba

Browse files
Hu YeqingAvenger-285714
authored andcommitted
Input: phytium-keypad: Add Phytium keypad driver
This patch adds support for Phytium keypad controller driver on Phytium SoCs. Signed-off-by: Song Wenting <[email protected]> Signed-off-by: Peng Min <[email protected]> Signed-off-by: Chen Baozi <[email protected]> Signed-off-by: Lan Hengyu <[email protected]> Signed-off-by: Wang Yinfeng <[email protected]> Signed-off-by: Hu Yeqing <[email protected]>
1 parent 0412ee0 commit d61dbba

File tree

4 files changed

+645
-0
lines changed

4 files changed

+645
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/input/phytium,keypad.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Phytium Keypad Port
8+
9+
maintainers:
10+
- Chen Baozi <[email protected]>
11+
12+
allOf:
13+
- $ref: "/schemas/input/matrix-keymap.yaml#"
14+
15+
description: |
16+
The keypad port is designed to interface with a keypad matrix, which
17+
simplify the software task of scanning a keypad matrix. It is capable
18+
of detecting, debouncing, and decoding one or multiple keys pressed
19+
simultaneously on a keypad.
20+
21+
22+
properties:
23+
compatible:
24+
- const: phytium,keypad
25+
26+
reg:
27+
maxItems: 1
28+
29+
interrupts:
30+
maxItems: 1
31+
32+
required:
33+
- compatible
34+
- reg
35+
- interrupts
36+
- linux,keymap
37+
38+
unevaluatedProperties: false
39+
40+
examples:
41+
- |
42+
keypad: keypad@2807a000 {
43+
compatible = "phytium,keypad";
44+
reg = <0x 0x2807a000 0x0 0x1000>;
45+
interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
46+
keypad,num-rows = <4>;
47+
keypad,num-columns = <4>;
48+
linux,keymap = <0x00000067 /* KEY_UP */
49+
0x0001006c /* KEY_DOWN */
50+
0x00020072 /* KEY_VOLUMEDOWN */
51+
0x00030066 /* KEY_HOME */
52+
0x0100006a /* KEY_RIGHT */
53+
0x01010069 /* KEY_LEFT */
54+
0x0102001c /* KEY_ENTER */
55+
0x01030073 /* KEY_VOLUMEUP */
56+
0x02000040 /* KEY_F6 */
57+
0x02010042 /* KEY_F8 */
58+
0x02020043 /* KEY_F9 */
59+
0x02030044 /* KEY_F10 */
60+
0x0300003b /* KEY_F1 */
61+
0x0301003c /* KEY_F2 */
62+
0x0302003d /* KEY_F3 */
63+
0x03030074>; /* KEY_POWER */
64+
};

drivers/input/keyboard/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,4 +809,15 @@ config KEYBOARD_CYPRESS_SF
809809
To compile this driver as a module, choose M here: the
810810
module will be called cypress-sf.
811811

812+
config KEYBOARD_PHYTIUM
813+
tristate "Phytium keypad support"
814+
depends on ARCH_PHYTIUM
815+
select INPUT_MATRIXKMAP
816+
help
817+
Say Y here if you want to enable support for Phytium keypad
818+
port.
819+
820+
To compile this driver as a module, choose M here: the
821+
module will be called phytium_keypad.
822+
812823
endif

drivers/input/keyboard/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ obj-$(CONFIG_KEYBOARD_NSPIRE) += nspire-keypad.o
5151
obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
5252
obj-$(CONFIG_KEYBOARD_OMAP4) += omap4-keypad.o
5353
obj-$(CONFIG_KEYBOARD_OPENCORES) += opencores-kbd.o
54+
obj-$(CONFIG_KEYBOARD_PHYTIUM) += phytium-keypad.o
5455
obj-$(CONFIG_KEYBOARD_PINEPHONE) += pinephone-keyboard.o
5556
obj-$(CONFIG_KEYBOARD_PMIC8XXX) += pmic8xxx-keypad.o
5657
obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o

0 commit comments

Comments
 (0)