[2/2] dt-bindings: rtc: nxp,pcf8563: add quartz-load-femtofarads for pcf85263 and pcf85363

Message ID 20230213095018.2255225-3-javier.carrasco@wolfvision.net
State New
Headers
Series pcf85363: support for quartz-load-femtofarads |

Commit Message

Javier Carrasco Feb. 13, 2023, 9:50 a.m. UTC
  These RTCs are handled by the pcf85363 device driver, which now supports
the quartz-load-femtofarads property.

Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
 .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 20 ++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
  

Comments

Krzysztof Kozlowski Feb. 13, 2023, 12:25 p.m. UTC | #1
On 13/02/2023 10:50, Javier Carrasco wrote:
> These RTCs are handled by the pcf85363 device driver, which now supports
> the quartz-load-femtofarads property.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
> ---
>  .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 20 ++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> index a98b72752349..aac7f7565ba7 100644
> --- a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> @@ -9,9 +9,6 @@ title: Philips PCF8563/Epson RTC8564 Real Time Clock
>  maintainers:
>    - Alexandre Belloni <alexandre.belloni@bootlin.com>
>  
> -allOf:
> -  - $ref: rtc.yaml#
> -
>  properties:
>    compatible:
>      enum:
> @@ -37,6 +34,23 @@ properties:
>    start-year: true
>    wakeup-source: true
>  
> +allOf:
> +  - $ref: rtc.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - nxp,pcf85263
> +              - nxp,pcf85363
> +    then:
> +      properties:
> +        quartz-load-femtofarads:
> +          description:
> +            The capacitive load of the quartz(x-tal).
> +          enum: [6000, 7000, 12500]
> +          default: 7000

I don't think this will work. If you tested your DTS, you would see errors.

Please define the property in top-level and disallow it for other
variants. Other way to make it working would be to switch to
unevaluatedProperties, but defining properties in allOf:if:then: is not
that readable.

Best regards,
Krzysztof
  
Alexandre Belloni Feb. 13, 2023, 5:09 p.m. UTC | #2
Hello,

Krzysztof's confusion is because you are changing the binding for
nxp,pcf8563 while adding support for the nxp,pcf85263/nxp,pcf85363

On 13/02/2023 10:50:18+0100, Javier Carrasco wrote:
> These RTCs are handled by the pcf85363 device driver, which now supports
> the quartz-load-femtofarads property.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
> ---
>  .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 20 ++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> index a98b72752349..aac7f7565ba7 100644
> --- a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
> @@ -9,9 +9,6 @@ title: Philips PCF8563/Epson RTC8564 Real Time Clock
>  maintainers:
>    - Alexandre Belloni <alexandre.belloni@bootlin.com>
>  
> -allOf:
> -  - $ref: rtc.yaml#
> -
>  properties:
>    compatible:
>      enum:
> @@ -37,6 +34,23 @@ properties:
>    start-year: true
>    wakeup-source: true
>  
> +allOf:
> +  - $ref: rtc.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - nxp,pcf85263
> +              - nxp,pcf85363
> +    then:
> +      properties:
> +        quartz-load-femtofarads:
> +          description:
> +            The capacitive load of the quartz(x-tal).
> +          enum: [6000, 7000, 12500]
> +          default: 7000
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.37.2
> 
> 
> Javier Carrasco 
> Research and Development
> 
> Wolfvision GmbH 
> Oberes Ried 14 | 6833 Klaus | Austria 
> Tel: +43 5523 52250 <tel:+43552352250> | Mail: javier.carrasco@wolfvision.net <mailto:javier.carrasco@wolfvision.net>
> 
> Website: wolfvision.com <www.wolfvision.com> 
> Firmenbuch / Commercial Register: FN283521v Feldkirch/Austria
>
  
Javier Carrasco Feb. 14, 2023, 11:41 a.m. UTC | #3
Hello,

Sorry for the previous mail in html format with annoying signatures.

> Hello,
> 
> Krzysztof's confusion is because you are changing the binding for
> nxp,pcf8563 while adding support for the nxp,pcf85263/nxp,pcf85363

If that is ok I would propose a new bindings file nxp,pcf85363 for 
pcf85263 and pcf85363 in the next version.

Best regards,

Javier Carrasco

> 
> On 13/02/2023 10:50:18+0100, Javier Carrasco wrote:
>> These RTCs are handled by the pcf85363 device driver, which now supports
>> the quartz-load-femtofarads property.
>>
>> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
>> ---
>>   .../devicetree/bindings/rtc/nxp,pcf8563.yaml  | 20 ++++++++++++++++---
>>   1 file changed, 17 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
>> index a98b72752349..aac7f7565ba7 100644
>> --- a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
>> +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
>> @@ -9,9 +9,6 @@ title: Philips PCF8563/Epson RTC8564 Real Time Clock
>>   maintainers:
>>     - Alexandre Belloni <alexandre.belloni@bootlin.com>
>>   
>> -allOf:
>> -  - $ref: rtc.yaml#
>> -
>>   properties:
>>     compatible:
>>       enum:
>> @@ -37,6 +34,23 @@ properties:
>>     start-year: true
>>     wakeup-source: true
>>   
>> +allOf:
>> +  - $ref: rtc.yaml#
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - nxp,pcf85263
>> +              - nxp,pcf85363
>> +    then:
>> +      properties:
>> +        quartz-load-femtofarads:
>> +          description:
>> +            The capacitive load of the quartz(x-tal).
>> +          enum: [6000, 7000, 12500]
>> +          default: 7000
>> +
>>   required:
>>     - compatible
>>     - reg
>> -- 
>> 2.37.2
>>
>>
>> Javier Carrasco
>> Research and Development
>>
>> Wolfvision GmbH
>> Oberes Ried 14 | 6833 Klaus | Austria
>> Tel: +43 5523 52250 <tel:+43552352250> | Mail: javier.carrasco@wolfvision.net <mailto:javier.carrasco@wolfvision.net>
>>
>> Website: wolfvision.com <www.wolfvision.com>
>> Firmenbuch / Commercial Register: FN283521v Feldkirch/Austria
>>
>
  
Krzysztof Kozlowski Feb. 14, 2023, 12:11 p.m. UTC | #4
On 14/02/2023 12:41, Javier Carrasco Cruz wrote:
> Hello,
> 
> Sorry for the previous mail in html format with annoying signatures.
> 
>> Hello,
>>
>> Krzysztof's confusion is because you are changing the binding for
>> nxp,pcf8563 while adding support for the nxp,pcf85263/nxp,pcf85363
> 
> If that is ok I would propose a new bindings file nxp,pcf85363 for 
> pcf85263 and pcf85363 in the next version.

Could be or still could be fixed in this binding. Indeed my comment in
the driver came from confusion that there are two drivers but one
binding. Having two bindings might be simpler and more readable in such
case.

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
index a98b72752349..aac7f7565ba7 100644
--- a/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
+++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8563.yaml
@@ -9,9 +9,6 @@  title: Philips PCF8563/Epson RTC8564 Real Time Clock
 maintainers:
   - Alexandre Belloni <alexandre.belloni@bootlin.com>
 
-allOf:
-  - $ref: rtc.yaml#
-
 properties:
   compatible:
     enum:
@@ -37,6 +34,23 @@  properties:
   start-year: true
   wakeup-source: true
 
+allOf:
+  - $ref: rtc.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - nxp,pcf85263
+              - nxp,pcf85363
+    then:
+      properties:
+        quartz-load-femtofarads:
+          description:
+            The capacitive load of the quartz(x-tal).
+          enum: [6000, 7000, 12500]
+          default: 7000
+
 required:
   - compatible
   - reg