diff mbox series

[26/43] dt-bindings: input: Add DT bindings ep93xx keypad

Message ID 20230424123522.18302-27-nikita.shubin@maquefel.me (mailing list archive)
State New, archived
Headers show
Series ep93xx device tree conversion | expand

Commit Message

Nikita Shubin April 24, 2023, 12:34 p.m. UTC
Add YAML bindings ep93xx SoC.

Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---

Notes:
    Linus Walleij:
    - replaced hex with proper <KEY_UP>, etc

 .../bindings/input/cirrus,ep93xx-keypad.yaml  | 123 ++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml

Comments

Rob Herring (Arm) April 24, 2023, 4:21 p.m. UTC | #1
On Mon, Apr 24, 2023 at 03:34:42PM +0300, Nikita Shubin wrote:
> Add YAML bindings ep93xx SoC.
> 
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> ---
> 
> Notes:
>     Linus Walleij:
>     - replaced hex with proper <KEY_UP>, etc
> 
>  .../bindings/input/cirrus,ep93xx-keypad.yaml  | 123 ++++++++++++++++++
>  1 file changed, 123 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml b/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml
> new file mode 100644
> index 000000000000..0310114de22e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml
> @@ -0,0 +1,123 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/cirrus,ep93xx-keypad.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cirrus ep93xx keypad
> +
> +maintainers:
> +  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
> +  - Alexander Sverdlin <alexander.sverdlin@gmail.com>
> +
> +allOf:
> +  - $ref: "/schemas/input/matrix-keymap.yaml#"

Drop quotes.

> +
> +description: |
> +  The KPP is designed to interface with a keypad matrix with 2-point contact
> +  or 3-point contact keys. The KPP is designed to simplify the software task
> +  of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
> +  and decoding one or multiple keys pressed simultaneously on a keypad.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - cirrus,ep9301-keypad
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    enum:
> +      - ep93xx-keypad
> +
> +  debounce:

I think we have a common property for this.

> +    description: |
> +          Time in microseconds that key must be pressed or
> +          released for state change interrupt to trigger.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +
> +  prescale:
> +    description: row/column counter pre-scaler load value
> +    $ref: /schemas/types.yaml#/definitions/uint32

constraints? Or 0-2^32 is valid?

> +
> +  clk-rate:

No, have standard bindings for this.

> +    description: clock rate setting
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +
> +  disable-3-key:

Needs a vendor prefix.

> +    type: boolean
> +    description:
> +      Disable 3 Key reset. Setting this disables the three key reset
> +      output to the watchdog reset block.
> +
> +  diag-mode:

Why do we need this in DT. Shouldn't this be a runtime setting.

> +    type: boolean
> +    description:
> +      Key scan diagnostic mode. Setting this allows key scanning to be
> +      directly controlled through the key register by writes from the
> +      ARM Core.
> +
> +  back-drive:

Needs a vendor prefix.

> +    type: boolean
> +    description:
> +      Key scan back driving enable. Setting this enables the key
> +      scanning logic to back drive the row and column pins of the
> +      chip high during the first two column counts in the
> +      row/column counter.
> +
> +  test-mode:

Why do we need this in DT. Shouldn't this be a runtime setting.

> +    type: boolean
> +    description:
> +      Test mode. When this is set, the counter RC_COUNT is advanced
> +      by 8 counts when EN is active. The effect is that only column 0
> +      is checked in each row. This test mode allows a faster test
> +      of the ROW pins.
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - linux,keymap
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/cirrus,ep93xx-clock.h>
> +    #include <dt-bindings/input/input.h>
> +    keypad@800f0000 {
> +        compatible = "cirrus,ep9301-keypad";
> +        reg = <0x800f0000 0x0c>;
> +        interrupt-parent = <&vic0>;
> +        interrupts = <29>;
> +        clocks = <&syscon EP93XX_CLK_KEYPAD>;
> +        clock-names = "ep93xx-keypad";
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&keypad_default_pins>;
> +        linux,keymap = <KEY_UP>,
> +                       <KEY_DOWN>,
> +                       <KEY_VOLUMEDOWN>,
> +                       <KEY_HOME>,
> +                       <KEY_RIGHT>,
> +                       <KEY_LEFT>,
> +                       <KEY_ENTER>,
> +                       <KEY_VOLUMEUP>,
> +                       <KEY_F6>,
> +                       <KEY_F8>,
> +                       <KEY_F9>,
> +                       <KEY_F10>,
> +                       <KEY_F1>,
> +                       <KEY_F2>,
> +                       <KEY_F3>,
> +                       <KEY_POWER>;
> +    };
> +
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml b/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml
new file mode 100644
index 000000000000..0310114de22e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml
@@ -0,0 +1,123 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/cirrus,ep93xx-keypad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cirrus ep93xx keypad
+
+maintainers:
+  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
+  - Alexander Sverdlin <alexander.sverdlin@gmail.com>
+
+allOf:
+  - $ref: "/schemas/input/matrix-keymap.yaml#"
+
+description: |
+  The KPP is designed to interface with a keypad matrix with 2-point contact
+  or 3-point contact keys. The KPP is designed to simplify the software task
+  of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
+  and decoding one or multiple keys pressed simultaneously on a keypad.
+
+properties:
+  compatible:
+    enum:
+      - cirrus,ep9301-keypad
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    enum:
+      - ep93xx-keypad
+
+  debounce:
+    description: |
+          Time in microseconds that key must be pressed or
+          released for state change interrupt to trigger.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  prescale:
+    description: row/column counter pre-scaler load value
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  clk-rate:
+    description: clock rate setting
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  disable-3-key:
+    type: boolean
+    description:
+      Disable 3 Key reset. Setting this disables the three key reset
+      output to the watchdog reset block.
+
+  diag-mode:
+    type: boolean
+    description:
+      Key scan diagnostic mode. Setting this allows key scanning to be
+      directly controlled through the key register by writes from the
+      ARM Core.
+
+  back-drive:
+    type: boolean
+    description:
+      Key scan back driving enable. Setting this enables the key
+      scanning logic to back drive the row and column pins of the
+      chip high during the first two column counts in the
+      row/column counter.
+
+  test-mode:
+    type: boolean
+    description:
+      Test mode. When this is set, the counter RC_COUNT is advanced
+      by 8 counts when EN is active. The effect is that only column 0
+      is checked in each row. This test mode allows a faster test
+      of the ROW pins.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - linux,keymap
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/cirrus,ep93xx-clock.h>
+    #include <dt-bindings/input/input.h>
+    keypad@800f0000 {
+        compatible = "cirrus,ep9301-keypad";
+        reg = <0x800f0000 0x0c>;
+        interrupt-parent = <&vic0>;
+        interrupts = <29>;
+        clocks = <&syscon EP93XX_CLK_KEYPAD>;
+        clock-names = "ep93xx-keypad";
+        pinctrl-names = "default";
+        pinctrl-0 = <&keypad_default_pins>;
+        linux,keymap = <KEY_UP>,
+                       <KEY_DOWN>,
+                       <KEY_VOLUMEDOWN>,
+                       <KEY_HOME>,
+                       <KEY_RIGHT>,
+                       <KEY_LEFT>,
+                       <KEY_ENTER>,
+                       <KEY_VOLUMEUP>,
+                       <KEY_F6>,
+                       <KEY_F8>,
+                       <KEY_F9>,
+                       <KEY_F10>,
+                       <KEY_F1>,
+                       <KEY_F2>,
+                       <KEY_F3>,
+                       <KEY_POWER>;
+    };
+