Skip to contentSkip to conversation

dt-bindings: sound: gtm601: convert to YAML

PATCH RESEND Superseded David Heidelberg 2 participants 3 messages Jul 30, 2023

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 1/1 dt-bindings: sound: gtm601: convert to YAML

Convert GTM601 binding to the YAML format.

---
v2:
- add #sound-dai-cells
- put [email protected] into maintainers

 .../devicetree/bindings/sound/gtm601.txt      | 19 ----------
 .../devicetree/bindings/sound/gtm601.yaml     | 36 +++++++++++++++++++
 2 files changed, 36 insertions(+), 19 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/gtm601.txt
 create mode 100644 Documentation/devicetree/bindings/sound/gtm601.yaml
Documentation/devicetree/bindings/sound/gtm601.txt deleted +0 -19
deleted file mode 100644
index efa32a486c4a..000000000000
@@ -1,19 +0,0 @@
-GTM601 UMTS modem audio interface CODEC
-
-This device has no configuration interface. The sample rate and channels are
-based on the compatible string
-	"option,gtm601" = 8kHz mono
-	"broadmobi,bm818" = 48KHz stereo
-
-Required properties:
-
-  - compatible : one of
-	"option,gtm601"
-	"broadmobi,bm818"
-
-
-Example:
-
-codec: gtm601_codec {
-	compatible = "option,gtm601";
-};
Documentation/devicetree/bindings/sound/gtm601.yaml new file +36 -0
new file mode 100644
index 000000000000..e81a6aa75522
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/gtm601.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GTM601 UMTS modem audio interface CODEC
+
+maintainers:
+  - [email protected]
+
+description: >
+  This device has no configuration interface. The sample rate and channels are
+  based on the compatible string
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: broadmobi,bm818
+          - const: option,gtm601
+      - items:
+          - enum:
+              - broadmobi,bm818  # 48 kHz stereo
+              - option,gtm601  # 8 kHz mono
+
+  '#sound-dai-cells':
+    const: 0
+
+additionalProperties: false
+
+examples:
+  - |
+    gtm601_codec {
+        compatible = "option,gtm601";
+    };
Signature · 1 line
2.40.1
#1 lore raw
Quoted 4 lines · David Heidelberg

Convert GTM601 binding to the YAML format.

No need for blank line between tags.

Quoted 8 lines

---
v2:
- add #sound-dai-cells
- put [email protected] into maintainers

 .../devicetree/bindings/sound/gtm601.txt      | 19 ----------
 .../devicetree/bindings/sound/gtm601.yaml     | 36 +++++++++++++++++++

Filename like compatible, please, so option,gtm601.yaml

Quoted 40 lines
 2 files changed, 36 insertions(+), 19 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/gtm601.txt
 create mode 100644 Documentation/devicetree/bindings/sound/gtm601.yaml
Documentation/devicetree/bindings/sound/gtm601.txt deleted +0 -19
deleted file mode 100644
index efa32a486c4a..000000000000
@@ -1,19 +0,0 @@
-GTM601 UMTS modem audio interface CODEC
-
-This device has no configuration interface. The sample rate and channels are
-based on the compatible string
-	"option,gtm601" = 8kHz mono
-	"broadmobi,bm818" = 48KHz stereo
-
-Required properties:
-
-  - compatible : one of
-	"option,gtm601"
-	"broadmobi,bm818"
-
-
-Example:
-
-codec: gtm601_codec {
-	compatible = "option,gtm601";
-};
Documentation/devicetree/bindings/sound/gtm601.yaml new file +5 -0
new file mode 100644
index 000000000000..e81a6aa75522
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/gtm601.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/sound/gtm601.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +10 -0
+
+title: GTM601 UMTS modem audio interface CODEC
+
+maintainers:
+  - [email protected]
+
+description: >
+  This device has no configuration interface. The sample rate and channels are
+  based on the compatible string
+

Missing $ref to dai-common.yaml

Documentation/devicetree/bindings/sound/gtm601.yaml line 22

Quoted 7 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +7 -0
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: broadmobi,bm818
+          - const: option,gtm601
+      - items:

No "items" needed here, just use enum.

Documentation/devicetree/bindings/sound/gtm601.yaml line 25

Quoted 3 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +3 -0
+          - enum:
+              - broadmobi,bm818  # 48 kHz stereo
+              - option,gtm601  # 8 kHz mono

This does not make much sense. bm818 is either compatible with gtm601 or is not. Cannot be both.

Documentation/devicetree/bindings/sound/gtm601.yaml line 34

Quoted 9 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +9 -0
+
+  '#sound-dai-cells':
+    const: 0
+
+additionalProperties: false
+
+examples:
+  - |
+    gtm601_codec {

No underscores, generic names, so "codec" or "audio-codec".

Documentation/devicetree/bindings/sound/gtm601.yaml line 35

Quoted 1 line
Documentation/devicetree/bindings/sound/gtm601.yaml new file +1 -0
+        compatible = "option,gtm601";

Add dai cells also to the example to make it complete.

Documentation/devicetree/bindings/sound/gtm601.yaml line 36

Quoted 1 line
Documentation/devicetree/bindings/sound/gtm601.yaml new file +1 -0
+    };

Best regards,
Krzysztof

#2 lore raw

Thank you for the review. Version 3 has been sent, and I'm hopeful that I have correctly implemented your feedback.

David

Quoted 102 lines · Krzysztof Kozlowski
Quoted 4 lines · David Heidelberg

Convert GTM601 binding to the YAML format.

No need for blank line between tags.

Quoted 8 lines

---
v2:
- add #sound-dai-cells
- put [email protected] into maintainers

  .../devicetree/bindings/sound/gtm601.txt      | 19 ----------
  .../devicetree/bindings/sound/gtm601.yaml     | 36 +++++++++++++++++++

Filename like compatible, please, so option,gtm601.yaml

Quoted 40 lines
  2 files changed, 36 insertions(+), 19 deletions(-)

delete mode 100644 Documentation/devicetree/bindings/sound/gtm601.txt create mode 100644 Documentation/devicetree/bindings/sound/gtm601.yaml

Documentation/devicetree/bindings/sound/gtm601.txt deleted +0 -19
deleted file mode 100644
index efa32a486c4a..000000000000
@@ -1,19 +0,0 @@
-GTM601 UMTS modem audio interface CODEC
-
-This device has no configuration interface. The sample rate and channels are
-based on the compatible string
-	"option,gtm601" = 8kHz mono
-	"broadmobi,bm818" = 48KHz stereo
-
-Required properties:
-
-  - compatible : one of
-	"option,gtm601"
-	"broadmobi,bm818"
-
-
-Example:
-
-codec: gtm601_codec {
-	compatible = "option,gtm601";
-};
Documentation/devicetree/bindings/sound/gtm601.yaml new file +5 -0
new file mode 100644
index 000000000000..e81a6aa75522
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/gtm601.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/sound/gtm601.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +10 -0
+
+title: GTM601 UMTS modem audio interface CODEC
+
+maintainers:
+  - [email protected]
+
+description: >
+  This device has no configuration interface. The sample rate and channels are
+  based on the compatible string
+

Missing $ref to dai-common.yaml

Documentation/devicetree/bindings/sound/gtm601.yaml line 22

Quoted 7 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +7 -0
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: broadmobi,bm818
+          - const: option,gtm601
+      - items:

No "items" needed here, just use enum.

Documentation/devicetree/bindings/sound/gtm601.yaml line 25

Quoted 3 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +3 -0
+          - enum:
+              - broadmobi,bm818  # 48 kHz stereo
+              - option,gtm601  # 8 kHz mono

This does not make much sense. bm818 is either compatible with gtm601 or is not. Cannot be both.

Documentation/devicetree/bindings/sound/gtm601.yaml line 34

Quoted 9 lines
Documentation/devicetree/bindings/sound/gtm601.yaml new file +9 -0
+
+  '#sound-dai-cells':
+    const: 0
+
+additionalProperties: false
+
+examples:
+  - |
+    gtm601_codec {

No underscores, generic names, so "codec" or "audio-codec".

Documentation/devicetree/bindings/sound/gtm601.yaml line 35

Quoted 1 line
Documentation/devicetree/bindings/sound/gtm601.yaml new file +1 -0
+        compatible = "option,gtm601";

Add dai cells also to the example to make it complete.

Documentation/devicetree/bindings/sound/gtm601.yaml line 36

Quoted 1 line
Documentation/devicetree/bindings/sound/gtm601.yaml new file +1 -0
+    };

Best regards,
Krzysztof

Signature · 2 lines
David Heidelberg
Certified Linux Magician