public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mirela Rabulea <mirela.rabulea@nxp.com>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	mchehab@kernel.org, sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl, laurentiu.palcu@nxp.com,
	robert.chiras@nxp.com, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, LnxRevLi@nxp.com,
	kieran.bingham@ideasonboard.com, hdegoede@redhat.com,
	dave.stevenson@raspberrypi.com, mike.rudenko@gmail.com,
	alain.volmat@foss.st.com, julien.vuillaumier@nxp.com,
	alice.yuan@nxp.com
Subject: Re: [EXT] Re: [PATCH 1/5] dt-bindings: media: i2c: Add bindings for OX05B1S sensor driver
Date: Mon, 4 Nov 2024 16:25:43 +0200	[thread overview]
Message-ID: <20241104142543.GA27775@pendragon.ideasonboard.com> (raw)
In-Reply-To: <7cee3358-bf8c-4ae5-a688-12ff18d4b7e0@nxp.com>

Hello Mirela,

On Wed, Oct 30, 2024 at 08:02:44AM +0200, Mirela Rabulea wrote:
> On 29.10.2024 13:57, Laurent Pinchart wrote:
> >>> +
> >>> +  orientation: true
> >>> +  rotation: true
> >>
> >> I think you can drop both of these too.
> >
> > Aren't they needed given that the binding ends with
> >
> > additionalProperties: false
> >
> > ?
>
> I added orientation & rotation properties in order to support 
> orientation and rotation controls, libcamera warns about those (optional 
> requirements last time I checked).

The orientation and rotation properties should certainly be specified in
DT sources. They are standardized in video-interface-devices.yaml which
Bryan pointed out you should reference. If you're not familiar yet with
with how the YAML schemas used for DT bindings reference core schemas,
now would be a good time to have a look at it :-)

In a nutshell, you'll find that all properties need to be properly
defined with appropriate constraints, and properties shared by multiple
devices have constraints defined in core schemas. Some are included
automatically and are applied based on property names, other need a
manual $ref. You can have a look at
https://github.com/devicetree-org/dt-schema.git to see core schemas that
get automatically selected, they specify "select: true". For example the
schemas defining the reg or clocks properties don't have to be manually
referenced.

Bryan's comment about dropping the orientation and rotation properties
was related to the fact that the video-interface-devices.yaml schema
defines them already. With "unevaluatedProperties: false", you won't
need to specify "orientation: true". With "additionalProperties: false",
you will. It's a good idea to learn about the difference between those
two and how they really work.

> >>> +
> >>> +required:
> >>> +  - compatible
> >>> +  - reg
> >
> > The device requires a clock, shouldn't the clocks property be required ?
> 
> I intentionally left the clock optional, because NXP has a converter 
> board which supports both ox05b1s and os08a20 sensor, and the converter 
> board has an oscillator, and we are using that, not the SOC clock.

That's fine, you can have a fixed clock node in DT to model that. DT
bindings describe the intrinsic needs of a particular device. If the
sensor requires a clock, I think it should be mandatory. If the sensor
itself could operate without an external clock (i.e. if it had an
internal oscillator) then the property could be optional.

> Here is how the module looks like for os08a20 for imx8mp:
> 
> https://docs.nxp.com/bundle/AN13712/page/topics/os08a20_sensor_module.html
> 
> There's a newer revision for the converter board for imx95, sorry but I 
> do not have a link for that.
> 
> For imx8mp, we used in the past the clock from the SOC, then switched to 
> the external clock (from the converter board).
> 
> I think Omnivision has their own module.
> 
> So, I thought leaving the clock as optional allows for more flexibility.
> 
> >>> +  - port
> >>> +
> >>> +additionalProperties: false
> >>> +
> >>> +examples:
> >>> +  - |
> >>> +    #include <dt-bindings/gpio/gpio.h>
> >>> +
> >>> +    i2c {
> >>> +        #address-cells = <1>;
> >>> +        #size-cells = <0>;
> >>> +
> >>> +        ox05b1s: ox05b1s@36 {
> >>> +            compatible = "ovti,ox05b1s";
> >>> +            reg = <0x36>;
> >>> +            reset-gpios = <&i2c3_gpio_expander_20 2 GPIO_ACTIVE_LOW>;
> >
> > This isn't specified in the bindings. Does the example validate ?
> 
> Apparently yes, I mean dt_binding_check passed:
> 
> $ rm Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.example.dtb
> 
> $ make dt_binding_check DT_CHECKER_FLAGS=-m 
> DT_SCHEMA_FILES=ovti,ox05b1s.yaml
>    DTC [C] 
> Documentation/devicetree/bindings/media/i2c/ovti,ox05b1s.example.dtb
> 
> I have dtschema-2024.10.dev6+g12c3cd5.
> 
> 
> The "reset-gpios" is described in this binding, as the GPIO connected to 
> the XSHUTDOWN pin.

Ah sorry, Bryan dropped that part from his reply, so I didn't notice it.

> The <&i2c3_gpio_expander_20 2 GPIO_ACTIVE_LOW> is what works for imx95 
> ("nxp,pcal6408"), for imx8mp this works:
> 
> reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-11-04 14:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 19:06 [PATCH 0/5] media: i2c: Add OX05B1S camera sensor driver Mirela Rabulea
2024-10-28 19:06 ` [PATCH 1/5] dt-bindings: media: i2c: Add bindings for OX05B1S " Mirela Rabulea
2024-10-29  6:14   ` Krzysztof Kozlowski
2024-10-29 12:10     ` Laurent Pinchart
2024-10-29 12:15       ` Krzysztof Kozlowski
2024-10-29 12:21         ` Laurent Pinchart
2024-10-29 12:28           ` Krzysztof Kozlowski
2024-10-29 12:46             ` Laurent Pinchart
2024-10-29 12:47               ` Krzysztof Kozlowski
2024-10-29 13:36     ` [EXT] " Mirela Rabulea
2024-10-29 13:49       ` Krzysztof Kozlowski
2024-10-29 11:44   ` Bryan O'Donoghue
2024-10-29 11:57     ` Laurent Pinchart
2024-10-29 12:00       ` Bryan O'Donoghue
2024-10-30  6:08         ` [EXT] " Mirela Rabulea
2024-10-30  6:02       ` Mirela Rabulea
2024-11-04 14:25         ` Laurent Pinchart [this message]
2024-11-26 16:10           ` Mirela Rabulea
2024-10-28 19:06 ` [PATCH 2/5] media: ox05b1s: Add omnivision OX05B1S raw " Mirela Rabulea
2024-10-29  6:17   ` Krzysztof Kozlowski
2024-10-28 19:06 ` [PATCH 3/5] MAINTAINERS: Add entry for OX05B1S " Mirela Rabulea
2024-10-28 19:06 ` [PATCH 4/5] dt-bindings: media: i2c: Update bindings for OX05B1S with OS08A20 Mirela Rabulea
2024-10-29  6:17   ` Krzysztof Kozlowski
2024-10-29 14:02     ` [EXT] " Mirela Rabulea
2024-10-29 16:46       ` Krzysztof Kozlowski
2024-10-28 19:06 ` [PATCH 5/5] media: ox05b1s: Add support for Omnivision OS08A20 raw sensor Mirela Rabulea
2024-11-01 12:08   ` Sakari Ailus
2024-11-04 13:21     ` [EXT] " Mirela Rabulea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241104142543.GA27775@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=LnxRevLi@nxp.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alice.yuan@nxp.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=julien.vuillaumier@nxp.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurentiu.palcu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mike.rudenko@gmail.com \
    --cc=mirela.rabulea@nxp.com \
    --cc=robert.chiras@nxp.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox