devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, s.nawrocki@samsung.com,
	perex@perex.cz, tiwai@suse.com, pankaj.dubey@samsung.com,
	alim.akhtar@samsung.com, rcsekar@samsung.com,
	aswani.reddy@samsung.com, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH 3/6] dt-bindings: sound: Add sound card bindings for Tesla FSD
Date: Fri, 14 Oct 2022 10:13:25 -0500	[thread overview]
Message-ID: <20221014151325.GA1940481-robh@kernel.org> (raw)
In-Reply-To: <20221014102151.108539-4-p.rajanbabu@samsung.com>

On Fri, Oct 14, 2022 at 03:51:48PM +0530, Padmanabhan Rajanbabu wrote:
> Add dt-binding reference document to configure the DAI link for Tesla
> FSD sound card driver.

The simple-card or graph-card bindings don't work for you?

> 
> 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 --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

Never apply this schema. Why?

> +
> +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]

maximum: 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

All the above have types defined. You should not be redefining the 
types.

> +
> +  dai-link:
> +    description: Holds the DAI link data between CPU, Codec and Platform
> +    type: object

       additionalProperties: false

> +    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

These are common properties. Drop 'tesla'.

> +
> +      cpu:
> +        description: Holds the CPU DAI node and instance
> +        type: object

           additionalProperties: false

> +        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

           additionalProperties: false

> +        properties:
> +          sound-dai:
> +            description: Specifies the phandle of Codec DAI node
> +            $ref: /schemas/types.yaml#/definitions/phandle-array

Already has a type. Need to define how many entries (maxItems: 1 ?).

> +
> +        required:
> +          - sound-dai
> +
> +    required:
> +      - link-name
> +      - dai-format
> +      - tesla,bitclock-master
> +      - tesla,frame-master
> +      - cpu
> +
> +dependencies:
> +  dai-tdm-slot-width: [ 'dai-tdm-slot-num' ]

This should be captured with tdm-slot.txt converted to schema.

> +
> +required:
> +  - compatible
> +  - model
> +  - dai-link
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    sound {
> +        compatible = "tesla,fsd-sndcard";
> +        status = "disabled";

Why have a disabled example? Other than your example won't pass your 
schema.

> +        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>;
> +            };
> +        };
> +    };
> -- 
> 2.17.1
> 
> 

  reply	other threads:[~2022-10-14 15:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20221014104843epcas5p47f6daaad2e67e0c9eedd68c2256c025b@epcas5p4.samsung.com>
2022-10-14 10:21 ` [PATCH 0/6] ASoC: samsung: fsd: audio support for FSD SoC Padmanabhan Rajanbabu
     [not found]   ` <CGME20221014104850epcas5p1a707b9d407a0947c3519077cf7fca5ff@epcas5p1.samsung.com>
2022-10-14 10:21     ` [PATCH 1/6] ASoC: samsung: i2s: TDM Support for CPU DAI driver Padmanabhan Rajanbabu
     [not found]   ` <CGME20221014104857epcas5p2a275a1d606ca066227228d13bcf5b120@epcas5p2.samsung.com>
2022-10-14 10:21     ` [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card Padmanabhan Rajanbabu
2022-10-14 12:02       ` Mark Brown
2022-10-21  8:00         ` Padmanabhan Rajanbabu
2022-10-21 11:53           ` Mark Brown
2022-11-08  5:23             ` Padmanabhan Rajanbabu
2022-11-09 17:38               ` Mark Brown
2023-01-03  4:55                 ` Padmanabhan Rajanbabu
2022-10-23 13:12           ` Krzysztof Kozlowski
     [not found]   ` <CGME20221014104901epcas5p1a61ea81c3b1640bd8a064633c0b1e40d@epcas5p1.samsung.com>
2022-10-14 10:21     ` [PATCH 3/6] dt-bindings: sound: Add sound card bindings for Tesla FSD Padmanabhan Rajanbabu
2022-10-14 15:13       ` Rob Herring [this message]
2022-10-21  8:44         ` Padmanabhan Rajanbabu
2022-10-22 16:48           ` Krzysztof Kozlowski
2022-11-08  5:33             ` Padmanabhan Rajanbabu
2022-11-08 10:36               ` Krzysztof Kozlowski
     [not found]   ` <CGME20221014104904epcas5p4f458182cc9ac9c223d9a25566f3dd300@epcas5p4.samsung.com>
2022-10-14 10:21     ` [PATCH 4/6] ASoC: samsung: fsd: Add FSD soundcard driver Padmanabhan Rajanbabu
2022-10-14 12:23       ` Mark Brown
2022-10-21  8:09         ` Padmanabhan Rajanbabu
2022-10-16 15:18       ` Krzysztof Kozlowski
2022-10-21  9:04         ` Padmanabhan Rajanbabu
     [not found]   ` <CGME20221014104911epcas5p394100ff6ed53be32c4d64c7e23e48833@epcas5p3.samsung.com>
2022-10-14 10:21     ` [PATCH 5/6] arm64: dts: fsd: Add I2S DAI node for Tesla FSD Padmanabhan Rajanbabu
2022-10-14 13:24       ` Alim Akhtar
2022-10-21  8:09         ` Padmanabhan Rajanbabu
2022-10-16 15:14       ` Krzysztof Kozlowski
2022-10-21  8:49         ` Padmanabhan Rajanbabu
2022-10-21 13:01           ` Krzysztof Kozlowski
2022-11-08  5:26             ` Padmanabhan Rajanbabu
     [not found]   ` <CGME20221014104915epcas5p12414b87ea127b2d5bf521556bf841b00@epcas5p1.samsung.com>
2022-10-14 10:21     ` [PATCH 6/6] arm64: dts: fsd: Add sound card " Padmanabhan Rajanbabu
2022-10-14 13:29       ` Alim Akhtar
2022-10-21  8:12         ` Padmanabhan Rajanbabu
2022-10-21 12:53           ` Krzysztof Kozlowski
2022-11-08  5:25             ` Padmanabhan Rajanbabu

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=20221014151325.GA1940481-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=aswani.reddy@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=p.rajanbabu@samsung.com \
    --cc=pankaj.dubey@samsung.com \
    --cc=perex@perex.cz \
    --cc=rcsekar@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=tiwai@suse.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).