devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Sebastian Reichel <sre@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>,
	devicetree@vger.kernel.org,  linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH 1/3] dt-bindings: hsi: hsi-client: convert to YAML
Date: Mon, 25 Mar 2024 22:45:27 +0100	[thread overview]
Message-ID: <20240325-hsi-dt-binding-v1-1-88e8e97c3aae@collabora.com> (raw)
In-Reply-To: <20240325-hsi-dt-binding-v1-0-88e8e97c3aae@collabora.com>

Convert the legacy txt binding to modern YAML and rename from
client-devices to hsi-client. No semantic change.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 .../devicetree/bindings/hsi/client-devices.txt     | 44 ------------
 .../devicetree/bindings/hsi/hsi-client.yaml        | 84 ++++++++++++++++++++++
 2 files changed, 84 insertions(+), 44 deletions(-)

diff --git a/Documentation/devicetree/bindings/hsi/client-devices.txt b/Documentation/devicetree/bindings/hsi/client-devices.txt
deleted file mode 100644
index 104c9a3e57a4..000000000000
--- a/Documentation/devicetree/bindings/hsi/client-devices.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Each HSI port is supposed to have one child node, which
-symbols the remote device connected to the HSI port. The
-following properties are standardized for HSI clients:
-
-Required HSI configuration properties:
-
-- hsi-channel-ids:	A list of channel ids
-
-- hsi-rx-mode:		Receiver Bit transmission mode ("stream" or "frame")
-- hsi-tx-mode:		Transmitter Bit transmission mode ("stream" or "frame")
-- hsi-mode:		May be used instead hsi-rx-mode and hsi-tx-mode if
-			the transmission mode is the same for receiver and
-			transmitter
-- hsi-speed-kbps:	Max bit transmission speed in kbit/s
-- hsi-flow:		RX flow type ("synchronized" or "pipeline")
-- hsi-arb-mode:		Arbitration mode for TX frame ("round-robin", "priority")
-
-Optional HSI configuration properties:
-
-- hsi-channel-names:	A list with one name per channel specified in the
-			hsi-channel-ids property
-
-
-Device Tree node example for an HSI client:
-
-hsi-controller {
-	hsi-port {
-		modem: hsi-client {
-			compatible = "nokia,n900-modem";
-
-			hsi-channel-ids = <0>, <1>, <2>, <3>;
-			hsi-channel-names = "mcsaab-control",
-					    "speech-control",
-					    "speech-data",
-					    "mcsaab-data";
-			hsi-speed-kbps = <55000>;
-			hsi-mode = "frame";
-			hsi-flow = "synchronized";
-			hsi-arb-mode = "round-robin";
-
-			/* more client specific properties */
-		};
-	};
-};
diff --git a/Documentation/devicetree/bindings/hsi/hsi-client.yaml b/Documentation/devicetree/bindings/hsi/hsi-client.yaml
new file mode 100644
index 000000000000..df6e1fdd2702
--- /dev/null
+++ b/Documentation/devicetree/bindings/hsi/hsi-client.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hsi/hsi-client.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HSI bus peripheral
+
+description:
+  Each HSI port is supposed to have one child node, which
+  symbols the remote device connected to the HSI port.
+
+maintainers:
+  - Sebastian Reichel <sre@kernel.org>
+
+properties:
+  $nodename:
+    const: hsi-client
+
+  hsi-channel-ids:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 1
+    maxItems: 8
+
+  hsi-channel-names:
+    minItems: 1
+    maxItems: 8
+
+  hsi-rx-mode:
+    enum: [stream, frame]
+    description: Receiver Bit transmission mode
+
+  hsi-tx-mode:
+    enum: [stream, frame]
+    description: Transmitter Bit transmission mode
+
+  hsi-mode:
+    enum: [stream, frame]
+    description:
+      May be used instead hsi-rx-mode and hsi-tx-mode if the
+      transmission mode is the same for receiver and transmitter.
+
+  hsi-speed-kbps:
+    description: Max bit transmission speed in kbit/s
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  hsi-flow:
+    enum: [synchronized, pipeline]
+    description: RX flow type
+
+  hsi-arb-mode:
+    enum: [round-robin, priority]
+    description: Arbitration mode for TX frame
+
+additionalProperties: true
+
+required:
+  - compatible
+  - hsi-channel-ids
+  - hsi-speed-kbps
+  - hsi-flow
+  - hsi-arb-mode
+
+anyOf:
+  - required:
+      - hsi-mode
+  - required:
+      - hsi-rx-mode
+      - hsi-tx-mode
+
+allOf:
+  - if:
+      required:
+        - hsi-mode
+    then:
+      properties:
+        hsi-rx-mode: false
+        hsi-tx-mode: false
+  - if:
+      required:
+        - hsi-rx-mode
+    then:
+      properties:
+        hsi-mode: false

-- 
2.43.0


  reply	other threads:[~2024-03-25 21:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 21:45 [PATCH 0/3] Convert MIPI HSI DT bindings to YAML Sebastian Reichel
2024-03-25 21:45 ` Sebastian Reichel [this message]
2024-03-26  7:18   ` [PATCH 1/3] dt-bindings: hsi: hsi-client: convert " Krzysztof Kozlowski
2024-03-26 12:45     ` Sebastian Reichel
2024-03-26 12:56       ` Krzysztof Kozlowski
2024-03-26 15:15         ` Sebastian Reichel
2024-03-26 16:08           ` Krzysztof Kozlowski
2024-03-25 21:45 ` [PATCH 2/3] dt-bindings: hsi: nokia-modem: " Sebastian Reichel
2024-03-26  7:21   ` Krzysztof Kozlowski
2024-03-26 13:00     ` Sebastian Reichel
2024-03-25 21:45 ` [PATCH 3/3] dt-bindings: hsi: omap-ssi: " Sebastian Reichel
2024-03-26  7:26   ` Krzysztof Kozlowski
2024-03-26 13:34     ` Sebastian Reichel

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=20240325-hsi-dt-binding-v1-1-88e8e97c3aae@collabora.com \
    --to=sebastian.reichel@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).