Add support for MediaTek keypad
Subsystems (3)
PATCH v3 1/1 Add support for MediaTek keypad
This patchset add support to MediaTek matrix keypad.
Change since V2:
- remove extra space and redundant lines
- update keypad devicetree document debounce time unit
- change to use devm_platform_ioremap_resource() to simplify resource management
- use bitmap to store and check keypad state
fengping.yu (2):
add dt-binding document for MediaTek Keypad
add MediaTek keypad driver
.../devicetree/bindings/input/mtk-kpd.txt | 61 +++++ arch/arm64/configs/defconfig | 1 + drivers/input/keyboard/Kconfig | 7 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-kpd.c | 258 ++++++++++++++++++ 5 files changed, 328 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txt create mode 100644 drivers/input/keyboard/mtk-kpd.c
--
2.18.0
PATCH v3 1/2 add dt-binding document for MediaTek Keypad
From: "fengping.yu" <[email protected]>
--- .../devicetree/bindings/input/mtk-kpd.txt | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txt
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +61 -0
@@ -0,0 +1,61 @@ +* 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,kp" for common keypad + * "mediatek,mt6779-keypad" for specific keypad chip + +- reg: The base address of the Keypad register bank. + +- interrupts: A single interrupt specifier. + +- mediatek,debounce-us: Debounce interval in microseconds, maximum value + is 256000 microseconds. + +- keypad,num-rows: Number of row lines connected to the keypad controller, it is + not equal to PCB rows number, instead you should add required value for each IC. + +- keypad,num-columns: Number of column lines connected to the keypad controller, + it is not equal to PCB columns number, instead you should add required value + for each IC. + +- linux,keymap: The keymap for keys as described in the binding document + devicetree/bindings/input/matrix-keymap.txt. + +- pinctrl: Should specify pin control groups used for this controller. + See ../pinctrl/pinctrl-bindings.txt for details. + +- clocks: Must contain one entry, for the module clock. + See ../clocks/clock-bindings.txt for details. + +- clock-names: Names of the clocks listed in clocks property in the same order. + +Optional Properties: +- wakeup-source: use any event on keypad as wakeup event. + +Example: + + keypad: kp@10010000 { + compatible = "mediatek,kp"; + reg = <0 0x10010000 0 0x1000>; + wakeup-source; + interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>; + clocks = <&clk26m>; + clock-names = "kpd"; + }; + + &keypad { + mediatek,debounce-us = <32000>; + keypad,num-rows = <8>; + keypad,num-columns = <9>; + linux,keymap = < MATRIX_KEY(0x00, 0x00, KEY_VOLUMEDOWN) >; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&kpd_gpios_def_cfg>; + };
Signature · 5 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v3 1/2] add dt-binding document for MediaTek Keypad
Fengping,
I think this is V4, you sent v3 in
http://lists.infradead.org/pipermail/linux-mediatek/2020-January/026390.html
Quoted 1 line · Fengping yu
From: "fengping.yu" <[email protected]>
This is a regression, please restore commit message (including first line).
Many of my comments in previous version are not addressed. Please either change according to comment, or discuss why you think you shouldn't.
Joe.C
Quoted 64 lines
Signed-off-by fengping.yu <[email protected]>--- .../devicetree/bindings/input/mtk-kpd.txt | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txtDocumentation/devicetree/bindings/input/mtk-kpd.txt new file +51
-0@@ -0,0 +1,61 @@ +* 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,kp" for common keypad + * "mediatek,mt6779-keypad" for specific keypad chip + +- reg: The base address of the Keypad register bank. + +- interrupts: A single interrupt specifier. + +- mediatek,debounce-us: Debounce interval in microseconds, maximum value + is 256000 microseconds. + +- keypad,num-rows: Number of row lines connected to the keypad controller, it is + not equal to PCB rows number, instead you should add required value for each IC. + +- keypad,num-columns: Number of column lines connected to the keypad controller, + it is not equal to PCB columns number, instead you should add required value + for each IC. + +- linux,keymap: The keymap for keys as described in the binding document + devicetree/bindings/input/matrix-keymap.txt. + +- pinctrl: Should specify pin control groups used for this controller. + See ../pinctrl/pinctrl-bindings.txt for details. + +- clocks: Must contain one entry, for the module clock. + See ../clocks/clock-bindings.txt for details. + +- clock-names: Names of the clocks listed in clocks property in the same order. + +Optional Properties: +- wakeup-source: use any event on keypad as wakeup event. + +Example: + + keypad: kp@10010000 { + compatible = "mediatek,kp"; + reg = <0 0x10010000 0 0x1000>; + wakeup-source; + interrupts = <GIC_SPI 75 IRQ_TYPE_EDGE_FALLING>; + clocks = <&clk26m>; + clock-names = "kpd"; + };
Documentation/devicetree/bindings/input/mtk-kpd.txt line 61
Quoted 10 lines
Documentation/devicetree/bindings/input/mtk-kpd.txt new file +10
-0+ + &keypad { + mediatek,debounce-us = <32000>; + keypad,num-rows = <8>; + keypad,num-columns = <9>; + linux,keymap = < MATRIX_KEY(0x00, 0x00, KEY_VOLUMEDOWN) >; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&kpd_gpios_def_cfg>; + };
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v3 2/2 add MediaTek keypad driver
In reply to Fengping yuFrom: "fengping.yu" <[email protected]>
--- arch/arm64/configs/defconfig | 1 + drivers/input/keyboard/Kconfig | 7 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-kpd.c | 258 +++++++++++++++++++++++++++++++ 4 files changed, 267 insertions(+) create mode 100644 drivers/input/keyboard/mtk-kpd.c
arch/arm64/configs/defconfig +1 -0
@@ -316,6 +316,7 @@ CONFIG_KEYBOARD_GPIO=y CONFIG_KEYBOARD_SNVS_PWRKEY=m CONFIG_KEYBOARD_IMX_SC_KEY=m CONFIG_KEYBOARD_CROS_EC=y +CONFIG_KEYBOARD_MTK_KPD=y CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ATMEL_MXT=m CONFIG_INPUT_MISC=y
drivers/input/keyboard/Kconfig +7 -0
@@ -772,6 +772,13 @@ config KEYBOARD_BCM To compile this driver as a module, choose M here: the module will be called bcm-keypad. +config KEYBOARD_MTK_KPD + 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. config KEYBOARD_MTK_PMIC tristate "MediaTek PMIC keys support" depends on MFD_MT6397
drivers/input/keyboard/Makefile +1 -0
@@ -42,6 +42,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_KPD) += 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 +258 -0
258 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
Quoted 2 lines · Fengping yu
This patchset add support to MediaTek matrix keypad.
Seems it has not addressed comments I gave.
Quoted 23 lines
Change since V2:
- remove extra space and redundant lines
- update keypad devicetree document debounce time unit
- change to usedevm_platform_ioremap_resource()to simplify resource management
- use bitmap to store and check keypad statefengping.yu (2):
add dt-binding document for MediaTek Keypad
add MediaTek keypad driver.../devicetree/bindings/input/mtk-kpd.txt | 61 +++++ arch/arm64/configs/defconfig | 1 + drivers/input/keyboard/Kconfig | 7 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mtk-kpd.c | 258 ++++++++++++++++++ 5 files changed, 328 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mtk-kpd.txt create mode 100644 drivers/input/keyboard/mtk-kpd.c--
2.18.0
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek