[v3,5/6] ASoC: dt-bindings: mediatek,mt7986-wm8960: add mt7986-wm8960 document

Message ID 20230728090819.18038-6-maso.huang@mediatek.com
State New
Headers
Series ASoC: mediatek: Add support for MT7986 SoC |

Commit Message

Maso Huang (黃加竹) July 28, 2023, 9:08 a.m. UTC
  Add document for mt7986 board with wm8960.

Signed-off-by: Maso Huang <maso.huang@mediatek.com>
---
 .../sound/mediatek,mt7986-wm8960.yaml         | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
  

Comments

AngeloGioacchino Del Regno July 28, 2023, 9:55 a.m. UTC | #1
Il 28/07/23 11:08, Maso Huang ha scritto:
> Add document for mt7986 board with wm8960.
> 
> Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> ---
>   .../sound/mediatek,mt7986-wm8960.yaml         | 53 +++++++++++++++++++
>   1 file changed, 53 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> new file mode 100644
> index 000000000000..76394f7e5502
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT7986 sound card with WM8960 codec
> +
> +maintainers:
> +  - Maso Huang <maso.huang@mediatek.com>
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt7986-wm8960-machine

mediatek,mt7986-wm8960-sound looks better.

After which,

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  
Maso Huang (黃加竹) July 28, 2023, 10:16 a.m. UTC | #2
On Fri, 2023-07-28 at 11:55 +0200, AngeloGioacchino Del Regno wrote:
> Il 28/07/23 11:08, Maso Huang ha scritto:
> > Add document for mt7986 board with wm8960.
> > 
> > Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> > ---
> >   .../sound/mediatek,mt7986-wm8960.yaml         | 53
> > +++++++++++++++++++
> >   1 file changed, 53 insertions(+)
> >   create mode 100644
> > Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > wm8960.yaml
> > b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > wm8960.yaml
> > new file mode 100644
> > index 000000000000..76394f7e5502
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > wm8960.yaml
> > @@ -0,0 +1,53 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: 
> > https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPPRaROt0$ 
> >  
> > +$schema: 
> > https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPttZILAo$ 
> >  
> > +
> > +title: MediaTek MT7986 sound card with WM8960 codec
> > +
> > +maintainers:
> > +  - Maso Huang <maso.huang@mediatek.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt7986-wm8960-machine
> 
> mediatek,mt7986-wm8960-sound looks better.
> 
> After which,
> 
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> 
> 

Hi Angelo,

Thanks for your review.
I'll change the compatible to "mediatek,mt7986-wm8960-sound" in v4
patch.

Best regards,
Maso
  
Krzysztof Kozlowski July 28, 2023, 12:49 p.m. UTC | #3
On 28/07/2023 11:08, Maso Huang wrote:
> Add document for mt7986 board with wm8960.
> 
> Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> ---
>  .../sound/mediatek,mt7986-wm8960.yaml         | 53 +++++++++++++++++++
>  1 file changed, 53 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> new file mode 100644
> index 000000000000..76394f7e5502
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT7986 sound card with WM8960 codec
> +
> +maintainers:
> +  - Maso Huang <maso.huang@mediatek.com>
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt7986-wm8960-machine
> +
> +  mediatek,platform:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of MT7986 platform.
> +
> +  audio-routing:
> +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> +    description:
> +      A list of the connections between audio components. Each entry is a
> +      sink/source pair of strings. Valid names could be the input or output
> +      widgets of audio components, power supplies, MicBias of codec and the
> +      software switch.
> +
> +  mediatek,audio-codec:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: The phandle of wm8960 codec.
> +

How did you implement Rob's comment? Or did you just ignore it?

Best regards,
Krzysztof
  
Maso Huang (黃加竹) July 31, 2023, 6:42 a.m. UTC | #4
On Fri, 2023-07-28 at 18:16 +0800, Maso Huang wrote:
> On Fri, 2023-07-28 at 11:55 +0200, AngeloGioacchino Del Regno wrote:
> > Il 28/07/23 11:08, Maso Huang ha scritto:
> > > Add document for mt7986 board with wm8960.
> > > 
> > > Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> > > ---
> > >   .../sound/mediatek,mt7986-wm8960.yaml         | 53
> > > +++++++++++++++++++
> > >   1 file changed, 53 insertions(+)
> > >   create mode 100644
> > > Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > wm8960.yaml
> > > 
> > > diff --git
> > > a/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > wm8960.yaml
> > > b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > wm8960.yaml
> > > new file mode 100644
> > > index 000000000000..76394f7e5502
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > wm8960.yaml
> > > @@ -0,0 +1,53 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: 
> > > 
https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPPRaROt0$
> > >  
> > >  
> > > +$schema: 
> > > 
https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPttZILAo$
> > >  
> > >  
> > > +
> > > +title: MediaTek MT7986 sound card with WM8960 codec
> > > +
> > > +maintainers:
> > > +  - Maso Huang <maso.huang@mediatek.com>
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: mediatek,mt7986-wm8960-machine
> > 
> > mediatek,mt7986-wm8960-sound looks better.
> > 
> > After which,
> > 
> > Reviewed-by: AngeloGioacchino Del Regno <
> > angelogioacchino.delregno@collabora.com>
> > 
> > 
> 
> Hi Angelo,
> 
> Thanks for your review.
> I'll change the compatible to "mediatek,mt7986-wm8960-sound" in v4
> patch.
> 
> Best regards,
> Maso
> 

Hi Angelo,

One more question for this compatible. 

The suffix "machine" means alsa machine driver for mt7986-wm8960. It
might be better to use "machine" here.

Or you prefer "sound" than "machine"?

Best regards,
Maso
  
Maso Huang (黃加竹) July 31, 2023, 7:31 a.m. UTC | #5
On Fri, 2023-07-28 at 14:49 +0200, Krzysztof Kozlowski wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 28/07/2023 11:08, Maso Huang wrote:
> > Add document for mt7986 board with wm8960.
> > 
> > Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> > ---
> >  .../sound/mediatek,mt7986-wm8960.yaml         | 53
> +++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> >  create mode 100644
> Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> > 
> > diff --git
> a/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml 
> b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
> > new file mode 100644
> > index 000000000000..76394f7e5502
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> wm8960.yaml
> > @@ -0,0 +1,53 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: 
> http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MediaTek MT7986 sound card with WM8960 codec
> > +
> > +maintainers:
> > +  - Maso Huang <maso.huang@mediatek.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt7986-wm8960-machine
> > +
> > +  mediatek,platform:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of MT7986 platform.
> > +
> > +  audio-routing:
> > +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> > +    description:
> > +      A list of the connections between audio components. Each
> entry is a
> > +      sink/source pair of strings. Valid names could be the input
> or output
> > +      widgets of audio components, power supplies, MicBias of
> codec and the
> > +      software switch.
> > +
> > +  mediatek,audio-codec:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description: The phandle of wm8960 codec.
> > +
> 
> How did you implement Rob's comment? Or did you just ignore it?
> 
> Best regards,
> Krzysztof
> 

Hi Krzysztof,

Sorry, I did not mean to ignore Rob's comment.
I waited for some suggestion in mail below, but it seems Rob was a
little busy.

https://lore.kernel.org/lkml/8c6316e79e40406e4d46709f602dcb14a4c00562.camel@mediatek.com/

After gentle ping last week and receiving your advice, I thought that
means to send the v3 patch and might discuss dtbingding in v3 series.

So sorry for misunderstanding it, I'll check the details with Rob in v3
series then refine it in v4.

Best regards,
Maso
  
Krzysztof Kozlowski July 31, 2023, 8:14 a.m. UTC | #6
On 31/07/2023 09:31, Maso Huang (黃加竹) wrote:
> On Fri, 2023-07-28 at 14:49 +0200, Krzysztof Kozlowski wrote:
>>  	 
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>  On 28/07/2023 11:08, Maso Huang wrote:
>>> Add document for mt7986 board with wm8960.
>>>
>>> Signed-off-by: Maso Huang <maso.huang@mediatek.com>
>>> ---
>>>  .../sound/mediatek,mt7986-wm8960.yaml         | 53
>> +++++++++++++++++++
>>>  1 file changed, 53 insertions(+)
>>>  create mode 100644
>> Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
>>>
>>> diff --git
>> a/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml 
>> b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
>>> new file mode 100644
>>> index 000000000000..76394f7e5502
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
>> wm8960.yaml
>>> @@ -0,0 +1,53 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: 
>> http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: MediaTek MT7986 sound card with WM8960 codec
>>> +
>>> +maintainers:
>>> +  - Maso Huang <maso.huang@mediatek.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: mediatek,mt7986-wm8960-machine
>>> +
>>> +  mediatek,platform:
>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>> +    description: The phandle of MT7986 platform.
>>> +
>>> +  audio-routing:
>>> +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
>>> +    description:
>>> +      A list of the connections between audio components. Each
>> entry is a
>>> +      sink/source pair of strings. Valid names could be the input
>> or output
>>> +      widgets of audio components, power supplies, MicBias of
>> codec and the
>>> +      software switch.
>>> +
>>> +  mediatek,audio-codec:
>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>> +    description: The phandle of wm8960 codec.
>>> +
>>
>> How did you implement Rob's comment? Or did you just ignore it?
>>
>> Best regards,
>> Krzysztof
>>
> 
> Hi Krzysztof,
> 
> Sorry, I did not mean to ignore Rob's comment.
> I waited for some suggestion in mail below, but it seems Rob was a
> little busy.
> 
> https://lore.kernel.org/lkml/8c6316e79e40406e4d46709f602dcb14a4c00562.camel@mediatek.com/
> 
> After gentle ping last week and receiving your advice, I thought that
> means to send the v3 patch and might discuss dtbingding in v3 series.
> 
> So sorry for misunderstanding it, I'll check the details with Rob in v3
> series then refine it in v4.

The problem is that you did not reference in this patch any ongoing
discussion and further questions, so comment looks like addressed, while
it was not.

Rob said:
"in a common schema and reference them "
You said:
"common part yaml and reference to it"
so I think you both agreed on the same.

The advice would be to create common binding which is then referenced by
other and your bindings. However if you start doing it, you will notice
that it is impossible, because you have conflicting types for
"audio-codec", so you cannot have one definition.

This leads to the point - property is probably wrong and you need
dai-link with sound-dai property, just like most cards are doing.

Best regards,
Krzysztof
  
AngeloGioacchino Del Regno July 31, 2023, 10:44 a.m. UTC | #7
Il 31/07/23 08:42, Maso Huang (黃加竹) ha scritto:
> On Fri, 2023-07-28 at 18:16 +0800, Maso Huang wrote:
>> On Fri, 2023-07-28 at 11:55 +0200, AngeloGioacchino Del Regno wrote:
>>> Il 28/07/23 11:08, Maso Huang ha scritto:
>>>> Add document for mt7986 board with wm8960.
>>>>
>>>> Signed-off-by: Maso Huang <maso.huang@mediatek.com>
>>>> ---
>>>>    .../sound/mediatek,mt7986-wm8960.yaml         | 53
>>>> +++++++++++++++++++
>>>>    1 file changed, 53 insertions(+)
>>>>    create mode 100644
>>>> Documentation/devicetree/bindings/sound/mediatek,mt7986-
>>>> wm8960.yaml
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/sound/mediatek,mt7986-
>>>> wm8960.yaml
>>>> b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
>>>> wm8960.yaml
>>>> new file mode 100644
>>>> index 000000000000..76394f7e5502
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
>>>> wm8960.yaml
>>>> @@ -0,0 +1,53 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>>> +%YAML 1.2
>>>> +---
>>>> +$id:
>>>>
> https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPPRaROt0$
>>>>   
>>>>   
>>>> +$schema:
>>>>
> https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPttZILAo$
>>>>   
>>>>   
>>>> +
>>>> +title: MediaTek MT7986 sound card with WM8960 codec
>>>> +
>>>> +maintainers:
>>>> +  - Maso Huang <maso.huang@mediatek.com>
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    const: mediatek,mt7986-wm8960-machine
>>>
>>> mediatek,mt7986-wm8960-sound looks better.
>>>
>>> After which,
>>>
>>> Reviewed-by: AngeloGioacchino Del Regno <
>>> angelogioacchino.delregno@collabora.com>
>>>
>>>
>>
>> Hi Angelo,
>>
>> Thanks for your review.
>> I'll change the compatible to "mediatek,mt7986-wm8960-sound" in v4
>> patch.
>>
>> Best regards,
>> Maso
>>
> 
> Hi Angelo,
> 
> One more question for this compatible.
> 
> The suffix "machine" means alsa machine driver for mt7986-wm8960. It
> might be better to use "machine" here.
> 
> Or you prefer "sound" than "machine"?
> 
> Best regards,
> Maso

I prefer "sound" because of consistency with other MediaTek machine driver
compatible strings.

Regards,
Angelo
  
Maso Huang (黃加竹) July 31, 2023, 12:38 p.m. UTC | #8
On Mon, 2023-07-31 at 12:44 +0200, AngeloGioacchino Del Regno wrote:
> Il 31/07/23 08:42, Maso Huang (黃加竹) ha scritto:
> > On Fri, 2023-07-28 at 18:16 +0800, Maso Huang wrote:
> > > On Fri, 2023-07-28 at 11:55 +0200, AngeloGioacchino Del Regno
> > > wrote:
> > > > Il 28/07/23 11:08, Maso Huang ha scritto:
> > > > > Add document for mt7986 board with wm8960.
> > > > > 
> > > > > Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> > > > > ---
> > > > >    .../sound/mediatek,mt7986-wm8960.yaml         | 53
> > > > > +++++++++++++++++++
> > > > >    1 file changed, 53 insertions(+)
> > > > >    create mode 100644
> > > > > Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > > > wm8960.yaml
> > > > > 
> > > > > diff --git
> > > > > a/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > > > wm8960.yaml
> > > > > b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > > > wm8960.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..76394f7e5502
> > > > > --- /dev/null
> > > > > +++
> > > > > b/Documentation/devicetree/bindings/sound/mediatek,mt7986-
> > > > > wm8960.yaml
> > > > > @@ -0,0 +1,53 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id:
> > > > > 
> > 
> > 
https://urldefense.com/v3/__http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPPRaROt0$
> > > > >   
> > > > >   
> > > > > +$schema:
> > > > > 
> > 
> > 
https://urldefense.com/v3/__http://devicetree.org/meta-schemas/core.yaml*__;Iw!!CTRNKA9wMg0ARbw!lu4Z6pJeRiL7-8l4T3ptqUCM54FnHTBiyh5KWBNqSjl6mOOI7WmzHpWEd-ZSZ-2NJ4Cs9PPaAF_75ywo2SKW16MPttZILAo$
> > > > >   
> > > > >   
> > > > > +
> > > > > +title: MediaTek MT7986 sound card with WM8960 codec
> > > > > +
> > > > > +maintainers:
> > > > > +  - Maso Huang <maso.huang@mediatek.com>
> > > > > +
> > > > > +properties:
> > > > > +  compatible:
> > > > > +    const: mediatek,mt7986-wm8960-machine
> > > > 
> > > > mediatek,mt7986-wm8960-sound looks better.
> > > > 
> > > > After which,
> > > > 
> > > > Reviewed-by: AngeloGioacchino Del Regno <
> > > > angelogioacchino.delregno@collabora.com>
> > > > 
> > > > 
> > > 
> > > Hi Angelo,
> > > 
> > > Thanks for your review.
> > > I'll change the compatible to "mediatek,mt7986-wm8960-sound" in
> > > v4
> > > patch.
> > > 
> > > Best regards,
> > > Maso
> > > 
> > 
> > Hi Angelo,
> > 
> > One more question for this compatible.
> > 
> > The suffix "machine" means alsa machine driver for mt7986-wm8960.
> > It
> > might be better to use "machine" here.
> > 
> > Or you prefer "sound" than "machine"?
> > 
> > Best regards,
> > Maso
> 
> I prefer "sound" because of consistency with other MediaTek machine
> driver
> compatible strings.
> 
> Regards,
> Angelo

Hi Angelo,

No problem, I'll use "mediatek,mt7986-wm8960-sound" as compatible in v4
patch :)

Best regards,
Maso
  
Krzysztof Kozlowski July 31, 2023, 2:56 p.m. UTC | #9
On 31/07/2023 10:14, Krzysztof Kozlowski wrote:
>>>> +  mediatek,audio-codec:
>>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>>> +    description: The phandle of wm8960 codec.
>>>> +
>>>
>>> How did you implement Rob's comment? Or did you just ignore it?
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>
>> Hi Krzysztof,
>>
>> Sorry, I did not mean to ignore Rob's comment.
>> I waited for some suggestion in mail below, but it seems Rob was a
>> little busy.
>>
>> https://lore.kernel.org/lkml/8c6316e79e40406e4d46709f602dcb14a4c00562.camel@mediatek.com/
>>
>> After gentle ping last week and receiving your advice, I thought that
>> means to send the v3 patch and might discuss dtbingding in v3 series.
>>
>> So sorry for misunderstanding it, I'll check the details with Rob in v3
>> series then refine it in v4.
> 
> The problem is that you did not reference in this patch any ongoing
> discussion and further questions, so comment looks like addressed, while
> it was not.
> 
> Rob said:
> "in a common schema and reference them "
> You said:
> "common part yaml and reference to it"
> so I think you both agreed on the same.
> 
> The advice would be to create common binding which is then referenced by
> other and your bindings. However if you start doing it, you will notice
> that it is impossible, because you have conflicting types for
> "audio-codec", so you cannot have one definition.
> 
> This leads to the point - property is probably wrong and you need
> dai-link with sound-dai property, just like most cards are doing.

BTW, might be useful for you, just sent:
https://lore.kernel.org/linux-devicetree/20230731094303.185067-1-krzysztof.kozlowski@linaro.org/T/#t

Anyway you need dai-links, I think.

Best regards,
Krzysztof
  
Maso Huang (黃加竹) Aug. 4, 2023, 7:08 a.m. UTC | #10
On Mon, 2023-07-31 at 16:56 +0200, Krzysztof Kozlowski wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 31/07/2023 10:14, Krzysztof Kozlowski wrote:
> >>>> +  mediatek,audio-codec:
> >>>> +    $ref: /schemas/types.yaml#/definitions/phandle
> >>>> +    description: The phandle of wm8960 codec.
> >>>> +
> >>>
> >>> How did you implement Rob's comment? Or did you just ignore it?
> >>>
> >>> Best regards,
> >>> Krzysztof
> >>>
> >>
> >> Hi Krzysztof,
> >>
> >> Sorry, I did not mean to ignore Rob's comment.
> >> I waited for some suggestion in mail below, but it seems Rob was a
> >> little busy.
> >>
> >> 
> https://lore.kernel.org/lkml/8c6316e79e40406e4d46709f602dcb14a4c00562.camel@mediatek.com/
> >>
> >> After gentle ping last week and receiving your advice, I thought
> that
> >> means to send the v3 patch and might discuss dtbingding in v3
> series.
> >>
> >> So sorry for misunderstanding it, I'll check the details with Rob
> in v3
> >> series then refine it in v4.
> > 
> > The problem is that you did not reference in this patch any ongoing
> > discussion and further questions, so comment looks like addressed,
> while
> > it was not.
> > 
> > Rob said:
> > "in a common schema and reference them "
> > You said:
> > "common part yaml and reference to it"
> > so I think you both agreed on the same.
> > 
> > The advice would be to create common binding which is then
> referenced by
> > other and your bindings. However if you start doing it, you will
> notice
> > that it is impossible, because you have conflicting types for
> > "audio-codec", so you cannot have one definition.
> > 
> > This leads to the point - property is probably wrong and you need
> > dai-link with sound-dai property, just like most cards are doing.
> 
> BTW, might be useful for you, just sent:
> 
https://lore.kernel.org/linux-devicetree/20230731094303.185067-1-krzysztof.kozlowski@linaro.org/T/#t
> 
> Anyway you need dai-links, I think.
> 
> Best regards,
> Krzysztof
> 

Hi Krzysztof,

Thanks for your useful info!
I'll reference to sound-card-common.yaml for audio-routing.

For mediatek,platform and mediatek,audio-codec, I would like to replace
them with cpu and codec as properties directly like below.

cpu {
    sound-dai <&ate>;
};

codec {
    sound-dai <&wm8960>;
};

Is that OK?

Best regards,
Maso
  

Patch

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
new file mode 100644
index 000000000000..76394f7e5502
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/mediatek,mt7986-wm8960.yaml
@@ -0,0 +1,53 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/mediatek,mt7986-wm8960.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT7986 sound card with WM8960 codec
+
+maintainers:
+  - Maso Huang <maso.huang@mediatek.com>
+
+properties:
+  compatible:
+    const: mediatek,mt7986-wm8960-machine
+
+  mediatek,platform:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of MT7986 platform.
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description:
+      A list of the connections between audio components. Each entry is a
+      sink/source pair of strings. Valid names could be the input or output
+      widgets of audio components, power supplies, MicBias of codec and the
+      software switch.
+
+  mediatek,audio-codec:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of wm8960 codec.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - mediatek,platform
+  - audio-routing
+  - mediatek,audio-codec
+
+examples:
+  - |
+    sound {
+        compatible = "mediatek,mt7986-wm8960-machine";
+        mediatek,platform = <&afe>;
+        audio-routing =
+            "Headphone", "HP_L",
+            "Headphone", "HP_R",
+            "LINPUT1", "AMIC",
+            "RINPUT1", "AMIC";
+        mediatek,audio-codec = <&wm8960>;
+    };
+
+...