Skip to content

Commit

Permalink
Input: phytium-keypad: Add Phytium keypad driver
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Hu Yeqing committed May 24, 2024
1 parent 255e26b commit 183cdef
Show file tree
Hide file tree
Showing 4 changed files with 645 additions and 0 deletions.
64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/input/phytium,keypad.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/phytium,keypad.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Phytium Keypad Port

maintainers:
- Chen Baozi <[email protected]>

allOf:
- $ref: "/schemas/input/matrix-keymap.yaml#"

description: |
The keypad port is designed to interface with a keypad matrix, which
simplify the software task of scanning a keypad matrix. It is capable
of detecting, debouncing, and decoding one or multiple keys pressed
simultaneously on a keypad.
properties:
compatible:
- const: phytium,keypad

reg:
maxItems: 1

interrupts:
maxItems: 1

required:
- compatible
- reg
- interrupts
- linux,keymap

unevaluatedProperties: false

examples:
- |
keypad: keypad@2807a000 {
compatible = "phytium,keypad";
reg = <0x 0x2807a000 0x0 0x1000>;
interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
keypad,num-rows = <4>;
keypad,num-columns = <4>;
linux,keymap = <0x00000067 /* KEY_UP */
0x0001006c /* KEY_DOWN */
0x00020072 /* KEY_VOLUMEDOWN */
0x00030066 /* KEY_HOME */
0x0100006a /* KEY_RIGHT */
0x01010069 /* KEY_LEFT */
0x0102001c /* KEY_ENTER */
0x01030073 /* KEY_VOLUMEUP */
0x02000040 /* KEY_F6 */
0x02010042 /* KEY_F8 */
0x02020043 /* KEY_F9 */
0x02030044 /* KEY_F10 */
0x0300003b /* KEY_F1 */
0x0301003c /* KEY_F2 */
0x0302003d /* KEY_F3 */
0x03030074>; /* KEY_POWER */
};
11 changes: 11 additions & 0 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -809,4 +809,15 @@ config KEYBOARD_CYPRESS_SF
To compile this driver as a module, choose M here: the
module will be called cypress-sf.

config KEYBOARD_PHYTIUM
tristate "Phytium keypad support"
depends on ARCH_PHYTIUM
select INPUT_MATRIXKMAP
help
Say Y here if you want to enable support for Phytium keypad
port.

To compile this driver as a module, choose M here: the
module will be called phytium_keypad.

endif
1 change: 1 addition & 0 deletions drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ obj-$(CONFIG_KEYBOARD_NSPIRE) += nspire-keypad.o
obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
obj-$(CONFIG_KEYBOARD_OMAP4) += omap4-keypad.o
obj-$(CONFIG_KEYBOARD_OPENCORES) += opencores-kbd.o
obj-$(CONFIG_KEYBOARD_PHYTIUM) += phytium-keypad.o
obj-$(CONFIG_KEYBOARD_PINEPHONE) += pinephone-keyboard.o
obj-$(CONFIG_KEYBOARD_PMIC8XXX) += pmic8xxx-keypad.o
obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o
Expand Down
Loading

0 comments on commit 183cdef

Please sign in to comment.