diff mbox series

[2/3] Input: rotary-encoder-counter: add DT bindings

Message ID 20200406155806.1295169-3-kamel.bouhara@bootlin.com
State New
Headers show
Series [1/3] counter: add an inkernel API | expand

Commit Message

Kamel BOUHARA April 6, 2020, 3:58 p.m. UTC
Add dt binding for the counter variant of the rotary encoder driver.

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
 .../input/rotary-encoder-counter.yaml         | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/rotary-encoder-counter.yaml
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/rotary-encoder-counter.yaml b/Documentation/devicetree/bindings/input/rotary-encoder-counter.yaml
new file mode 100644
index 000000000000..a59f7c1faf0c
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/rotary-encoder-counter.yaml
@@ -0,0 +1,67 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/rotary-encoder-counter.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rotary Encoder Counter
+
+maintainers:
+  - Kamel Bouhara <kamel.bouhara@bootlin.com>
+
+description:
+  Registers a Rotary encoder connected through a counter device.
+
+properties:
+  compatible:
+    const: rotary-encoder-counter
+
+  counter:
+    description: Phandle for the counter device providing rotary position.
+
+  linux-axis:
+    description: The input subsystem axis to map to this rotary encoder.
+    type: boolean
+
+  qdec-mode:
+    description: |
+      Quadrature decoder function to set in the counter device.
+      3: x1-PHA
+      4: x1-PHB
+      5: x2-PHA
+      6: x2-PHB
+      7: x4-PHA and PHB
+
+  steps:
+    description: Number of steps in a full turnaround of the encoder.
+      Only relevant for absolute axis. Defaults to 24 which is a typical
+      value for such devices.
+
+  relative-axis:
+    description: Register a relative axis rather than an absolute one.
+    type: boolean
+
+  rollover:
+    description: Automatic rollover when the rotary value becomes greater
+      than the specified steps or smaller than 0. For absolute axis only.
+    type: boolean
+
+  poll-interval:
+    description: Poll interval at which the position is read from the counter
+      device (default 500ms).
+
+required:
+  - compatible
+  - counter
+  - qdec-mode
+
+examples:
+  - |
+    rotary@0 {
+        compatible = "rotary-encoder-counter";
+
+        counter =<&qdec>;
+        qdec-mode = <7>;
+        relative-axis;
+    };
+...