public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Angelo Compagnucci <angelo@amarulasolutions.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-pwm@vger.kernel.org (open list:GENERIC PWM SERVO DRIVER),
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v3 3/3] dt-bindings: misc: servo-pwm: Add new bindings for servo-pwm
Date: Fri, 17 Feb 2023 17:10:37 +0100	[thread overview]
Message-ID: <20230217161038.3130053-3-angelo@amarulasolutions.com> (raw)
In-Reply-To: <20230217161038.3130053-1-angelo@amarulasolutions.com>

This binding describes the binding for controlling servo motors through
pwm.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
v2:
* Converted old txt to yaml
v3:
* Fixed errors rised by make dt_binding_check 

 .../devicetree/bindings/misc/servo-pwm.yaml   | 57 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/servo-pwm.yaml

diff --git a/Documentation/devicetree/bindings/misc/servo-pwm.yaml b/Documentation/devicetree/bindings/misc/servo-pwm.yaml
new file mode 100644
index 000000000000..73e81b939daf
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/servo-pwm.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/servo-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Servo motor connected to PWM
+
+maintainers:
+  - Angelo Compagnucci <angelo@amarulasolutions.com>
+
+description:
+  Each servo is represented as a servo-pwm device.
+  The 20ms period is the accepted standard and so most of the motors
+  support it, while the positioning min/max duty cycle or the motor
+  degrees aperture vary lot between manufacturers.
+  The most common type of servo (SG90) has 180 degrees of movement
+  and moves between 0.5ms and 2.5ms duty cycle.
+
+properties:
+  compatible:
+    const: servo-pwm
+
+  pwms:
+    maxItems: 1
+
+  pwm-names: true
+
+  degrees:
+    description:
+      How many degrees the motor can move.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  duty-min:
+    description:
+      Duty cycle for position the motor at 0 degrees.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  duty-max:
+    description:
+      Duty cycle for positioning the motor at "degrees" angle.
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+additionalProperties: false
+
+examples:
+  - |
+
+    servo: servo@0 {
+      compatible = "servo-pwm";
+      pwms = <&pwm 0 20000000 0>;
+      degrees = <180>;
+      duty-min = <500000>;
+      duty-max = <2500000>;
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 356daea0861d..8f41daee62fc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8742,6 +8742,7 @@ M:	"Angelo Compagnucci" <angelo@amarulasolutions.com>
 L:	linux-pwm@vger.kernel.org
 S:	Maintained
 F:	Documentation/ABI/testing/sysfs-driver-servo-pwm
+F:	Documentation/devicetree/bindings/misc/servo-pwm.yaml
 F:	drivers/misc/servo-pwm.c
 
 GENERIC RESISTIVE TOUCHSCREEN ADC DRIVER
-- 
2.34.1


  parent reply	other threads:[~2023-02-17 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 16:10 [PATCH v3 1/3] misc: servo-pwm: driver for controlling servo motors via PWM Angelo Compagnucci
2023-02-17 16:10 ` [PATCH v3 2/3] misc: servo-pwm: Add sysfs entries to control motor angle Angelo Compagnucci
2023-02-17 16:10 ` Angelo Compagnucci [this message]
2023-02-17 17:29   ` [PATCH v3 3/3] dt-bindings: misc: servo-pwm: Add new bindings for servo-pwm Rob Herring
2023-02-18 10:16   ` Krzysztof Kozlowski
2023-02-17 21:12 ` [PATCH v3 1/3] misc: servo-pwm: driver for controlling servo motors via PWM kernel test robot
2023-02-17 21:22 ` kernel test robot
2023-02-20 11:40 ` Thierry Reding
2023-02-20 11:46   ` Angelo Compagnucci
2023-07-15 19:17 ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230217161038.3130053-3-angelo@amarulasolutions.com \
    --to=angelo.compagnucci@gmail.com \
    --cc=angelo@amarulasolutions.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox