drivers: input: keyboard: add mediatek matrix keypad driver
Subsystems (3)
PATCH v2 1/1 drivers: input: keyboard: add mediatek matrix keypad driver
fengping.yu (2):
Documentation: devicetree: bindings: input
drivers: input: keyboard
.../devicetree/bindings/input/mtk-kpd.txt | 45 +++ arch/arm64/configs/defconfig | 1 + drivers/input/keyboard/Kconfig | 8 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-kpd.c | 357 ++++++++++++++++++ 5 files changed, 412 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txt create mode 100644 drivers/input/keyboard/mtk-kpd.c
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 1/2 Documentation: devicetree: bindings: input
From: "fengping.yu" <[email protected]>
Add mtk keypad device tree documentation.
--- .../devicetree/bindings/input/mtk-kpd.txt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txt
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +45 -0
@@ -0,0 +1,45 @@ +* Mediatek's Keypad Controller device tree binding + +Mediatek's Keypad controller is used to interface a SoC with a matrix-type +keypad device. The keypad controller supports multiple row and column lines. +A key can be placed at each intersection of a unique row and a unique column. +The keypad controller can sense a key-press and key-release and report the +event using a interrupt to the cpu. + +Required properties: +- compatible should contain: + * "mediatek,mt6779-keypad" for MT6779 keypad + * "mediatek,kp" for common keypad + +- reg: The base address of the Keypad register bank. + +- interrupts: A single interrupt specifier. + +- mediatek,key-debounce-ms: Debounce interval in milliseconds, maximum value + is 256ms + +- mediatek,hw-map-num: Number of entries of keycode in mediatek,hw-init-map + +- mediatek,hw-init-map: An array of packed 1-cell entries containing the + equivalent of hw-map-num linux key-code. Each cell is Linux keymap of + corresponding row/col, arrange like this: + + row0col0, row0col1, row0col2,...row0col8, + row1col0, row1col1, row1col2,...row1col8, + ... + row7col0, row7col1, row7col2,...row7col8. + +Example: + + keypad: kp@10010000 { + compatible = "mediatek,mt6779-keypad", "mediatek,kp"; + reg = <0 0x10010000 0 0x1000>; + interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>; + }; + + &keypad { + mediatek,key-debounce-ms = <1024>; + /*HW Keycode [0~71] -> Linux Keycode*/ + mediatek,khw-map-num = <72>; + mediatek,hw-init-map = <114 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >; + };
Signature · 5 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH V2 1/2] Documentation: devicetree: bindings: input
Hi, Fengping,
You missed several maintainers and mailing lists. Please use ./scripts/get_maintainer.pl to find proper maintainers & lists.
Bad summary, You can use git log --oneline to find proper summary. Maybe:
dt-bindings: input: keyboard: add MediaTek keypad controller binding
Quoted 5 lines · fengping yu
From: "fengping.yu" <[email protected]>
Add mtk keypad device tree documentation.
Change-Id: I415b76ee980784992763c768829b2dda76699dea
Please remove Change-Id
Quoted 43 lines
Signed-off-by fengping.yu <[email protected]>--- .../devicetree/bindings/input/mtk-kpd.txt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txtDocumentation/devicetree/bindings/input/mtk-kpd.txt new file +31
-0@@ -0,0 +1,45 @@ +* Mediatek's Keypad Controller device tree binding + +Mediatek's Keypad controller is used to interface a SoC with a matrix-type +keypad device. The keypad controller supports multiple row and column lines. +A key can be placed at each intersection of a unique row and a unique column. +The keypad controller can sense a key-press and key-release and report the +event using a interrupt to the cpu. + +Required properties: +- compatible should contain: + * "mediatek,mt6779-keypad" for MT6779 keypad + * "mediatek,kp" for common keypad + +- reg: The base address of the Keypad register bank. + +- interrupts: A single interrupt specifier. + +- mediatek,key-debounce-ms: Debounce interval in milliseconds, maximum value + is 256ms + +- mediatek,hw-map-num: Number of entries of keycode in mediatek,hw-init-map + +- mediatek,hw-init-map: An array of packed 1-cell entries containing the + equivalent of hw-map-num linux key-code. Each cell is Linux keymap of + corresponding row/col, arrange like this: + + row0col0, row0col1, row0col2,...row0col8, + row1col0, row1col1, row1col2,...row1col8, + ... + row7col0, row7col1, row7col2,...row7col8. +
Documentation/devicetree/bindings/input/mtk-kpd.txt line 41
Quoted 10 lines
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +10
-0+Example: + + keypad: kp@10010000 { + compatible = "mediatek,mt6779-keypad", "mediatek,kp"; + reg = <0 0x10010000 0 0x1000>; + interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>; + }; + + &keypad { + mediatek,key-debounce-ms = <1024>;
The maximum value is 256ms, why set it to 1024?
Documentation/devicetree/bindings/input/mtk-kpd.txt line 42
Quoted 1 line
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +1
-0+ /*HW Keycode [0~71] -> Linux Keycode*/
Don't need this line.
Documentation/devicetree/bindings/input/mtk-kpd.txt line 43
Quoted 1 line
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +1
-0+ mediatek,khw-map-num = <72>;
typo?
Documentation/devicetree/bindings/input/mtk-kpd.txt line 44
Quoted 1 line
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +1
-0+ mediatek,hw-init-map = <114 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >;
I think it make sense to arrange it as 9*8 array to make it shorter in lines and easier to find entries.
Joe.C
Documentation/devicetree/bindings/input/mtk-kpd.txt line 45
Quoted 1 line
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +1
-0+ };
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 2/2 drivers: input: keyboard
In reply to fengping yuFrom: "fengping.yu" <[email protected]>
add mtk keypad driver
--- arch/arm64/configs/defconfig | 1 + drivers/input/keyboard/Kconfig | 8 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-kpd.c | 357 +++++++++++++++++++++++++++++++ 4 files changed, 367 insertions(+) create mode 100644 drivers/input/keyboard/mtk-kpd.c
arch/arm64/configs/defconfig +1 -0
@@ -315,6 +315,7 @@ CONFIG_KEYBOARD_ADC=m CONFIG_KEYBOARD_GPIO=y CONFIG_KEYBOARD_SNVS_PWRKEY=m CONFIG_KEYBOARD_CROS_EC=y +CONFIG_KEYBOARD_MTK=y CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ATMEL_MXT=m CONFIG_INPUT_MISC=y
drivers/input/keyboard/Kconfig +8 -0
@@ -775,4 +775,12 @@ config KEYBOARD_MTK_PMIC To compile this driver as a module, choose M here: the module will be called pmic-keys. +config KEYBOARD_MTK + tristate "MediaTek Keypad Support" + help + Say Y here if you want to use the keypad. + If unuse, say N. + To compile this driver as a module, choose M here: the + module will be called mtk-kpd. + endif
drivers/input/keyboard/Makefile +1 -0
@@ -41,6 +41,7 @@ obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o obj-$(CONFIG_KEYBOARD_MAX7359) += max7359_keypad.o obj-$(CONFIG_KEYBOARD_MCS) += mcs_touchkey.o obj-$(CONFIG_KEYBOARD_MPR121) += mpr121_touchkey.o +obj-$(CONFIG_KEYBOARD_MTK) += mtk-kpd.o obj-$(CONFIG_KEYBOARD_MTK_PMIC) += mtk-pmic-keys.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o obj-$(CONFIG_KEYBOARD_NOMADIK) += nomadik-ske-keypad.o
drivers/input/keyboard/mtk-kpd.c new file +357 -0
357 lines not on this page · raw message
Signature · 5 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek