Add support for nuvoton ma35d1 keypad controller
Subsystems (4)
v5 cover Add support for nuvoton ma35d1 keypad controller
From: Ming-jen Chen <[email protected]>
This patch series adds keypad driver for the nuvoton ma35 ARMv8 SoC. It includes DT binding documentation and the ma35d1 keypad driver.
v5:
- Update nuvoton,ma35d1-keypad.yaml
- Reorders the items in the properties and required blocks to ensure their order and items are consistent.
v4:
- Update nuvoton,ma35d1-keypad.yaml
- Kept the same order of properties as in the required block.
- Changed register addresses to lowercase.
v3:
- Update nuvoton,ma35d1-keypad.yaml
- Removed vendor-specific properties and replaced them with common properties
- Update ma35d1_keypad.c
- Modified the driver to reflect changes in the YAML properties
v2:
- Update nuvoton,ma35d1-keypad.yaml
- Fixed warnings and errors generated by running checkpatch.pl
- Removed the previous version's properties and rewrote the properties in the Device Tree schema.
- Renamed the Device Tree binding file to nuvoton,ma35d1-keypad.yaml
- Update Kconfig
- Added COMPILE_TEST to the depends on line in the Kconfig
- Update ma35d1_keypad.c
- Refactored error handling within the probe function.
- Fixed the mixed use of devm and non-devm resource management.
- Corrected alignment issues in the code.
- Updated suspend and resume handling methods.
- Fixed variable naming to remove camel casing.
- Used for_each_set_bit() to check key states.
- Modified the code to align with updates in the device tree binding
Ming-jen Chen (2):
dt-bindings: input: Add Nuvoton MA35D1 keypad
input: keypad: add new keypad driver for MA35D1
.../bindings/input/nuvoton,ma35d1-keypad.yaml | 82 ++++ drivers/input/keyboard/Kconfig | 10 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/ma35d1_keypad.c | 387 ++++++++++++++++++ 4 files changed, 480 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml create mode 100644 drivers/input/keyboard/ma35d1_keypad.c
Signature · 1 line
2.25.1
PATCH v5 1/2 dt-bindings: input: Add Nuvoton MA35D1 keypad
From: Ming-jen Chen <[email protected]>
Add YAML bindings for MA35D1 SoC keypad.
--- .../bindings/input/nuvoton,ma35d1-keypad.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml new file +82 -0
@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/nuvoton,ma35d1-keypad.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton MA35D1 Keypad + +maintainers: + - Ming-jen Chen <[email protected]> + +allOf: + - $ref: /schemas/input/matrix-keymap.yaml# + +properties: + compatible: + const: nuvoton,ma35d1-kpi + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + linux,keymap: + description: Keymap for the keypad. + + keypad,num-rows: + description: Number of rows in the keypad. + minimum: 2 + maximum: 8 + + keypad,num-columns: + description: Number of columns in the keypad. + minimum: 1 + maximum: 8 + + debounce-delay-ms: + description: Debounce delay time in milliseconds. + maxItems: 1 + + scan-interval-ms: + description: Scan interval time in milliseconds. + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - linux,keymap + - keypad,num-rows + - keypad,num-columns + - debounce-delay-ms + - scan-interval-ms + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/input/input.h> + keypad@404a0000 { + compatible = "nuvoton,ma35d1-kpi"; + reg = <0x404a0000 0x10000>; + interrupts = <79>; + clocks = <&clk>; + keypad,num-rows = <2>; + keypad,num-columns = <2>; + + linux,keymap = < + MATRIX_KEY(0, 0, KEY_ENTER) + MATRIX_KEY(0, 1, KEY_ENTER) + MATRIX_KEY(1, 0, KEY_SPACE) + MATRIX_KEY(1, 1, KEY_Z) + >; + + debounce-delay-ms = <1>; + scan-interval-ms = <20>; + };
Signature · 1 line
2.25.1
Re: [PATCH v5 1/2] dt-bindings: input: Add Nuvoton MA35D1 keypad
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml
Quoted 15 lines · Ming-Jen
From: Ming-jen Chen <[email protected]>
Add YAML bindings for MA35D1 SoC keypad.
Signed-off-by Ming-jen Chen <[email protected]>--- .../bindings/input/nuvoton,ma35d1-keypad.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yamlDocumentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml new file +0
-0
I don't see changes.
I already raised concern that you sent new versions without implementing or responding to comments. So the fourth (!!!) time: Filename matching compatible.
Best regards,
Krzysztof
Re: [PATCH v5 1/2] dt-bindings: input: Add Nuvoton MA35D1 keypad
Krzysztof Kozlowski 於 2025/1/8 16:13 寫道:
Quoted 18 lines · Ming-Jen
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml
Quoted 15 lines
From: Ming-jen Chen <[email protected]>
Add YAML bindings for MA35D1 SoC keypad.
Signed-off-by Ming-jen Chen <[email protected]>--- .../bindings/input/nuvoton,ma35d1-keypad.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+)create mode 100644
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yamlDocumentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml new file +0
-0I don't see changes.
Quoted 6 lines
I already raised concern that you sent new versions without implementing or responding to comments. So the fourth (!!!) time: Filename matching compatible.
Best regards,
Krzysztof
Thank you for your feedback! I now understand the changes I need to make.
I will modify it as blow:
compatible:
const: nuvoton,ma35d1-keypad
Re: [PATCH v5 1/2] dt-bindings: input: Add Nuvoton MA35D1 keypad
Quoted 27 lines · Ming-Jen Chen
Krzysztof Kozlowski 於 2025/1/8 16:13 寫道:
Quoted 18 lines · Ming-Jen
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml
Quoted 15 lines
From: Ming-jen Chen <[email protected]>
Add YAML bindings for MA35D1 SoC keypad.
Signed-off-by Ming-jen Chen <[email protected]>--- .../bindings/input/nuvoton,ma35d1-keypad.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+)create mode 100644
Documentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yamlDocumentation/devicetree/bindings/input/nuvoton,ma35d1-keypad.yaml new file +0
-0I don't see changes.
Quoted 6 lines
I already raised concern that you sent new versions without implementing or responding to comments. So the fourth (!!!) time: Filename matching compatible.
Best regards,
Krzysztof
Quoted 6 lines
Thank you for your feedback! I now understand the changes I need to make.
I will modify it as blow:
compatible:
const: nuvoton,ma35d1-keypad
Or change the filename...
Best regards,
Krzysztof
PATCH v5 2/2 input: keypad: add new keypad driver for MA35D1
In reply to Ming-JenFrom: Ming-jen Chen <[email protected]>
Adds a new keypad driver for the MA35D1 platform. The driver supports key scanning and interrupt handling.
--- drivers/input/keyboard/Kconfig | 10 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/ma35d1_keypad.c | 387 +++++++++++++++++++++++++ 3 files changed, 398 insertions(+) create mode 100644 drivers/input/keyboard/ma35d1_keypad.c
drivers/input/keyboard/Kconfig +10 -0
@@ -797,4 +797,14 @@ config KEYBOARD_CYPRESS_SF To compile this driver as a module, choose M here: the module will be called cypress-sf. +config KEYBOARD_MA35D1 + tristate "Nuvoton MA35D1 keypad driver" + depends on ARCH_MA35 || COMPILE_TEST + select INPUT_MATRIXKMAP + help + Say Y here if you want to use Nuvoton MA35D1 keypad. + + To compile this driver as a module, choose M here: the + module will be called ma35d1-keypad. + endif
drivers/input/keyboard/Makefile +1 -0
@@ -70,3 +70,4 @@ obj-$(CONFIG_KEYBOARD_TEGRA) += tegra-kbc.o obj-$(CONFIG_KEYBOARD_TM2_TOUCHKEY) += tm2-touchkey.o obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o +obj-$(CONFIG_KEYBOARD_MA35D1) += ma35d1_keypad.o
drivers/input/keyboard/ma35d1_keypad.c new file +387 -0
387 lines not on this page · raw message
Signature · 1 line
2.25.1