[RFC PATCH v2 08/16] dt-bindings: media: i2c: max96712: use pattern properties for ports
Rob Herring
robh at kernel.org
Tue Mar 11 12:00:43 PDT 2025
On Sun, Mar 09, 2025 at 10:48:00AM +0200, Cosmin Tanislav wrote:
> The MAX96712 and MAX96724 support up to 4 separate PHYs, depending on
> the selected PHY configuration. Use patternProperties to document this.
>
> The input ports are all the same, use patternProperties for them.
>
> Signed-off-by: Cosmin Tanislav <demonsingur at gmail.com>
> ---
> .../bindings/media/i2c/maxim,max96712.yaml | 29 +++++++------------
> 1 file changed, 10 insertions(+), 19 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml
> index efdece2b33b9..bf8c861c836b 100644
> --- a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml
> @@ -40,27 +40,15 @@ properties:
> ports:
> $ref: /schemas/graph.yaml#/properties/ports
>
> - properties:
> - port at 0:
> + patternProperties:
> + '^port@[0-3]$':
> $ref: /schemas/graph.yaml#/properties/port
> - description: GMSL Input 0
> + description: GMSL Input port
GMSL Inputs 0-3
Though generally every port needs to be documented. So really, this was
correct before.
>
> - port at 1:
> - $ref: /schemas/graph.yaml#/properties/port
> - description: GMSL Input 1
> -
> - port at 2:
> - $ref: /schemas/graph.yaml#/properties/port
> - description: GMSL Input 2
> -
> - port at 3:
> - $ref: /schemas/graph.yaml#/properties/port
> - description: GMSL Input 3
> -
> - port at 4:
> + '^port@[4-7]$':
> $ref: /schemas/graph.yaml#/$defs/port-base
> unevaluatedProperties: false
> - description: CSI-2 Output
> + description: CSI-2 Output port
The input port numbers are 1:1 with Input numbering. I imagine that's
not the case here, so the relationship of port #s to outputs needs to be
documented.
>
> properties:
> endpoint:
> @@ -78,8 +66,11 @@ properties:
> - data-lanes
> - bus-type
>
> - required:
> - - port at 4
> + anyOf:
> + - required: [port at 4]
> + - required: [port at 5]
> + - required: [port at 6]
> + - required: [port at 7]
>
> required:
> - compatible
> --
> 2.48.1
>
More information about the linux-arm-kernel
mailing list