diff mbox series

[v4,2/9] dt-bindings: rtc: mediatek: convert MT6397 rtc documentation

Message ID 20221005-mt6357-support-v4-2-5d2bb58e6087@baylibre.com
State Changes Requested
Headers show
Series Add MediaTek MT6357 PMIC support | expand

Commit Message

Alexandre Mergnat Nov. 8, 2022, 6:43 p.m. UTC
- Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
- Add mediatek,mt6357-rtc compatible.
- Add maintainer
- Remove the .txt binding file

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
 .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
 .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
 3 files changed, 41 insertions(+), 32 deletions(-)

Comments

Rob Herring (Arm) Nov. 8, 2022, 10:30 p.m. UTC | #1
On Tue, 08 Nov 2022 19:43:37 +0100, Alexandre Mergnat wrote:
> - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> - Add mediatek,mt6357-rtc compatible.
> - Add maintainer
> - Remove the .txt binding file
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>  Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
>  .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
>  .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
>  3 files changed, 41 insertions(+), 32 deletions(-)
> 

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:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.example.dtb:0:0: /example-0/pmic: failed to match any schema with compatible: ['mediatek,mt6397']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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.
AngeloGioacchino Del Regno Nov. 9, 2022, 9:40 a.m. UTC | #2
Il 08/11/22 19:43, Alexandre Mergnat ha scritto:
> - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> - Add mediatek,mt6357-rtc compatible.
> - Add maintainer
> - Remove the .txt binding file
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>   Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
>   .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
>   .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
>   3 files changed, 41 insertions(+), 32 deletions(-)
> 

Please split the txt->yaml conversion in one commit and the addition of the
new mt6357-rtc compatible in another commit.

Also, isn't the original maintainer of rtc-mt6397 supposed to be...
Tianping Fang <tianping.fang@mediatek.com> ?

You can add yourself to the list of maintainers, though, unless Tianping
explicitly says that he doesn't want to maintain this driver anymore?

Regards,
Angelo
Alexandre Belloni Nov. 9, 2022, 5:49 p.m. UTC | #3
On 09/11/2022 10:40:39+0100, AngeloGioacchino Del Regno wrote:
> Il 08/11/22 19:43, Alexandre Mergnat ha scritto:
> > - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> > - Add mediatek,mt6357-rtc compatible.
> > - Add maintainer
> > - Remove the .txt binding file
> > 
> > Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> > ---
> >   Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
> >   .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
> >   .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
> >   3 files changed, 41 insertions(+), 32 deletions(-)
> > 
> 
> Please split the txt->yaml conversion in one commit and the addition of the
> new mt6357-rtc compatible in another commit.
> 
> Also, isn't the original maintainer of rtc-mt6397 supposed to be...
> Tianping Fang <tianping.fang@mediatek.com> ?
> 
> You can add yourself to the list of maintainers, though, unless Tianping
> explicitly says that he doesn't want to maintain this driver anymore?
> 

This is not about the maintenance of the driver but of the device tree
bindings for the IP

> Regards,
> Angelo
>
Rob Herring (Arm) Nov. 9, 2022, 10:29 p.m. UTC | #4
On Tue, Nov 08, 2022 at 07:43:37PM +0100, Alexandre Mergnat wrote:
> - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> - Add mediatek,mt6357-rtc compatible.
> - Add maintainer
> - Remove the .txt binding file
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>  Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
>  .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
>  .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
>  3 files changed, 41 insertions(+), 32 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
> index 0088442efca1..79aaf21af8e9 100644
> --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
> +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
> @@ -33,7 +33,7 @@ Optional subnodes:
>  		- compatible: "mediatek,mt6331-rtc"
>  		- compatible: "mediatek,mt6358-rtc"
>  		- compatible: "mediatek,mt6397-rtc"
> -	For details, see ../rtc/rtc-mt6397.txt
> +	For details, see ../rtc/mediatek,mt6397-rtc.yaml
>  - regulators
>  	Required properties:
>  		- compatible: "mediatek,mt6323-regulator"
> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> new file mode 100644
> index 000000000000..bb48c0150f95
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> @@ -0,0 +1,40 @@
> + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC
> +
> +maintainers:
> +  - Alexandre Mergnat <amergnat@baylibre.com>
> +
> +description: |
> +  MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
> +  as a type of multi-function device (MFD). The RTC can be configured and set up
> +  with PMIC wrapper bus which is a common resource shared with the other
> +  functions found on the same PMIC.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mediatek,mt6323-rtc
> +      - mediatek,mt6357-rtc
> +      - mediatek,mt6358-rtc
> +      - mediatek,mt6366-rtc
> +      - mediatek,mt6397-rtc

As this is only a compatible string, just fold this into the MFD schema 
doc.

> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +
> +examples:
> +  - |
> +    pmic {
> +        compatible = "mediatek,mt6397";
> +
> +        rtc {
> +               compatible = "mediatek,mt6397-rtc";
> +        };
> +    };
Alexandre Belloni Nov. 9, 2022, 10:57 p.m. UTC | #5
On 09/11/2022 16:29:16-0600, Rob Herring wrote:
> On Tue, Nov 08, 2022 at 07:43:37PM +0100, Alexandre Mergnat wrote:
> > - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> > - Add mediatek,mt6357-rtc compatible.
> > - Add maintainer
> > - Remove the .txt binding file
> > 
> > Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> > ---
> >  Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
> >  .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
> >  .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
> >  3 files changed, 41 insertions(+), 32 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
> > index 0088442efca1..79aaf21af8e9 100644
> > --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
> > +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
> > @@ -33,7 +33,7 @@ Optional subnodes:
> >  		- compatible: "mediatek,mt6331-rtc"
> >  		- compatible: "mediatek,mt6358-rtc"
> >  		- compatible: "mediatek,mt6397-rtc"
> > -	For details, see ../rtc/rtc-mt6397.txt
> > +	For details, see ../rtc/mediatek,mt6397-rtc.yaml
> >  - regulators
> >  	Required properties:
> >  		- compatible: "mediatek,mt6323-regulator"
> > diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> > new file mode 100644
> > index 000000000000..bb48c0150f95
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> > @@ -0,0 +1,40 @@
> > + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC
> > +
> > +maintainers:
> > +  - Alexandre Mergnat <amergnat@baylibre.com>
> > +
> > +description: |
> > +  MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
> > +  as a type of multi-function device (MFD). The RTC can be configured and set up
> > +  with PMIC wrapper bus which is a common resource shared with the other
> > +  functions found on the same PMIC.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - mediatek,mt6323-rtc
> > +      - mediatek,mt6357-rtc
> > +      - mediatek,mt6358-rtc
> > +      - mediatek,mt6366-rtc
> > +      - mediatek,mt6397-rtc
> 
> As this is only a compatible string, just fold this into the MFD schema 
> doc.

Actually, it probably also supports the start-year property

> 
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +
> > +examples:
> > +  - |
> > +    pmic {
> > +        compatible = "mediatek,mt6397";
> > +
> > +        rtc {
> > +               compatible = "mediatek,mt6397-rtc";
> > +        };
> > +    };
Krzysztof Kozlowski Nov. 10, 2022, 2:14 p.m. UTC | #6
On 09/11/2022 23:57, Alexandre Belloni wrote:
> On 09/11/2022 16:29:16-0600, Rob Herring wrote:
>> On Tue, Nov 08, 2022 at 07:43:37PM +0100, Alexandre Mergnat wrote:
>>> - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
>>> - Add mediatek,mt6357-rtc compatible.
>>> - Add maintainer
>>> - Remove the .txt binding file
>>>
>>> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
>>> ---
>>>  Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
>>>  .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
>>>  .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
>>>  3 files changed, 41 insertions(+), 32 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
>>> index 0088442efca1..79aaf21af8e9 100644
>>> --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
>>> +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
>>> @@ -33,7 +33,7 @@ Optional subnodes:
>>>  		- compatible: "mediatek,mt6331-rtc"
>>>  		- compatible: "mediatek,mt6358-rtc"
>>>  		- compatible: "mediatek,mt6397-rtc"
>>> -	For details, see ../rtc/rtc-mt6397.txt
>>> +	For details, see ../rtc/mediatek,mt6397-rtc.yaml
>>>  - regulators
>>>  	Required properties:
>>>  		- compatible: "mediatek,mt6323-regulator"
>>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
>>> new file mode 100644
>>> index 000000000000..bb48c0150f95
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
>>> @@ -0,0 +1,40 @@
>>> + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC
>>> +
>>> +maintainers:
>>> +  - Alexandre Mergnat <amergnat@baylibre.com>
>>> +
>>> +description: |
>>> +  MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
>>> +  as a type of multi-function device (MFD). The RTC can be configured and set up
>>> +  with PMIC wrapper bus which is a common resource shared with the other
>>> +  functions found on the same PMIC.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - mediatek,mt6323-rtc
>>> +      - mediatek,mt6357-rtc
>>> +      - mediatek,mt6358-rtc
>>> +      - mediatek,mt6366-rtc
>>> +      - mediatek,mt6397-rtc
>>
>> As this is only a compatible string, just fold this into the MFD schema 
>> doc.
> 
> Actually, it probably also supports the start-year property

What about rest of rtc.yaml schema?

Best regards,
Krzysztof
Alexandre Belloni Nov. 14, 2022, 10:57 p.m. UTC | #7
On 10/11/2022 15:14:01+0100, Krzysztof Kozlowski wrote:
> On 09/11/2022 23:57, Alexandre Belloni wrote:
> > On 09/11/2022 16:29:16-0600, Rob Herring wrote:
> >> On Tue, Nov 08, 2022 at 07:43:37PM +0100, Alexandre Mergnat wrote:
> >>> - Convert rtc/rtc-mt6397.txt to rtc/mt6397-rtc.yaml
> >>> - Add mediatek,mt6357-rtc compatible.
> >>> - Add maintainer
> >>> - Remove the .txt binding file
> >>>
> >>> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> >>> ---
> >>>  Documentation/devicetree/bindings/mfd/mt6397.txt   |  2 +-
> >>>  .../bindings/rtc/mediatek,mt6397-rtc.yaml          | 40 ++++++++++++++++++++++
> >>>  .../devicetree/bindings/rtc/rtc-mt6397.txt         | 31 -----------------
> >>>  3 files changed, 41 insertions(+), 32 deletions(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
> >>> index 0088442efca1..79aaf21af8e9 100644
> >>> --- a/Documentation/devicetree/bindings/mfd/mt6397.txt
> >>> +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
> >>> @@ -33,7 +33,7 @@ Optional subnodes:
> >>>  		- compatible: "mediatek,mt6331-rtc"
> >>>  		- compatible: "mediatek,mt6358-rtc"
> >>>  		- compatible: "mediatek,mt6397-rtc"
> >>> -	For details, see ../rtc/rtc-mt6397.txt
> >>> +	For details, see ../rtc/mediatek,mt6397-rtc.yaml
> >>>  - regulators
> >>>  	Required properties:
> >>>  		- compatible: "mediatek,mt6323-regulator"
> >>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> >>> new file mode 100644
> >>> index 000000000000..bb48c0150f95
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
> >>> @@ -0,0 +1,40 @@
> >>> + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml#
> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>> +
> >>> +title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC
> >>> +
> >>> +maintainers:
> >>> +  - Alexandre Mergnat <amergnat@baylibre.com>
> >>> +
> >>> +description: |
> >>> +  MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
> >>> +  as a type of multi-function device (MFD). The RTC can be configured and set up
> >>> +  with PMIC wrapper bus which is a common resource shared with the other
> >>> +  functions found on the same PMIC.
> >>> +
> >>> +properties:
> >>> +  compatible:
> >>> +    enum:
> >>> +      - mediatek,mt6323-rtc
> >>> +      - mediatek,mt6357-rtc
> >>> +      - mediatek,mt6358-rtc
> >>> +      - mediatek,mt6366-rtc
> >>> +      - mediatek,mt6397-rtc
> >>
> >> As this is only a compatible string, just fold this into the MFD schema 
> >> doc.
> > 
> > Actually, it probably also supports the start-year property
> 

I checked and it doesn't support it but this needs to be fixed.

> What about rest of rtc.yaml schema?
> 

wakeup-source would make sense but the driver doesn't support it yet.
Krzysztof Kozlowski Nov. 15, 2022, 7:56 a.m. UTC | #8
On 14/11/2022 23:57, Alexandre Belloni wrote:

>>>> As this is only a compatible string, just fold this into the MFD schema 
>>>> doc.
>>>
>>> Actually, it probably also supports the start-year property
>>
> 
> I checked and it doesn't support it but this needs to be fixed.
> 
>> What about rest of rtc.yaml schema?
>>
> 
> wakeup-source would make sense but the driver doesn't support it yet.

The question is about hardware - does hardware support waking up the
system via interrupt? This is usually a domain of PMICs which still are
powered on when system sleeps.

Best regards,
Krzysztof
Alexandre Belloni Nov. 15, 2022, 8:05 a.m. UTC | #9
On 15/11/2022 08:56:40+0100, Krzysztof Kozlowski wrote:
> On 14/11/2022 23:57, Alexandre Belloni wrote:
> 
> >>>> As this is only a compatible string, just fold this into the MFD schema 
> >>>> doc.
> >>>
> >>> Actually, it probably also supports the start-year property
> >>
> > 
> > I checked and it doesn't support it but this needs to be fixed.
> > 
> >> What about rest of rtc.yaml schema?
> >>
> > 
> > wakeup-source would make sense but the driver doesn't support it yet.
> 
> The question is about hardware - does hardware support waking up the
> system via interrupt? This is usually a domain of PMICs which still are
> powered on when system sleeps.
> 

I'd say that it is possible that a PMIC is able to wake up the system
with or without having an interrupt wired to the SoC so wakeup-source
makes sense. We don't need it if it is interrupt only.
Krzysztof Kozlowski Nov. 15, 2022, 8:17 a.m. UTC | #10
On 15/11/2022 09:05, Alexandre Belloni wrote:
>>> I checked and it doesn't support it but this needs to be fixed.
>>>
>>>> What about rest of rtc.yaml schema?
>>>>
>>>
>>> wakeup-source would make sense but the driver doesn't support it yet.
>>
>> The question is about hardware - does hardware support waking up the
>> system via interrupt? This is usually a domain of PMICs which still are
>> powered on when system sleeps.
>>
> 
> I'd say that it is possible that a PMIC is able to wake up the system
> with or without having an interrupt wired to the SoC so wakeup-source
> makes sense. We don't need it if it is interrupt only.

Then I propose to reference the rtc.yaml.

Best regards,
Krzysztof
Alexandre Mergnat Nov. 15, 2022, 10:34 a.m. UTC | #11
Hi, thanks for your help

>>>> I checked and it doesn't support it but this needs to be fixed.  >>>> >>>>> What about rest of rtc.yaml schema? >>>>> >>>> >>>> 
wakeup-source would make sense but the driver doesn't support it yet. 
 >>> >>> The question is about hardware - does hardware support waking 
up the >>> system via interrupt? This is usually a domain of PMICs which 
still are >>> powered on when system sleeps. >>> >> >> I'd say that it 
is possible that a PMIC is able to wake up the system >> with or without 
having an interrupt wired to the SoC so wakeup-source >> makes sense. We 
don't need it if it is interrupt only. >
>Then I propose to reference the rtc.yaml.

I think I understand my error.
Actually, the RTC (HW) support the "start-year" feature, then I suggest
to fix the binding like that:

allOf:
   - $ref: "rtc.yaml#"

properties:
   compatible:
     enum:
       - mediatek,mt6323-rtc
       - mediatek,mt6357-rtc
       - mediatek,mt6358-rtc
       - mediatek,mt6366-rtc
       - mediatek,mt6397-rtc

   start-year: true

additionalProperties: false

required:
   - compatible

examples:
   - |
     pmic {
         rtc {
             compatible = "mediatek,mt6397-rtc";
         };
     };
Krzysztof Kozlowski Nov. 15, 2022, 1:49 p.m. UTC | #12
On 15/11/2022 11:34, Alexandre Mergnat wrote:
> I think I understand my error.
> Actually, the RTC (HW) support the "start-year" feature, then I suggest
> to fix the binding like that:
> 
> allOf:
>    - $ref: "rtc.yaml#"

No quotes.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt
index 0088442efca1..79aaf21af8e9 100644
--- a/Documentation/devicetree/bindings/mfd/mt6397.txt
+++ b/Documentation/devicetree/bindings/mfd/mt6397.txt
@@ -33,7 +33,7 @@  Optional subnodes:
 		- compatible: "mediatek,mt6331-rtc"
 		- compatible: "mediatek,mt6358-rtc"
 		- compatible: "mediatek,mt6397-rtc"
-	For details, see ../rtc/rtc-mt6397.txt
+	For details, see ../rtc/mediatek,mt6397-rtc.yaml
 - regulators
 	Required properties:
 		- compatible: "mediatek,mt6323-regulator"
diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
new file mode 100644
index 000000000000..bb48c0150f95
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/mediatek,mt6397-rtc.yaml
@@ -0,0 +1,40 @@ 
+ # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/mediatek,mt6397-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6397/MT6366/MT6358/MT6357/MT6323 RTC
+
+maintainers:
+  - Alexandre Mergnat <amergnat@baylibre.com>
+
+description: |
+  MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
+  as a type of multi-function device (MFD). The RTC can be configured and set up
+  with PMIC wrapper bus which is a common resource shared with the other
+  functions found on the same PMIC.
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt6323-rtc
+      - mediatek,mt6357-rtc
+      - mediatek,mt6358-rtc
+      - mediatek,mt6366-rtc
+      - mediatek,mt6397-rtc
+
+additionalProperties: false
+
+required:
+  - compatible
+
+examples:
+  - |
+    pmic {
+        compatible = "mediatek,mt6397";
+
+        rtc {
+               compatible = "mediatek,mt6397-rtc";
+        };
+    };
diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt b/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
deleted file mode 100644
index 7212076a8f1b..000000000000
--- a/Documentation/devicetree/bindings/rtc/rtc-mt6397.txt
+++ /dev/null
@@ -1,31 +0,0 @@ 
-Device-Tree bindings for MediaTek PMIC based RTC
-
-MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works
-as a type of multi-function device (MFD). The RTC can be configured and set up
-with PMIC wrapper bus which is a common resource shared with the other
-functions found on the same PMIC.
-
-For MediaTek PMIC MFD bindings, see:
-../mfd/mt6397.txt
-
-For MediaTek PMIC wrapper bus bindings, see:
-../soc/mediatek/pwrap.txt
-
-Required properties:
-- compatible: Should be one of follows
-       "mediatek,mt6323-rtc": for MT6323 PMIC
-       "mediatek,mt6358-rtc": for MT6358 PMIC
-       "mediatek,mt6366-rtc", "mediatek,mt6358-rtc": for MT6366 PMIC
-       "mediatek,mt6397-rtc": for MT6397 PMIC
-
-Example:
-
-       pmic {
-               compatible = "mediatek,mt6323";
-
-               ...
-
-               rtc {
-                       compatible = "mediatek,mt6323-rtc";
-               };
-       };