On Tue, Oct 22, 2024 at 06:31:57AM +0000, mjchen wrote:Sorry, I will remember to run checkpatch.pl before uploading the
From: mjchen <mjchen@xxxxxxxxxxx>Please run scripts/checkpatch.pl and fix reported warnings. Then please
Add YAML bindings for MA35D1 SoC keypad.
Signed-off-by: mjchen <mjchen@xxxxxxxxxxx>
---
.../bindings/input/nvt,ma35d1-keypad.yaml | 88 +++++++++++++++++++
1 file changed, 88 insertions(+)
create mode 100755 Documentation/devicetree/bindings/input/nvt,ma35d1-keypad.yaml
run 'scripts/checkpatch.pl --strict' and (probably) fix more warnings.
Some warnings can be ignored, especially from --strict run, but the code
here looks like it needs a fix. Feel free to get in touch if the warning
is not clear.
I will modify it to: nuvoton,ma35d1-keypad.yamldiff --git a/Documentation/devicetree/bindings/input/nvt,ma35d1-keypad.yaml b/Documentation/devicetree/bindings/input/nvt,ma35d1-keypad.yamlFilename based on compatible. There is no nvt prefix. Entire filename is
new file mode 100755
index 000000000000..3d9fc26cc132
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/nvt,ma35d1-keypad.yaml
somehowdifferent than compatible.
I will change NVT to Nuvoton@@ -0,0 +1,88 @@NVT? Nuvoton?
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/nvt,ma35d1-keypad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVT MA35D1 Keypad
I will update the definition to specify the debounce period in terms of keypad IP clock cycles, as follow:
+Missing vendor prefix... or why are you not using existing properties?
+maintainers:
+ - Ming-jen Chen <mjchen0829@xxxxxxxxx>
+
+allOf:
+ - $ref: /schemas/input/matrix-keymap.yaml#
+
+properties:
+ compatible:
+ const: nuvoton,ma35d1-kpi
+
+ debounce-period:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |select? or clock cycles? I don't understand this. Say something useful
+ key debounce period select
here.
+ 0 = 0 clockHeh? So this is just 0
+ 1 = 0 clock
+ 2 = 0 clock
+ 3 = 8 clocksThis is 8
+ 4 = 16 clocks16, not 4
+ 5 = 32 clocksUse proper enum
+ 6 = 64 clocks
+ 7 = 128 clocks
+ 8 = 256 clocks
+ 9 = 512 clocks
+ 10 = 1024 clocks
+ 11 = 2048 clocks
+ 12 = 4096 clocks
+ 13 = 8192 clocks
pre-scale:
+Missing constraints
+ per-scale:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Row Scan Cycle Pre-scale Value (1 to 256).
+Missing constraints
+ per-scalediv:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Per-scale divider (1 to 256).
Both properties are unexpected... aren't you duplicating existing
properties?
I will modify it to: keypad@404a0000 {
+Lowercase hex and drop the unused label
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - linux,keymap
+ - debounce-period
+ - per-scale
+ - per-scalediv
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/input/input.h>
+ keypad: keypad@404A0000 {
I will modify it to: reg = <0x404a0000 0x10000>
+ compatible = "nuvoton,ma35d1-kpi";Lowercase hex
+ reg = <0x404A0000 0x10000>;
Thank you for your guidance!
Best regards,
Krzysztof