diff mbox series

[3/6] dt-bindings: sound: Add sound card bindings for Tesla FSD

Message ID 20221014102151.108539-4-p.rajanbabu@samsung.com
State New
Headers show
Series ASoC: samsung: fsd: audio support for FSD SoC | expand

Commit Message

Padmanabhan Rajanbabu Oct. 14, 2022, 10:21 a.m. UTC
Add dt-binding reference document to configure the DAI link for Tesla
FSD sound card driver.

Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
---
 .../bindings/sound/tesla,fsd-card.yaml        | 158 ++++++++++++++++++
 1 file changed, 158 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/tesla,fsd-card.yaml
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/tesla,fsd-card.yaml b/Documentation/devicetree/bindings/sound/tesla,fsd-card.yaml
new file mode 100644
index 000000000000..4bd590f4ee27
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/tesla,fsd-card.yaml
@@ -0,0 +1,158 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 Samsung Electronics Co. Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/tesla,fsd-card.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Tesla FSD ASoC sound card driver
+
+maintainers:
+  - Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
+
+description: |
+  This binding describes the node properties and essential DT entries of FSD
+  SoC sound card node
+
+select: false
+
+properties:
+  compatible:
+    enum:
+      - tesla,fsd-sndcard
+
+  model:
+    description: Describes the Name of the sound card
+    $ref: /schemas/types.yaml#/definitions/string
+
+  widgets:
+    description: A list of DAPM widgets in the sound card. Each entry is a pair
+      of strings, the first being the widget name and the second being the
+      widget alias
+    $ref: /schemas/types.yaml#/definitions/string-array
+
+  audio-routing:
+    description: A list of the connections between audio components. Each entry
+      is a pair of strings, the first being the connection's sink, the second
+      being the connection's source
+    $ref: /schemas/types.yaml#/definitions/string-array
+
+  dai-tdm-slot-num:
+    description: Enables TDM mode and specifies the number of TDM slots to be
+      enabled
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3, 4, 5, 6, 7, 8]
+    default: 2
+
+  dai-tdm-slot-width:
+    description: Specifies the slot width of each TDm slot enabled
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [8, 16, 24]
+    default: 16
+
+  dai-link:
+    description: Holds the DAI link data between CPU, Codec and Platform
+    type: object
+    properties:
+      link-name:
+        description: Specifies the name of the DAI link
+        $ref: /schemas/types.yaml#/definitions/string
+
+      dai-format:
+        description: Specifies the serial data format of CPU DAI
+        $ref: /schemas/types.yaml#/definitions/string
+
+      tesla,bitclock-master:
+        description: Specifies the phandle of bitclock master DAI
+        $ref: /schemas/types.yaml#/definitions/phandle
+
+      tesla,frame-master:
+        description: Specifies the phandle of frameclock master DAI
+        $ref: /schemas/types.yaml#/definitions/phandle
+
+      cpu:
+        description: Holds the CPU DAI node and instance
+        type: object
+        properties:
+          sound-dai:
+            description: Specifies the phandle of CPU DAI node
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+
+        required:
+          - sound-dai
+
+      codec:
+        description: Holds the Codec DAI node and instance
+        type: object
+        properties:
+          sound-dai:
+            description: Specifies the phandle of Codec DAI node
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+
+        required:
+          - sound-dai
+
+    required:
+      - link-name
+      - dai-format
+      - tesla,bitclock-master
+      - tesla,frame-master
+      - cpu
+
+dependencies:
+  dai-tdm-slot-width: [ 'dai-tdm-slot-num' ]
+
+required:
+  - compatible
+  - model
+  - dai-link
+
+additionalProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "tesla,fsd-sndcard";
+        status = "disabled";
+        model = "fsd-i2s";
+
+        primary-dai-link-0 {
+            link-name = "fsd-primary-0";
+            dai-format = "i2s";
+            tesla,bitclock-master = <&tdm_0>;
+            tesla,frame-master = <&tdm_0>;
+            cpu {
+                sound-dai = <&tdm_0 0>;
+            };
+        };
+
+        secondary-dai-link-0 {
+            link-name = "fsd-secondary-0";
+            dai-format = "i2s";
+            tesla,bitclock-master = <&tdm_0>;
+            tesla,frame-master = <&tdm_0>;
+            cpu {
+                sound-dai = <&tdm_0 1>;
+            };
+        };
+
+        primary-dai-link-1 {
+            link-name = "fsd-primary-1";
+            dai-format = "i2s";
+            tesla,bitclock-master = <&tdm_1>;
+            tesla,frame-master = <&tdm_1>;
+            cpu {
+                sound-dai = <&tdm_1 0>;
+            };
+        };
+
+        secondary-dai-link-1 {
+            link-name = "fsd-secondary-1";
+            dai-format = "i2s";
+            tesla,bitclock-master = <&tdm_1>;
+            tesla,frame-master = <&tdm_1>;
+            cpu {
+                sound-dai = <&tdm_1 1>;
+            };
+        };
+    };