[PATCH 2/4] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support

Laurentiu Mihalcea posted 4 patches 1 month ago
There is a newer version of this series
[PATCH 2/4] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support
Posted by Laurentiu Mihalcea 1 month ago
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Introduce the 'widgets' property, allowing the creation of widgets from
4 template widgets: Microphone, Line, Headphone, and Speaker. Also
introduce the 'hp-det-gpios' property, which allows using headphone
detection using the specified GPIO.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../devicetree/bindings/sound/audio-graph-card2.yaml     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
index f943f90d8b15..f0300a08f7fe 100644
--- a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
+++ b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
@@ -37,6 +37,15 @@ properties:
   codec2codec:
     type: object
     description: Codec to Codec node
+  hp-det-gpios:
+    maxItems: 1
+  widgets:
+    description:
+      User specified audio sound widgets.
+      Each entry is a pair of strings, the first being the type of
+      widget ("Microphone", "Line", "Headphone", "Speaker"), the
+      second being the machine specific name for the widget.
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
 
 required:
   - compatible
-- 
2.34.1
Re: [PATCH 2/4] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support
Posted by Frank Li 1 month ago
On Wed, Oct 23, 2024 at 12:21:12PM -0400, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> Introduce the 'widgets' property, allowing the creation of widgets from
> 4 template widgets: Microphone, Line, Headphone, and Speaker. Also
> introduce the 'hp-det-gpios' property, which allows using headphone
> detection using the specified GPIO.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../devicetree/bindings/sound/audio-graph-card2.yaml     | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> index f943f90d8b15..f0300a08f7fe 100644
> --- a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> +++ b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> @@ -37,6 +37,15 @@ properties:
>    codec2codec:
>      type: object
>      description: Codec to Codec node
> +  hp-det-gpios:
> +    maxItems: 1
> +  widgets:
> +    description:
> +      User specified audio sound widgets.
> +      Each entry is a pair of strings, the first being the type of
> +      widget ("Microphone", "Line", "Headphone", "Speaker"), the
> +      second being the machine specific name for the widget.
> +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array

Is it possible $ref: /schemas/sound/audio-graph.yaml to avoid duplicate
these properties like audio-graph-card.yaml

Frank

>
>  required:
>    - compatible
> --
> 2.34.1
>
Re: [PATCH 2/4] ASoC: dt-bindings: audio-graph-card2: add widgets and hp-det-gpios support
Posted by Kuninori Morimoto 1 month ago
Hi

> > From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >
> > Introduce the 'widgets' property, allowing the creation of widgets from
> > 4 template widgets: Microphone, Line, Headphone, and Speaker. Also
> > introduce the 'hp-det-gpios' property, which allows using headphone
> > detection using the specified GPIO.
> >
> > Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> > ---
> >  .../devicetree/bindings/sound/audio-graph-card2.yaml     | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> > index f943f90d8b15..f0300a08f7fe 100644
> > --- a/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> > +++ b/Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
> > @@ -37,6 +37,15 @@ properties:
> >    codec2codec:
> >      type: object
> >      description: Codec to Codec node
> > +  hp-det-gpios:
> > +    maxItems: 1
> > +  widgets:
> > +    description:
> > +      User specified audio sound widgets.
> > +      Each entry is a pair of strings, the first being the type of
> > +      widget ("Microphone", "Line", "Headphone", "Speaker"), the
> > +      second being the machine specific name for the widget.
> > +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> 
> Is it possible $ref: /schemas/sound/audio-graph.yaml to avoid duplicate
> these properties like audio-graph-card.yaml

You can find both "hp-det-gpios" and "widget" already exist in audio-graph.yaml

Thank you for your help !!

Best regards
---
Kuninori Morimoto