[PATCH 3/9] dt-bindings: ASoC: Add chv3-audio

Paweł Anikiel posted 9 patches 2 years, 8 months ago
There is a newer version of this series
[PATCH 3/9] dt-bindings: ASoC: Add chv3-audio
Posted by Paweł Anikiel 2 years, 8 months ago
Add binding for chv3-audio device.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
---
 .../bindings/sound/google,chv3-audio.yaml     | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-audio.yaml

diff --git a/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
new file mode 100644
index 000000000000..8b602b60eaee
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/google,chv3-audio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google Chameleon v3 audio
+
+maintainers:
+  - Paweł Anikiel <pan@semihalf.com>
+
+properties:
+  compatible:
+    const: google,chv3-audio
+
+  google,audio-cpu0:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of controller #0
+
+  google,audio-codec0:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of codec #0
+
+  google,audio-cpu1:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of controller #1
+
+  google,audio-codec1:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of codec #1
+
+required:
+  - compatible
+  - google,audio-cpu0:
+  - google,audio-codec0:
+  - google,audio-cpu1:
+  - google,audio-codec1:
+
+additionalProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "google,chv3-audio";
+        google,audio-cpu0 = <&i2s1>;
+        google,audio-codec0 = <&ssm2603>;
+        google,audio-cpu1 = <&i2s0>;
+        google,audio-codec1 = <&it68051>;
+    };
-- 
2.40.0.634.g4ca3ef3211-goog

Re: [PATCH 3/9] dt-bindings: ASoC: Add chv3-audio
Posted by Rob Herring 2 years, 8 months ago
On Fri, Apr 14, 2023 at 04:01:57PM +0200, Paweł Anikiel wrote:
> Add binding for chv3-audio device.
> 
> Signed-off-by: Paweł Anikiel <pan@semihalf.com>
> ---
>  .../bindings/sound/google,chv3-audio.yaml     | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> new file mode 100644
> index 000000000000..8b602b60eaee
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/google,chv3-audio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Google Chameleon v3 audio
> +
> +maintainers:
> +  - Paweł Anikiel <pan@semihalf.com>
> +
> +properties:
> +  compatible:
> +    const: google,chv3-audio
> +
> +  google,audio-cpu0:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of controller #0
> +
> +  google,audio-codec0:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of codec #0
> +
> +  google,audio-cpu1:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of controller #1
> +
> +  google,audio-codec1:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of codec #1

Why do you need custom properties when we have standard property to 
point to these things (sound-dai). We also have bindings to handle 
multiple devices.

Rob
Re: [PATCH 3/9] dt-bindings: ASoC: Add chv3-audio
Posted by Paweł Anikiel 2 years, 7 months ago
On Mon, Apr 17, 2023 at 10:41 PM Rob Herring <robh@kernel.org> wrote:
>
> On Fri, Apr 14, 2023 at 04:01:57PM +0200, Paweł Anikiel wrote:
> > Add binding for chv3-audio device.
> >
> > Signed-off-by: Paweł Anikiel <pan@semihalf.com>
> > ---
> >  .../bindings/sound/google,chv3-audio.yaml     | 49 +++++++++++++++++++
> >  1 file changed, 49 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> > new file mode 100644
> > index 000000000000..8b602b60eaee
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> > @@ -0,0 +1,49 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/google,chv3-audio.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Google Chameleon v3 audio
> > +
> > +maintainers:
> > +  - Paweł Anikiel <pan@semihalf.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: google,chv3-audio
> > +
> > +  google,audio-cpu0:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of controller #0
> > +
> > +  google,audio-codec0:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of codec #0
> > +
> > +  google,audio-cpu1:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of controller #1
> > +
> > +  google,audio-codec1:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of codec #1
>
> Why do you need custom properties when we have standard property to
> point to these things (sound-dai). We also have bindings to handle
> multiple devices.

Thanks, I will read up on that and try to use it here

Regards,
Paweł
Re: [PATCH 3/9] dt-bindings: ASoC: Add chv3-audio
Posted by Rob Herring 2 years, 8 months ago
On Fri, 14 Apr 2023 16:01:57 +0200, Paweł Anikiel wrote:
> Add binding for chv3-audio device.
> 
> Signed-off-by: Paweł Anikiel <pan@semihalf.com>
> ---
>  .../bindings/sound/google,chv3-audio.yaml     | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-audio.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/sound/google,chv3-audio.yaml:34:23: [error] empty value in block mapping (empty-values)
./Documentation/devicetree/bindings/sound/google,chv3-audio.yaml:35:25: [error] empty value in block mapping (empty-values)
./Documentation/devicetree/bindings/sound/google,chv3-audio.yaml:36:23: [error] empty value in block mapping (empty-values)
./Documentation/devicetree/bindings/sound/google,chv3-audio.yaml:37:25: [error] empty value in block mapping (empty-values)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml: required:1: {'google,audio-cpu0': None} is not of type 'string'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml: required:2: {'google,audio-codec0': None} is not of type 'string'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml: required:3: {'google,audio-cpu1': None} is not of type 'string'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml: required:4: {'google,audio-codec1': None} is not of type 'string'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml: ignoring, error in schema: required: 1
Documentation/devicetree/bindings/sound/google,chv3-audio.example.dtb: /example-0/sound: failed to match any schema with compatible: ['google,chv3-audio']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230414140203.707729-4-pan@semihalf.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.