All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siddharth Menon <simeddon@gmail.com>
To: devicetree@vger.kernel.org, andersson@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: baolin.wang@linux.alibaba.com, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org, BiscuitBobby <simeddon@gmail.com>
Subject: [PATCH] dt-bindings: hwlock: Convert to dtschema
Date: Tue, 18 Feb 2025 21:39:35 +0530	[thread overview]
Message-ID: <20250218161352.269237-1-simeddon@gmail.com> (raw)

From: BiscuitBobby <simeddon@gmail.com>

Convert the generic hwspinlock bindings to DT schema.
---
 This is my first time converting bindings to dt schema, please let me
 know if I have overlooked anything.
 .../devicetree/bindings/hwlock/hwlock.txt     | 59 -----------------
 .../devicetree/bindings/hwlock/hwlock.yaml    | 65 +++++++++++++++++++
 2 files changed, 65 insertions(+), 59 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/hwlock/hwlock.txt
 create mode 100644 Documentation/devicetree/bindings/hwlock/hwlock.yaml

diff --git a/Documentation/devicetree/bindings/hwlock/hwlock.txt b/Documentation/devicetree/bindings/hwlock/hwlock.txt
deleted file mode 100644
index 085d1f5c916a..000000000000
--- a/Documentation/devicetree/bindings/hwlock/hwlock.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-Generic hwlock bindings
-=======================
-
-Generic bindings that are common to all the hwlock platform specific driver
-implementations.
-
-Please also look through the individual platform specific hwlock binding
-documentations for identifying any additional properties specific to that
-platform.
-
-hwlock providers:
-=================
-
-Required properties:
-- #hwlock-cells:        Specifies the number of cells needed to represent a
-                        specific lock.
-
-hwlock users:
-=============
-
-Consumers that require specific hwlock(s) should specify them using the
-property "hwlocks", and an optional "hwlock-names" property.
-
-Required properties:
-- hwlocks:              List of phandle to a hwlock provider node and an
-                        associated hwlock args specifier as indicated by
-                        #hwlock-cells. The list can have just a single hwlock
-                        or multiple hwlocks, with each hwlock represented by
-                        a phandle and a corresponding args specifier.
-
-Optional properties:
-- hwlock-names:         List of hwlock name strings defined in the same order
-                        as the hwlocks, with one name per hwlock. Consumers can
-                        use the hwlock-names to match and get a specific hwlock.
-
-
-1. Example of a node using a single specific hwlock:
-
-The following example has a node requesting a hwlock in the bank defined by
-the node hwlock1. hwlock1 is a hwlock provider with an argument specifier
-of length 1.
-
-	node {
-		...
-		hwlocks = <&hwlock1 2>;
-		...
-	};
-
-2. Example of a node using multiple specific hwlocks:
-
-The following example has a node requesting two hwlocks, a hwlock within
-the hwlock device node 'hwlock1' with #hwlock-cells value of 1, and another
-hwlock within the hwlock device node 'hwlock2' with #hwlock-cells value of 2.
-
-	node {
-		...
-		hwlocks = <&hwlock1 2>, <&hwlock2 0 3>;
-		...
-	};
diff --git a/Documentation/devicetree/bindings/hwlock/hwlock.yaml b/Documentation/devicetree/bindings/hwlock/hwlock.yaml
new file mode 100644
index 000000000000..2492fdad3c6e
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwlock/hwlock.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwlock/hwlock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic Hardware Lock (hwlock)
+
+description: |
+  Generic bindings that are common to all the hwlock platform specific driver
+  implementations.
+  Please also look through the individual platform specific hwlock binding
+  documentations for identifying any additional properties specific to that
+  platform.
+
+maintainers:
+  - Bjorn Andersson <andersson@kernel.org>
+  - Rob Herring <robh@kernel.org>
+  - Krzysztof Kozlowski <krzk+dt@kernel.org>
+  - Conor Dooley <conor+dt@kernel.org>
+
+properties:
+  $nodename:
+    pattern: "^hwlock(@.*)?"
+
+  "#hwlock-cells":
+    description: |
+      Specifies the number of cells needed to represent a specific lock.
+    minimum: 1
+
+  hwlocks:
+    description: |
+      List of phandle to a hwlock provider node and an associated hwlock args
+      specifier as indicated by #hwlock-cells. The list can have just a single
+      hwlock or multiple hwlocks, with each hwlock represented by a phandle and
+      a corresponding args specifier.
+
+  hwlock-names:
+    description: |
+      List of hwlock name strings defined in the same order as the hwlocks,
+      with one name per hwlock. Consumers can use the hwlock-names to match
+      and get a specific hwlock.
+
+patternProperties:
+  "^hwlock@[0-9a-f]+$":
+    type: object
+    description: Hardware lock provider node
+
+required:
+  - "#hwlock-cells"
+
+additionalProperties: true
+
+examples:
+  # Example 1: A node using a single specific hwlock
+  - |
+    node {
+      hwlocks = <&hwlock1 2>;
+    };
+
+  # Example 2: A node using multiple specific hwlocks
+  - |
+    node {
+      hwlocks = <&hwlock1 2>, <&hwlock2 0 3>;
+    };
-- 
2.48.1


             reply	other threads:[~2025-02-18 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 16:09 Siddharth Menon [this message]
2025-02-18 16:42 ` [PATCH] dt-bindings: hwlock: Convert to dtschema Krzysztof Kozlowski
2025-02-18 19:46 ` Rob Herring (Arm)
2025-02-18 21:12 ` Rob Herring
2025-02-20 10:51   ` Siddharth Menon

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=20250218161352.269237-1-simeddon@gmail.com \
    --to=simeddon@gmail.com \
    --cc=andersson@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.