diff mbox series

[v3,09/13] ASoC: dt-bindings: tegra: Add schema for audio graph card

Message ID 1601573587-15288-10-git-send-email-spujar@nvidia.com
State Superseded
Headers show
Series Audio graph card updates and usage with Tegra210 audio | expand

Commit Message

Sameer Pujar Oct. 1, 2020, 5:33 p.m. UTC
Add YAML schema for Tegra audio graph sound card DT bindings. It uses the
same DT bindings provided by generic audio graph driver. Along with this
few standard clock DT bindings are added which are specifically required
for Tegra audio.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 .../sound/nvidia,tegra-audio-graph-card.yaml       | 70 ++++++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml

Comments

Rob Herring Oct. 6, 2020, 8:34 p.m. UTC | #1
On Thu, Oct 01, 2020 at 11:03:03PM +0530, Sameer Pujar wrote:
> Add YAML schema for Tegra audio graph sound card DT bindings. It uses the
> same DT bindings provided by generic audio graph driver. Along with this
> few standard clock DT bindings are added which are specifically required
> for Tegra audio.
> 
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> ---
>  .../sound/nvidia,tegra-audio-graph-card.yaml       | 70 ++++++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
> new file mode 100644
> index 0000000..b73fbe5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Audio Graph based Tegra sound card driver
> +
> +description: |
> +  This is based on generic audio graph card driver along with additional
> +  customizations for Tegra platforms. It uses the same bindings with
> +  additional standard clock DT bindings required for Tegra.
> +
> +  See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt
> +
> +maintainers:
> +  - Jon Hunter <jonathanh@nvidia.com>
> +  - Sameer Pujar <spujar@nvidia.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: nvidia,tegra210-audio-graph-card
> +      - const: nvidia,tegra186-audio-graph-card
> +
> +  clocks:
> +   minItems: 2
> +
> +  clock-names:
> +   minItems: 2
> +   items:
> +     - const: pll_a
> +     - const: plla_out0
> +
> +  assigned-clocks:
> +    minItems: 1
> +    maxItems: 3
> +
> +  assigned-clock-parents:
> +    minItems: 1
> +    maxItems: 3
> +
> +  assigned-clock-rates:
> +    minItems: 1
> +    maxItems: 3
> +
> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - assigned-clocks
> +  - assigned-clock-parents

Where's the graph? You need to define the ports and reference the common 
schema.

> +
> +examples:
> +  - |
> +    #include<dt-bindings/clock/tegra210-car.h>
> +
> +    tegra_sound {
> +        compatible = "nvidia,tegra210-audio-graph-card";
> +        clocks = <&tegra_car TEGRA210_CLK_PLL_A>,
> +                 <&tegra_car TEGRA210_CLK_PLL_A_OUT0>;
> +        clock-names = "pll_a", "plla_out0";
> +        assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>,
> +                          <&tegra_car TEGRA210_CLK_PLL_A_OUT0>,
> +                          <&tegra_car TEGRA210_CLK_EXTERN1>;
> +        assigned-clock-parents = <0>, <0>, <&tegra_car TEGRA210_CLK_PLL_A_OUT0>;
> +        assigned-clock-rates = <368640000>, <49152000>, <12288000>;
> +    };
> +
> +...
> -- 
> 2.7.4
>
Sameer Pujar Oct. 7, 2020, 7:13 a.m. UTC | #2
>> Add YAML schema for Tegra audio graph sound card DT bindings. It uses the
>> same DT bindings provided by generic audio graph driver. Along with this
>> few standard clock DT bindings are added which are specifically required
>> for Tegra audio.
>>
>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>> ---
>>   .../sound/nvidia,tegra-audio-graph-card.yaml       | 70 ++++++++++++++++++++++
>>   1 file changed, 70 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
>> new file mode 100644
>> index 0000000..b73fbe5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
>> @@ -0,0 +1,70 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Audio Graph based Tegra sound card driver
>> +
>> +description: |
>> +  This is based on generic audio graph card driver along with additional
>> +  customizations for Tegra platforms. It uses the same bindings with
>> +  additional standard clock DT bindings required for Tegra.
>> +
>> +  See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt
>> +
>> +maintainers:
>> +  - Jon Hunter <jonathanh@nvidia.com>
>> +  - Sameer Pujar <spujar@nvidia.com>
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - const: nvidia,tegra210-audio-graph-card
>> +      - const: nvidia,tegra186-audio-graph-card
>> +
>> +  clocks:
>> +   minItems: 2
>> +
>> +  clock-names:
>> +   minItems: 2
>> +   items:
>> +     - const: pll_a
>> +     - const: plla_out0
>> +
>> +  assigned-clocks:
>> +    minItems: 1
>> +    maxItems: 3
>> +
>> +  assigned-clock-parents:
>> +    minItems: 1
>> +    maxItems: 3
>> +
>> +  assigned-clock-rates:
>> +    minItems: 1
>> +    maxItems: 3
>> +
>> +required:
>> +  - compatible
>> +  - clocks
>> +  - clock-names
>> +  - assigned-clocks
>> +  - assigned-clock-parents
> Where's the graph? You need to define the ports and reference the common
> schema.

I am looking to reference the bindings used in below doc which is not 
yet in YAML format. Only additional properties I listed here.
{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt

Should I keep this doc to *.txt format as well and later move to YAML or 
is there a way to reference *.txt doc here?
Sameer Pujar Oct. 16, 2020, 5:14 a.m. UTC | #3
>>> Add YAML schema for Tegra audio graph sound card DT bindings. It 
>>> uses the
>>> same DT bindings provided by generic audio graph driver. Along with 
>>> this
>>> few standard clock DT bindings are added which are specifically 
>>> required
>>> for Tegra audio.
>>>
>>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>>> ---
>>>   .../sound/nvidia,tegra-audio-graph-card.yaml | 70 
>>> ++++++++++++++++++++++
>>>   1 file changed, 70 insertions(+)
>>>   create mode 100644 
>>> Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml 
>>> b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml 
>>>
>>> new file mode 100644
>>> index 0000000..b73fbe5
>>> --- /dev/null
>>> +++ 
>>> b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
>>> @@ -0,0 +1,70 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: 
>>> http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Audio Graph based Tegra sound card driver
>>> +
>>> +description: |
>>> +  This is based on generic audio graph card driver along with 
>>> additional
>>> +  customizations for Tegra platforms. It uses the same bindings with
>>> +  additional standard clock DT bindings required for Tegra.
>>> +
>>> + 
>>> See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt
>>> +
>>> +maintainers:
>>> +  - Jon Hunter <jonathanh@nvidia.com>
>>> +  - Sameer Pujar <spujar@nvidia.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - const: nvidia,tegra210-audio-graph-card
>>> +      - const: nvidia,tegra186-audio-graph-card
>>> +
>>> +  clocks:
>>> +   minItems: 2
>>> +
>>> +  clock-names:
>>> +   minItems: 2
>>> +   items:
>>> +     - const: pll_a
>>> +     - const: plla_out0
>>> +
>>> +  assigned-clocks:
>>> +    minItems: 1
>>> +    maxItems: 3
>>> +
>>> +  assigned-clock-parents:
>>> +    minItems: 1
>>> +    maxItems: 3
>>> +
>>> +  assigned-clock-rates:
>>> +    minItems: 1
>>> +    maxItems: 3
>>> +
>>> +required:
>>> +  - compatible
>>> +  - clocks
>>> +  - clock-names
>>> +  - assigned-clocks
>>> +  - assigned-clock-parents
>> Where's the graph? You need to define the ports and reference the common
>> schema.
>
> I am looking to reference the bindings used in below doc which is not 
> yet in YAML format. Only additional properties I listed here.
> {LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt
>
> Should I keep this doc to *.txt format as well and later move to YAML 
> or is there a way to reference *.txt doc here?

The dependency here is like below,
Tegra audio graph card -> generic audio graph card 
(audio-graph-card.txt) -> graph (graph.txt)

I plan to convert dependencies to json-schema in next revision and then 
refer these for Tegra audio graph card.
Mark Brown Oct. 16, 2020, 4:42 p.m. UTC | #4
On Fri, Oct 16, 2020 at 10:44:15AM +0530, Sameer Pujar wrote:

> > I am looking to reference the bindings used in below doc which is not
> > yet in YAML format. Only additional properties I listed here.
> > {LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt

> > Should I keep this doc to *.txt format as well and later move to YAML or
> > is there a way to reference *.txt doc here?

> The dependency here is like below,
> Tegra audio graph card -> generic audio graph card (audio-graph-card.txt) ->
> graph (graph.txt)

> I plan to convert dependencies to json-schema in next revision and then
> refer these for Tegra audio graph card.

Yeah, unfortunately you need to do it that way around - you can't
reference text bindings from YAML ones as the tooling can't parse the
text bindings for validation.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
new file mode 100644
index 0000000..b73fbe5
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
@@ -0,0 +1,70 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Audio Graph based Tegra sound card driver
+
+description: |
+  This is based on generic audio graph card driver along with additional
+  customizations for Tegra platforms. It uses the same bindings with
+  additional standard clock DT bindings required for Tegra.
+
+  See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt
+
+maintainers:
+  - Jon Hunter <jonathanh@nvidia.com>
+  - Sameer Pujar <spujar@nvidia.com>
+
+properties:
+  compatible:
+    oneOf:
+      - const: nvidia,tegra210-audio-graph-card
+      - const: nvidia,tegra186-audio-graph-card
+
+  clocks:
+   minItems: 2
+
+  clock-names:
+   minItems: 2
+   items:
+     - const: pll_a
+     - const: plla_out0
+
+  assigned-clocks:
+    minItems: 1
+    maxItems: 3
+
+  assigned-clock-parents:
+    minItems: 1
+    maxItems: 3
+
+  assigned-clock-rates:
+    minItems: 1
+    maxItems: 3
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - assigned-clocks
+  - assigned-clock-parents
+
+examples:
+  - |
+    #include<dt-bindings/clock/tegra210-car.h>
+
+    tegra_sound {
+        compatible = "nvidia,tegra210-audio-graph-card";
+        clocks = <&tegra_car TEGRA210_CLK_PLL_A>,
+                 <&tegra_car TEGRA210_CLK_PLL_A_OUT0>;
+        clock-names = "pll_a", "plla_out0";
+        assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>,
+                          <&tegra_car TEGRA210_CLK_PLL_A_OUT0>,
+                          <&tegra_car TEGRA210_CLK_EXTERN1>;
+        assigned-clock-parents = <0>, <0>, <&tegra_car TEGRA210_CLK_PLL_A_OUT0>;
+        assigned-clock-rates = <368640000>, <49152000>, <12288000>;
+    };
+
+...