Linux Media Controller development
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Sean Young" <sean@mess.org>,
	"Ricardo Ribalda" <ribalda@chromium.org>,
	"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
	"Jacopo Mondi" <jacopo.mondi@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
	"Alain Volmat" <alain.volmat@foss.st.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Michael Tretter" <m.tretter@pengutronix.de>,
	"Tomasz Figa" <tfiga@chromium.org>,
	"Hu,               Jerry W" <jerry.w.hu@intel.com>,
	"Steve Cho" <stevecho@chromium.org>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Paul Kocialkowski" <paulk@sys-base.io>,
	"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Arthur Vinchon" <arthur.vinchon@allegrodvt.com>,
	"Marco Felsch" <m.felsch@pengutronix.de>
Subject: Re: [PATCH 1/1] media: dt-bindings: Add bindings for camera modules
Date: Fri, 09 May 2025 21:44:15 +0100	[thread overview]
Message-ID: <174682345593.819131.7462679299915630940@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20250507081338.53614-1-sakari.ailus@linux.intel.com>

Hi Sakari,

Quoting Sakari Ailus (2025-05-07 09:13:38)
> Add bindings for camera modules to allow telling especially the user space
> which module is found in the system. Camera modules do not have a device
> node so this is a property for the camera sensor device node. This allows
> describing modules that contain a single camera sensor.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Hi all,
> 
> Here's the patch to give some advance warning for the camera module
> discussion. The good thing is that it's quite short.
> 

Thanks for starting this! Definitely something I would like to see a
solution for indeed.

> The intent indeed is to address the regular use case where we have a
> single sensor in a camera module. For cases where we have more, we'll need
> something else, not based on individual properties. I believe this is
> still the way to go, to address current issues and for a couple of
> additional reasons:
> 
> - Cameras with more than one sensor tend to be collections of camera
>   modules so this is still relevant in most cases.
> 
> - It's much simpler to have a single property than begin having new nodes
>   in DT. In practice such nodes would be a poor fit for DT generally as
>   they have (few or) no functions.
> 
> The biggest difficulty is still in module identification. These components
> tend to be often ignored and the best we have for a module name in that
> case is random-looking string if even that. Besides DT bindings, we need
> an additional (git?) tree to describe the modules that have no proper
> names but it could be also useful for those that do, for instance to
> include information on lens, field of view, IR filter, photos of the
> module etc. There is some overlap with what libcamera needs, too.
> 

One aspect that jumps to my mind here - is how do we handle variations
of modules?

For instance I have two IMX335 modules from Arducam - which are
otherwise identical except for different lenses with different
field-of-view.

Do we need more properties (later?) to express the different
configuration options of the module?


At some point I would love to be able to describe a 'module' as the
whole component including a VCM for instance - in a way that can be
abstracted as something that could be connected to a 'port' (see [0],
[1]) where it would be helpful to be able to group/abstract a movable
component and identify the full camera module in a way that doesn't have
to be duplicated in every platform configuration that it could be
connected.

[0] https://www.konsulko.com/wp-content/uploads/2016/09/portable-device-tree-connector.pdf
[1] https://lore.kernel.org/all/1464986273-12039-2-git-send-email-pantelis.antoniou@konsulko.com/

--
Kieran


> - Sakari
> 
>  .../bindings/media/camera-module.yaml         | 52 +++++++++++++++++++
>  .../media/video-interface-devices.yaml        |  3 ++
>  2 files changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/camera-module.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/camera-module.yaml b/Documentation/devicetree/bindings/media/camera-module.yaml
> new file mode 100644
> index 000000000000..31b898c8c334
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/camera-module.yaml
> @@ -0,0 +1,52 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) 2025 Intel Corporation
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/camera-module.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Camera modules
> +
> +maintainers:
> +  - Sakari Ailus <sakari.ailus@linux.intel.com>
> +
> +description: |
> +  Camera modules are devices that embed one or more active devices, including
> +  Camera Sensors, Voice Coil Motor (VCM) and possibly a flash LED as well as
> +  other passive devices such as lenses and Ultra-Violet (UV) filters. While the
> +  camera modules themselves have no OF nodes and have generally no module
> +  specific functions, it still does matter for the software stack as a whole
> +  which module the devices are a part of.
> +
> +  Two properties are used for this, depending on what is known of the module:
> +
> +  1. The model of the module is known. In this case the name of the module uses
> +  the format "vendor,model[,version]" where "vendor" is the manufacturer of the
> +  module and "model" the name of the model. The version part is optional. In
> +  such cases the property "camera-module-canonical" will be used. If the vendor
> +  is not known, the "gpio" vendor prefix is used.
> +
> +  2. The model of the module is unknown. In this case, the module has an
> +  identifier only, and will be described in detail in the camera module
> +  database. The property "camera-module-casual" is used to denote such modules.
> +
> +  Before including in this binding documentation, all modules shall also be
> +  documented in add-URL-here.
> +
> +  All camera modules listed below shall have the name of the sensor as well as
> +  other devices included in the module as DT compatible string mentioned in a
> +  comment after the enumeration, separated by a whitespace (" ").
> +
> +  Always keep the enumeration alphabetically (1) or numerically (2) sorted.
> +
> +properties:
> +  camera-module-canonical:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    enum:
> +      - "dell,0BF122N3" # onnn,ov01a10
> +  camera-module-casual:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum:
> +      - 1 # st,vs6555
> +
> +additionalProperties: true
> diff --git a/Documentation/devicetree/bindings/media/video-interface-devices.yaml b/Documentation/devicetree/bindings/media/video-interface-devices.yaml
> index cf7712ad297c..27fa6711367e 100644
> --- a/Documentation/devicetree/bindings/media/video-interface-devices.yaml
> +++ b/Documentation/devicetree/bindings/media/video-interface-devices.yaml
> @@ -10,6 +10,9 @@ maintainers:
>    - Jacopo Mondi <jacopo@jmondi.org>
>    - Sakari Ailus <sakari.ailus@linux.intel.com>
>  
> +allOf:
> +  - $ref: /schemas/media/camera-module.yaml#
> +
>  properties:
>    flash-leds:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
> -- 
> 2.39.5
>

  parent reply	other threads:[~2025-05-09 20:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  8:13 [PATCH 1/1] media: dt-bindings: Add bindings for camera modules Sakari Ailus
2025-05-08  5:51 ` Krzysztof Kozlowski
2025-05-09  8:55   ` Sakari Ailus
2025-05-08 17:00 ` Jacopo Mondi
2025-05-09 20:12   ` Sakari Ailus
2025-05-09 20:24     ` Jacopo Mondi
2025-05-09 20:35       ` Sakari Ailus
2025-05-09 20:44 ` Kieran Bingham [this message]
2025-05-19 11:56   ` Sakari Ailus
2025-08-27 15:45     ` Kieran Bingham
2025-09-24 16:07 ` Isaac Scott
2025-09-24 16:31 ` Isaac Scott

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=174682345593.819131.7462679299915630940@ping.linuxembedded.co.uk \
    --to=kieran.bingham@ideasonboard.com \
    --cc=alain.volmat@foss.st.com \
    --cc=arthur.vinchon@allegrodvt.com \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=jerry.w.hu@intel.com \
    --cc=khilman@baylibre.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=m.tretter@pengutronix.de \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=paulk@sys-base.io \
    --cc=ribalda@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sean@mess.org \
    --cc=stevecho@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=tomi.valkeinen@ideasonboard.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