Re: [PATCH v2 1/4] dt-bindings: media: i2c: Add OX05B1S sensor
From: Krzysztof Kozlowski
Date: Wed Nov 27 2024 - 03:25:58 EST
On Tue, Nov 26, 2024 at 05:50:57PM +0200, Mirela Rabulea wrote:
> Add bindings for Omnivision OX05B1S sensor.
> Also add compatible for Omnivision OS08A20 sensor.
>
> Signed-off-by: Mirela Rabulea <mirela.rabulea@xxxxxxx>
> ---
>
> Changes in v2:
> Small updates on description
> Update subject, drop "bindings" and "driver"
> Just one binding patch (squash os08a20 bindings)
> Re-flow to 80 columns.
> Drop clock name (not needed in case of single clock)
> Make the clock required property, strictly from sensor module point of view, it is mandatory (will use a fixed clock for nxp board)
> Add regulators: avdd, dvdd, dovdd
> Add $ref: /schemas/media/video-interface-devices.yaml
> Drop assigned-clock* properties (defined in clocks.yaml)
> Keep "additionalProperties : false" and orientation/rotation (unevaluatedProperties: false was suggested, but only orientation/rotation are needed from video-interface-devices.yaml)
I don't understand why you did not follow that advice. Reasoning is not
really correct - if this is video interface device, then we expect
entire schema to be somehow applicable. You will now get the same review
comment.
> +allOf:
> + - $ref: /schemas/media/video-interface-devices.yaml#
> +
> +properties:
> + compatible:
> + items:
You can drop items here, for simpler code.
> + - enum:
> + - ovti,ox05b1s
> + - ovti,os08a20
Keep alphabetical order.
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + description: Input clock (24 MHz)
> + maxItems: 1
> +
> + reset-gpios:
> + description: Reference to the GPIO connected to XSHUTDOWN pin. Active low.
"Active low XSHUTDOWN pin". No need to repeat that GPIO phandle is a
reference to the GPIO.
> + maxItems: 1
> +
> + avdd-supply:
> + description: Power for analog circuit (2.8V)
> +
> + dovdd-supply:
> + description: Power for I/O circuit (1.8V)
> +
> + dvdd-supply:
> + description: Power for digital circuit (1.2V)
> +
> + orientation: true
> +
> + rotation: true
Drop these two and use unevaluatedProperties: false at the end.
> +
> + port:
> + $ref: /schemas/graph.yaml#/$defs/port-base
> + additionalProperties: false
> + description: MIPI CSI-2 transmitter port
> +
> + properties:
> + endpoint:
> + $ref: /schemas/media/video-interfaces.yaml#
> + unevaluatedProperties: false
> +
> + properties:
> + data-lanes:
> + anyOf:
> + - items:
> + - const: 1
> + - const: 2
> + - items:
> + - const: 1
> + - const: 2
> + - const: 3
> + - const: 4
> + required:
> + - data-lanes
> +
> + required:
> + - endpoint
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - port
Supplies should be required. Devices rarely work without power.
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ox05b1s@36 {
Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
Best regards,
Krzysztof