devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: dt-bindings: mt6359: Update generic node name and dmic-mode
@ 2024-09-26  9:25 Macpaul Lin
  2024-09-26  9:25 ` [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec Macpaul Lin
  2024-09-26  9:25 ` [PATCH 3/3] arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec Macpaul Lin
  0 siblings, 2 replies; 7+ messages in thread
From: Macpaul Lin @ 2024-09-26  9:25 UTC (permalink / raw)
  To: Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Liam Girdwood, Mark Brown, Eason Yen,
	Jiaxin Yu, Shane Chien, Hui Liu, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-sound,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chris-qj chen,
	MediaTek Chromebook Upstream, Chen-Yu Tsai

Some fix and updates in the following items:
1. examples:
   Update generic node name to 'audio-codec' to comply with the
   coming change in 'mt6359.dtsi'. This change is necessary to fix the
   dtbs_check error:
   pmic: 'mt6359codec' does not match any of the regexes: 'pinctrl-[0-9]+'

2. mediatek,dmic-mode:
   After inspecting the .dts and .dtsi files using 'mt6359-codec', it was
   discovered that the definitions of 'two wires' and 'one wire' are
   inverted compared to the DT schema.
   For example, the following boards using MT6359 PMIC:
    - mt8192-asurada.dtsi
    - mt8195-cherry.dtsi
   These boards use the same definitions of 'dmic-mode' as other boards
   using MT6358 PMIC. The meaning of '0' or '1' has been noted as comments
   in the device trees.

   Upon examining the code in [1] and [2], it was confirmed that the
   definitions of 'dmic-mode' are consistent between "MT6359 PMIC" and
   "MT6358 PMIC". Therefore, the DT Schema should be correct as is.

References:
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/codecs/mt6358.c#n1875
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/codecs/mt6359.c#L1515

Fixes: 539237d1c609 ("dt-bindings: mediatek: mt6359: add codec document")
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 Documentation/devicetree/bindings/sound/mt6359.yaml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/mt6359.yaml b/Documentation/devicetree/bindings/sound/mt6359.yaml
index 23d411fc4200..128698630c86 100644
--- a/Documentation/devicetree/bindings/sound/mt6359.yaml
+++ b/Documentation/devicetree/bindings/sound/mt6359.yaml
@@ -23,8 +23,8 @@ properties:
       Indicates how many data pins are used to transmit two channels of PDM
       signal. 0 means two wires, 1 means one wire. Default value is 0.
     enum:
-      - 0 # one wire
-      - 1 # two wires
+      - 0 # two wires
+      - 1 # one wire
 
   mediatek,mic-type-0:
     $ref: /schemas/types.yaml#/definitions/uint32
@@ -53,9 +53,9 @@ additionalProperties: false
 
 examples:
   - |
-    mt6359codec: mt6359codec {
-      mediatek,dmic-mode = <0>;
-      mediatek,mic-type-0 = <2>;
+    mt6359codec: audio-codec {
+        mediatek,dmic-mode = <0>;
+        mediatek,mic-type-0 = <2>;
     };
 
 ...
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec
  2024-09-26  9:25 [PATCH 1/3] ASoC: dt-bindings: mt6359: Update generic node name and dmic-mode Macpaul Lin
@ 2024-09-26  9:25 ` Macpaul Lin
  2024-09-26 16:04   ` Conor Dooley
  2024-09-26  9:25 ` [PATCH 3/3] arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec Macpaul Lin
  1 sibling, 1 reply; 7+ messages in thread
From: Macpaul Lin @ 2024-09-26  9:25 UTC (permalink / raw)
  To: Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Liam Girdwood, Mark Brown, Eason Yen,
	Jiaxin Yu, Shane Chien, Hui Liu, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-sound,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chris-qj chen,
	MediaTek Chromebook Upstream, Chen-Yu Tsai

This patch updates the audio-codec properties includes:
 - compatible:
  - Re-order the supported device items.
  - Add 'mt6359-codec' to compatible since MT6359 PMIC has been included
    in this DT Schema.
  - Set 'additionalProperties: true' for 'mt6359-codec'.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
index 40cabaf60d0d..ffb5848a96d5 100644
--- a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
+++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
@@ -104,7 +104,7 @@ properties:
 
   audio-codec:
     type: object
-    additionalProperties: false
+    additionalProperties: true
     description:
       Audio codec support with MT6397 and MT6358.
 
@@ -112,8 +112,9 @@ properties:
       compatible:
         oneOf:
           - enum:
-              - mediatek,mt6397-codec
               - mediatek,mt6358-sound
+              - mediatek,mt6359-codec
+              - mediatek,mt6397-codec
           - items:
               - enum:
                   - mediatek,mt6366-sound
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec
  2024-09-26  9:25 [PATCH 1/3] ASoC: dt-bindings: mt6359: Update generic node name and dmic-mode Macpaul Lin
  2024-09-26  9:25 ` [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec Macpaul Lin
@ 2024-09-26  9:25 ` Macpaul Lin
  1 sibling, 0 replies; 7+ messages in thread
From: Macpaul Lin @ 2024-09-26  9:25 UTC (permalink / raw)
  To: Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Liam Girdwood, Mark Brown, Eason Yen,
	Jiaxin Yu, Shane Chien, Hui Liu, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-sound,
	Alexandre Mergnat
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chris-qj chen,
	MediaTek Chromebook Upstream, Chen-Yu Tsai

This change fixes these dtbs_check errors for audio-codec:
1. pmic: 'mt6359codec' does not match any of the regexes: 'pinctrl-[0-9]+'
 - Replace device node name to generic 'audio-codec'
2. pmic: regulators: 'compatible' is a required property
 - Add 'mediatek,mt6359-codec' to compatible.

Fixes: 3b7d143be4b7 ("arm64: dts: mt6359: add PMIC MT6359 related nodes")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt6359.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt6359.dtsi b/arch/arm64/boot/dts/mediatek/mt6359.dtsi
index dd732a820a7c..47bbd665a5a5 100644
--- a/arch/arm64/boot/dts/mediatek/mt6359.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6359.dtsi
@@ -14,7 +14,8 @@ pmic_adc: adc {
 			#io-channel-cells = <1>;
 		};
 
-		mt6359codec: mt6359codec {
+		mt6359codec: audio-codec {
+			compatible = "mediatek,mt6359-codec";
 		};
 
 		regulators {
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec
  2024-09-26  9:25 ` [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec Macpaul Lin
@ 2024-09-26 16:04   ` Conor Dooley
  2024-09-27  7:57     ` Macpaul Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Conor Dooley @ 2024-09-26 16:04 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Sen Chu, Sean Wang, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Liam Girdwood, Mark Brown, Eason Yen, Jiaxin Yu, Shane Chien,
	Hui Liu, linux-pm, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, linux-sound, Alexandre Mergnat, Bear Wang,
	Pablo Sun, Macpaul Lin, Chris-qj chen,
	MediaTek Chromebook Upstream, Chen-Yu Tsai

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

On Thu, Sep 26, 2024 at 05:25:18PM +0800, Macpaul Lin wrote:
> This patch updates the audio-codec properties includes:
>  - compatible:
>   - Re-order the supported device items.
>   - Add 'mt6359-codec' to compatible since MT6359 PMIC has been included
>     in this DT Schema.

>   - Set 'additionalProperties: true' for 'mt6359-codec'.

Why?

> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
> index 40cabaf60d0d..ffb5848a96d5 100644
> --- a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
> +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
> @@ -104,7 +104,7 @@ properties:
>  
>    audio-codec:
>      type: object
> -    additionalProperties: false
> +    additionalProperties: true
>      description:
>        Audio codec support with MT6397 and MT6358.
>  
> @@ -112,8 +112,9 @@ properties:
>        compatible:
>          oneOf:
>            - enum:
> -              - mediatek,mt6397-codec
>                - mediatek,mt6358-sound
> +              - mediatek,mt6359-codec
> +              - mediatek,mt6397-codec
>            - items:
>                - enum:
>                    - mediatek,mt6366-sound
> -- 
> 2.45.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec
  2024-09-26 16:04   ` Conor Dooley
@ 2024-09-27  7:57     ` Macpaul Lin
  2024-09-27  9:42       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Macpaul Lin @ 2024-09-27  7:57 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Sen Chu, Sean Wang, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Liam Girdwood, Mark Brown, Eason Yen, Jiaxin Yu, Shane Chien,
	Hui Liu, linux-pm, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, linux-sound, Alexandre Mergnat, Bear Wang,
	Pablo Sun, Macpaul Lin, Chris-qj chen,
	MediaTek Chromebook Upstream, Chen-Yu Tsai

On 9/27/24 00:04, Conor Dooley wrote:
> On Thu, Sep 26, 2024 at 05:25:18PM +0800, Macpaul Lin wrote:
>> This patch updates the audio-codec properties includes:
>>   - compatible:
>>    - Re-order the supported device items.
>>    - Add 'mt6359-codec' to compatible since MT6359 PMIC has been included
>>      in this DT Schema.
> 
>>    - Set 'additionalProperties: true' for 'mt6359-codec'.
> 
> Why?

The mt6359-codec support these 3 properties:
mediatek,mic-type0, mediatek,mic-type-1, mediatek-mic-type2.
While mt6358-sound and mt6397-codec don't (at least, I didn't find
these 3 properties in driver codes.

Set 'additionalProperties: true' is also required to fix the following
dtbs_check errors:
pmic: audio-codec: 'mediatek,mic-type-0', 'mediatek,mic-type-1',
       'mediatek,mic-type-2' do not match any of the regexes:
       'pinctrl-[0-9]+'

>>
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>   Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> index 40cabaf60d0d..ffb5848a96d5 100644
>> --- a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> @@ -104,7 +104,7 @@ properties:
>>   
>>     audio-codec:
>>       type: object
>> -    additionalProperties: false
>> +    additionalProperties: true
>>       description:
>>         Audio codec support with MT6397 and MT6358.
>>   
>> @@ -112,8 +112,9 @@ properties:
>>         compatible:
>>           oneOf:
>>             - enum:
>> -              - mediatek,mt6397-codec
>>                 - mediatek,mt6358-sound
>> +              - mediatek,mt6359-codec
>> +              - mediatek,mt6397-codec
>>             - items:
>>                 - enum:
>>                     - mediatek,mt6366-sound
>> -- 
>> 2.45.2
>>

Thanks
Macpaul Lin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec
  2024-09-27  7:57     ` Macpaul Lin
@ 2024-09-27  9:42       ` Krzysztof Kozlowski
  2024-09-30  5:42         ` Macpaul Lin
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-09-27  9:42 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Conor Dooley, Sen Chu, Sean Wang, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Liam Girdwood, Mark Brown, Eason Yen,
	Jiaxin Yu, Shane Chien, Hui Liu, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-sound,
	Alexandre Mergnat, Bear Wang, Pablo Sun, Macpaul Lin,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai

On Fri, Sep 27, 2024 at 03:57:58PM +0800, Macpaul Lin wrote:
> On 9/27/24 00:04, Conor Dooley wrote:
> > On Thu, Sep 26, 2024 at 05:25:18PM +0800, Macpaul Lin wrote:
> > > This patch updates the audio-codec properties includes:
> > >   - compatible:
> > >    - Re-order the supported device items.
> > >    - Add 'mt6359-codec' to compatible since MT6359 PMIC has been included
> > >      in this DT Schema.
> > 
> > >    - Set 'additionalProperties: true' for 'mt6359-codec'.
> > 
> > Why?
> 
> The mt6359-codec support these 3 properties:
> mediatek,mic-type0, mediatek,mic-type-1, mediatek-mic-type2.
> While mt6358-sound and mt6397-codec don't (at least, I didn't find
> these 3 properties in driver codes.
> 
> Set 'additionalProperties: true' is also required to fix the following
> dtbs_check errors:
> pmic: audio-codec: 'mediatek,mic-type-0', 'mediatek,mic-type-1',
>       'mediatek,mic-type-2' do not match any of the regexes:
>       'pinctrl-[0-9]+'

Why is this a correct fix? Aren't you allowing "pink-pony" property as
well?

> 
> > > 
> > > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > > ---
> > >   Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 5 +++--

There is no such file.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec
  2024-09-27  9:42       ` Krzysztof Kozlowski
@ 2024-09-30  5:42         ` Macpaul Lin
  0 siblings, 0 replies; 7+ messages in thread
From: Macpaul Lin @ 2024-09-30  5:42 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Conor Dooley, Sen Chu, Sean Wang, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Liam Girdwood, Mark Brown, Eason Yen,
	Jiaxin Yu, Shane Chien, Hui Liu, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-sound,
	Alexandre Mergnat, Bear Wang, Pablo Sun, Macpaul Lin,
	Chris-qj chen, MediaTek Chromebook Upstream, Chen-Yu Tsai



On 9/27/24 17:42, Krzysztof Kozlowski wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On Fri, Sep 27, 2024 at 03:57:58PM +0800, Macpaul Lin wrote:
>> On 9/27/24 00:04, Conor Dooley wrote:
>> > On Thu, Sep 26, 2024 at 05:25:18PM +0800, Macpaul Lin wrote:
>> > > This patch updates the audio-codec properties includes:
>> > >   - compatible:
>> > >    - Re-order the supported device items.
>> > >    - Add 'mt6359-codec' to compatible since MT6359 PMIC has been included
>> > >      in this DT Schema.
>> > 
>> > >    - Set 'additionalProperties: true' for 'mt6359-codec'.
>> > 
>> > Why?
>> 
>> The mt6359-codec support these 3 properties:
>> mediatek,mic-type0, mediatek,mic-type-1, mediatek-mic-type2.
>> While mt6358-sound and mt6397-codec don't (at least, I didn't find
>> these 3 properties in driver codes.
>> 
>> Set 'additionalProperties: true' is also required to fix the following
>> dtbs_check errors:
>> pmic: audio-codec: 'mediatek,mic-type-0', 'mediatek,mic-type-1',
>>       'mediatek,mic-type-2' do not match any of the regexes:
>>       'pinctrl-[0-9]+'
> 
> Why is this a correct fix? Aren't you allowing "pink-pony" property as
> well?
> 
>> 
>> > > 
>> > > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> > > ---
>> > >   Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml | 5 +++--
> 
> There is no such file.
> 
> Best regards,
> Krzysztof
> 

This patch is no longer necessary. I'm working on a new fix (v7)
for 'Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml' and try 
to rid of these mess in audio-codec node.

Thanks
Macpaul Lin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-30  5:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26  9:25 [PATCH 1/3] ASoC: dt-bindings: mt6359: Update generic node name and dmic-mode Macpaul Lin
2024-09-26  9:25 ` [PATCH 2/3] dt-bindings: mfd: mediatek: mt6397: add compatible for mt6359-codec Macpaul Lin
2024-09-26 16:04   ` Conor Dooley
2024-09-27  7:57     ` Macpaul Lin
2024-09-27  9:42       ` Krzysztof Kozlowski
2024-09-30  5:42         ` Macpaul Lin
2024-09-26  9:25 ` [PATCH 3/3] arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec Macpaul Lin

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