[RFC PATCH 09/24] dt-bindings: media: i2c: max96714: make i2c-gate conditional on compatible

Cosmin Tanislav posted 24 patches 6 months ago
There is a newer version of this series
[RFC PATCH 09/24] dt-bindings: media: i2c: max96714: make i2c-gate conditional on compatible
Posted by Cosmin Tanislav 6 months ago
Devices to be added in following patches don't use I2C gate.

Make this property conditional on the compatible strings.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
 .../bindings/media/i2c/maxim,max96714.yaml    | 21 ++++++++++++-------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
index 2f453189338f..d0a2aaf7df9c 100644
--- a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
@@ -84,14 +84,6 @@ properties:
     required:
       - port@1
 
-  i2c-gate:
-    $ref: /schemas/i2c/i2c-gate.yaml
-    unevaluatedProperties: false
-    description:
-      The MAX96714 will pass through and forward the I2C requests from the
-      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
-      subnode to configure a serializer.
-
   port0-poc-supply:
     description: Regulator providing Power over Coax for the GMSL port
 
@@ -101,6 +93,19 @@ required:
   - ports
 
 additionalProperties: false
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - maxim,max96714
+              - maxim,max96714f
+    then:
+      properties:
+        i2c-gate:
+          $ref: /schemas/i2c/i2c-gate.yaml
+          unevaluatedProperties: false
 
 examples:
   - |
-- 
2.48.1
Re: [RFC PATCH 09/24] dt-bindings: media: i2c: max96714: make i2c-gate conditional on compatible
Posted by Rob Herring 6 months ago
On Sat, Mar 08, 2025 at 08:33:38PM +0200, Cosmin Tanislav wrote:
> Devices to be added in following patches don't use I2C gate.
> 
> Make this property conditional on the compatible strings.
> 
> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
> ---
>  .../bindings/media/i2c/maxim,max96714.yaml    | 21 ++++++++++++-------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
> index 2f453189338f..d0a2aaf7df9c 100644
> --- a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
> @@ -84,14 +84,6 @@ properties:
>      required:
>        - port@1
>  
> -  i2c-gate:
> -    $ref: /schemas/i2c/i2c-gate.yaml
> -    unevaluatedProperties: false
> -    description:
> -      The MAX96714 will pass through and forward the I2C requests from the
> -      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
> -      subnode to configure a serializer.
> -
>    port0-poc-supply:
>      description: Regulator providing Power over Coax for the GMSL port
>  
> @@ -101,6 +93,19 @@ required:
>    - ports
>  
>  additionalProperties: false
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - maxim,max96714
> +              - maxim,max96714f
> +    then:
> +      properties:
> +        i2c-gate:

Leave the original definition, invert the 'if', and here you just need:

i2c-gate: false

> +          $ref: /schemas/i2c/i2c-gate.yaml
> +          unevaluatedProperties: false
>  
>  examples:
>    - |
> -- 
> 2.48.1
>
Re: [RFC PATCH 09/24] dt-bindings: media: i2c: max96714: make i2c-gate conditional on compatible
Posted by Cosmin Tanislav 6 months ago

On 3/10/25 2:32 PM, Rob Herring wrote:
> On Sat, Mar 08, 2025 at 08:33:38PM +0200, Cosmin Tanislav wrote:
>> Devices to be added in following patches don't use I2C gate.
>>
>> Make this property conditional on the compatible strings.
>>
>> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
>> ---
>>   .../bindings/media/i2c/maxim,max96714.yaml    | 21 ++++++++++++-------
>>   1 file changed, 13 insertions(+), 8 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
>> index 2f453189338f..d0a2aaf7df9c 100644
>> --- a/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
>> +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96714.yaml
>> @@ -84,14 +84,6 @@ properties:
>>       required:
>>         - port@1
>>   
>> -  i2c-gate:
>> -    $ref: /schemas/i2c/i2c-gate.yaml
>> -    unevaluatedProperties: false
>> -    description:
>> -      The MAX96714 will pass through and forward the I2C requests from the
>> -      incoming I2C bus over the GMSL2 link. Therefore it supports an i2c-gate
>> -      subnode to configure a serializer.
>> -
>>     port0-poc-supply:
>>       description: Regulator providing Power over Coax for the GMSL port
>>   
>> @@ -101,6 +93,19 @@ required:
>>     - ports
>>   
>>   additionalProperties: false
>> +allOf:
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - maxim,max96714
>> +              - maxim,max96714f
>> +    then:
>> +      properties:
>> +        i2c-gate:
> 
> Leave the original definition, invert the 'if', and here you just need:
> 
> i2c-gate: false
> 

Hi Rob.

Thanks for your comments.

After noticing that my dt-schema validation scripts are failing (because
of the jsonschema version incompatibility), I fixed them and then fixed
all the issues and sent a V2 where I introduce a separate file for these
bindings since they all have a different number of ports compared to the
max96714 one.

So the V1 of these patches have been superseded.

>> +          $ref: /schemas/i2c/i2c-gate.yaml
>> +          unevaluatedProperties: false
>>   
>>   examples:
>>     - |
>> -- 
>> 2.48.1
>>
Re: [RFC PATCH 09/24] dt-bindings: media: i2c: max96714: make i2c-gate conditional on compatible
Posted by Rob Herring (Arm) 6 months ago
On Sat, 08 Mar 2025 20:33:38 +0200, Cosmin Tanislav wrote:
> Devices to be added in following patches don't use I2C gate.
> 
> Make this property conditional on the compatible strings.
> 
> Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
> ---
>  .../bindings/media/i2c/maxim,max96714.yaml    | 21 ++++++++++++-------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/maxim,max96714.example.dtb: deserializer@28: 'i2c-gate' does not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/media/i2c/maxim,max96714.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250308183410.3013996-10-demonsingur@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.