Commit 0883f1d8 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Dmitry Torokhov
Browse files

dt-bindings: input: samsung,s3c6410-keypad: convert to DT Schema



Convert Samsung SoC Keypad bindings to DT schema with changes:
1. Rename "linux,keypad-no-autorepeat" property to
   "linux,input-no-autorepeat", because the latter was implemented in
   the Linux driver.
2. Add clocks and clock-names, already used by DTS and the Linux driver.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240312183001.714626-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2d77f70b
Loading
Loading
Loading
Loading
+121 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/samsung,s3c6410-keypad.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung SoC series Keypad Controller

description:
  Samsung SoC 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.

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

properties:
  compatible:
    enum:
      - samsung,s3c6410-keypad
      - samsung,s5pv210-keypad

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: keypad

  interrupts:
    maxItems: 1

  wakeup-source: true

  linux,input-no-autorepeat:
    type: boolean
    description:
      Do no enable autorepeat feature.

  linux,input-wakeup:
    type: boolean
    deprecated: true

  samsung,keypad-num-columns:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Number of column lines connected to the keypad controller.

  samsung,keypad-num-rows:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Number of row lines connected to the keypad controller.

patternProperties:
  '^key-[0-9a-z]+$':
    type: object
    $ref: input.yaml#
    additionalProperties: false
    description:
      Each key connected to the keypad controller is represented as a child
      node to the keypad controller device node.

    properties:
      keypad,column:
        $ref: /schemas/types.yaml#/definitions/uint32
        description: The column number to which the key is connected.

      keypad,row:
        $ref: /schemas/types.yaml#/definitions/uint32
        description: The row number to which the key is connected.

      linux,code: true

    required:
      - keypad,column
      - keypad,row
      - linux,code

required:
  - compatible
  - reg
  - interrupts
  - samsung,keypad-num-columns
  - samsung,keypad-num-rows

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/exynos4.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    keypad@100a0000 {
        compatible = "samsung,s5pv210-keypad";
        reg = <0x100a0000 0x100>;
        interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clock CLK_KEYIF>;
        clock-names = "keypad";

        samsung,keypad-num-rows = <2>;
        samsung,keypad-num-columns = <8>;
        linux,input-no-autorepeat;
        wakeup-source;

        key-1 {
            keypad,row = <0>;
            keypad,column = <3>;
            linux,code = <2>;
        };

        key-2 {
            keypad,row = <0>;
            keypad,column = <4>;
            linux,code = <3>;
        };
    };
+0 −77
Original line number Diff line number Diff line
* Samsung's Keypad Controller device tree bindings

Samsung'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 SoC Specific Properties:
- compatible: should be one of the following
  - "samsung,s3c6410-keypad": For controllers compatible with s3c6410 keypad
    controller.
  - "samsung,s5pv210-keypad": For controllers compatible with s5pv210 keypad
    controller.

- reg: physical base address of the controller and length of memory mapped
  region.

- interrupts: The interrupt number to the cpu.

Required Board Specific Properties:
- samsung,keypad-num-rows: Number of row lines connected to the keypad
  controller.

- samsung,keypad-num-columns: Number of column lines connected to the
  keypad controller.

- Keys represented as child nodes: Each key connected to the keypad
  controller is represented as a child node to the keypad controller
  device node and should include the following properties.
  - keypad,row: the row number to which the key is connected.
  - keypad,column: the column number to which the key is connected.
  - linux,code: the key-code to be reported when the key is pressed
    and released.

- pinctrl-0: Should specify pin control groups used for this controller.
- pinctrl-names: Should contain only one value - "default".

Optional Properties:
- wakeup-source: use any event on keypad as wakeup event.
		 (Legacy property supported: "linux,input-wakeup")

Optional Properties specific to linux:
- linux,keypad-no-autorepeat: do no enable autorepeat feature.


Example:
	keypad@100a0000 {
		compatible = "samsung,s5pv210-keypad";
		reg = <0x100A0000 0x100>;
		interrupts = <173>;
		samsung,keypad-num-rows = <2>;
		samsung,keypad-num-columns = <8>;
		linux,input-no-autorepeat;
		wakeup-source;

		pinctrl-names = "default";
		pinctrl-0 = <&keypad_rows &keypad_columns>;

		key_1 {
			keypad,row = <0>;
			keypad,column = <3>;
			linux,code = <2>;
		};

		key_2 {
			keypad,row = <0>;
			keypad,column = <4>;
			linux,code = <3>;
		};

		key_3 {
			keypad,row = <0>;
			keypad,column = <5>;
			linux,code = <4>;
		};
	};
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ List of legacy properties and respective binding document
				Documentation/devicetree/bindings/mfd/tc3589x.txt
				Documentation/devicetree/bindings/input/touchscreen/ads7846.txt
4. "linux,keypad-wakeup"	Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
5. "linux,input-wakeup"		Documentation/devicetree/bindings/input/samsung-keypad.txt
5. "linux,input-wakeup"		Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
6. "nvidia,wakeup-source"	Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt

Examples