[RFC PATCH 7/7] dt-bindings: motion: Add motion-simple-pwm bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add device-tree bindings for simple Linux Motion Control devices that
are based on 1 or 2 PWM outputs.

Signed-off-by: David Jander <david@xxxxxxxxxxx>
---
 .../bindings/motion/motion-simple-pwm.yaml    | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/motion/motion-simple-pwm.yaml

diff --git a/Documentation/devicetree/bindings/motion/motion-simple-pwm.yaml b/Documentation/devicetree/bindings/motion/motion-simple-pwm.yaml
new file mode 100644
index 000000000000..409e3aef6f3f
--- /dev/null
+++ b/Documentation/devicetree/bindings/motion/motion-simple-pwm.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/motion/motion-simple-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Simple PWM based motor controller
+
+maintainers:
+  - David Jander <david@protonic>
+
+description: |
+   Simple motor control device based on 1 or 2 PWM outputs
+
+properties:
+  compatible:
+    enum:
+      - motion-simple-pwm
+
+  pwms:
+    maxItems: 2
+
+  pwm-names:
+    maxItems: 2
+
+  motion,pwm-inverted:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      If present, this flag indicates that the PWM signal should be inverted.
+      The duty-cycle will be scaled from 100% down to 0% instead 0% to 100%.
+
+required:
+  - compatible
+  - pwms
+
+allOf:
+  - $ref: /schemas/motion/common.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    // This example shows how to use the TI DRV8873 or similar motor controllers
+    // with this driver
+    motion-simple-pwm0 {
+      compatible = "motion-simple-pwm";
+      pwms = <&hpdcm0_pwm 0 50000 0>,
+             <&hpdcm0_pwm 1 50000 0>;
+      pwm-names = "left", "right";
+      motion,pwm-inverted;
+      motion,speed-conv-mul = <3600>;
+      motion,speed-conv-div = <100000>;
+      motion,acceleration-conv-mul = <3600>;
+      motion,acceleration-conv-div = <100000>;
+    };
-- 
2.47.2





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux