Add Vision Components MIPI Camera Module support
Subsystems (2)
cover Add Vision Components MIPI Camera Module support
This series adds support for Vision Components MIPI camera modules by adding a device driver for the controller chip found on those modules.
The controller is an I2C-accessible FPGA that provides three main functions for the attached image sensor:
- power sequencing and control of the module supply
- a fixed clock output used as the sensor input clock
- routing of I2C traffic between the host and the sensor
The initial version of this driver was written by Laurent Pinchart and is available at: gitlab.com/ideasonboard/nxp/linux.git in the v7.0/sensors/vcmipi branch. Therefore I've added Laurent and me as a maintainer for this driver and left Laurent as MODULE_AUTHOR. If that's incorrect or not desired, please feel free to reach out! Thanks
This series was tested using ov9282 camera modules from Vision Components. Those were flashed with different FPGA firmware versions and connected to an i.MX8MP SoC.
Any feedback is warmly welcome.
Thanks!
---
Richard Leitner (3):
dt-bindings: vendor-prefixes: add Vision Components GmbH
dt-bindings: media: i2c: Add vision-components,mipi-module-controller
media: i2c: vc-mipi: add Vision Components MIPI Module Controller
.../vision-components,mipi-module-controller.yaml | 92 ++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/vc-mipi.c | 541 +++++++++++++++++++++ 6 files changed, 657 insertions(+)
---
base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20260903-vc-mipi-ctrl-6d442cefcc40
Best regards,
Signature · 1 line
Richard Leitner <[email protected]>
PATCH 1/3 dt-bindings: vendor-prefixes: add Vision Components GmbH
Add vendor prefix for Vision Components GmbH, a manufacturer of camera modules. The prefix will be used in the Vision Components MIPI Camera Controller driver.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1845,6 +1845,8 @@ patternProperties: description: Vishay Intertechnology, Inc "^visionox,.*": description: Visionox + "^vision-components,.*": + description: Vision Components GmbH "^vitesse,.*": description: Vitesse Semiconductor Corporation "^vivante,.*":
Signature · 1 line
2.53.0
PATCH 2/3 dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerAdd bindings for the Vision Components MIPI Camera Module Controller.
--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +92 -0
@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below the + controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controller + + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the module + + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>; + + clocks = <&vc_mipi_ctrl>; + clock-names = "inck"; + + avdd-supply = <&vc_mipi_ctrl>; + dvdd-supply = <&vc_mipi_ctrl>; + dovdd-supply = <&vc_mipi_ctrl>; + }; + }; + }; + }; +... +
MAINTAINERS +7 -0
@@ -29106,6 +29106,13 @@ S: Maintained F: Documentation/devicetree/bindings/iio/light/vishay,veml6075.yaml F: drivers/iio/light/veml6075.c +VISION COMPONENTS MIPI MODULE CONTROLLER DRIVER +M: Laurent Pinchart <[email protected]> +M: Richard Leitner <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml + VISL VIRTUAL STATELESS DECODER DRIVER M: Daniel Almeida <[email protected]> L: [email protected]
Signature · 1 line
2.53.0
PATCH 3/3 media: i2c: vc-mipi: add Vision Components MIPI Module Controller
In reply to Richard LeitnerAdd support for the Vision Components MIPI camera module controller. This is basically an FPGA sitting on most of the Vision Components MIPI camera modules. It provides three main functions for the attached image sensor:
- power sequencing and control of the module supply
- a fixed clock output used as the sensor input clock
- tunneling of I2C traffic between the host and the sensor
The driver registers a regulator for the sensor supply, exposes the module clock as a clock provider, and creates a I2C adapter so that the downstream sensor can be accessed as a normal I2C device. This is modeled after the hardware design, where the FPGA is connected to two separate I2C busses. One towards the host, one towards the sensor.
There are known firmware quirks affecting I2C ROM reading with auto-increment, as well as multi-byte reads from the sensor. Both are handled in this driver.
The initial version of this driver was written by Laurent Pinchart <[email protected]>.
--- MAINTAINERS | 1 + drivers/media/i2c/Kconfig | 13 ++ drivers/media/i2c/Makefile | 1 + drivers/media/i2c/vc-mipi.c | 541 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 556 insertions(+)
MAINTAINERS +1 -0
@@ -29112,6 +29112,7 @@ M: Richard Leitner <[email protected]> L: [email protected] S: Maintained F: Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml +F: drivers/media/i2c/vc-mipi.c VISL VIRTUAL STATELESS DECODER DRIVER M: Daniel Almeida <[email protected]>
drivers/media/i2c/Kconfig +13 -0
@@ -868,6 +868,19 @@ config VIDEO_VGXY61 This is a Video4Linux2 sensor driver for the ST VGXY61 camera sensor. +config VIDEO_VC_MIPI + tristate "Vision Components MIPI Module support" + depends on I2C + help + This is a driver for the camera module controller found in the Vision + Components MIPI modules. + + The controller manages the power supply, reset signal and I2C + communication to the actual camera sensor. + + To compile this driver as a module, choose M here: the + module will be called vc-mipi. + source "drivers/media/i2c/ccs/Kconfig" source "drivers/media/i2c/et8ek8/Kconfig"
drivers/media/i2c/Makefile +1 -0
@@ -166,6 +166,7 @@ obj-$(CONFIG_VIDEO_TW9910) += tw9910.o obj-$(CONFIG_VIDEO_UDA1342) += uda1342.o obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o +obj-$(CONFIG_VIDEO_VC_MIPI) += vc-mipi.o obj-$(CONFIG_VIDEO_VD55G1) += vd55g1.o obj-$(CONFIG_VIDEO_VD56G3) += vd56g3.o obj-$(CONFIG_VIDEO_VGXY61) += vgxy61.o
drivers/media/i2c/vc-mipi.c new file +541 -0
541 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerThank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] dt-bindings: schema rejects i2c child nodes due to unevaluatedProperties - [Low] dt-bindings…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] dt-bindings: schema rejects i2c child nodes due to unevaluatedProperties
- [Low] dt-bindings: dtc warning unit_address_vs_reg due to missing reg in i2c node --
commit 0c92fd00fde60c6a3a9d90ca2a635a3a6b317fc1
Author: Richard Leitner <[email protected]>
dt-bindings: media: i2c: Add vision-components,mipi-module-controller
This commit adds device tree bindings for the Vision Components MIPI Camera Module Controller. The controller abstracts the camera sensor behind a unified register interface and exposes a tunneled downstream I2C bus for the attached image sensor.
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +0
-0
[ ... ]
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: false
[Severity: Medium]
Will this constraint reject the downstream I2C bus child node?
Because unevaluatedProperties is set to false but there is no definition (such as a patternProperties for ^i2c@[0-9a-f]+$) for the tunneled downstream I2C bus child node in the properties section, make dt_binding_check will fail validation for any device tree containing this hardware module's child node.
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>;
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 75
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+ #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;
[Severity: Low]
Does this child node trigger a dtc unit_address_vs_reg warning?
The parent node controller@10 defines #address-cells = <1>, and this i2c@0 node has a unit address. Without a corresponding reg = <0>; property, it violates Device Tree syntax and will trigger a warning during make dt_binding_check.
Additionally, this example illustrates the usage of the i2c@0 child node, which is paradoxically forbidden by the unevaluatedProperties schema constraint mentioned above.
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
[email protected]
AI reviewRe: [PATCH 1/3] dt-bindings: vendor-prefixes: add Vision Components GmbH
In reply to Richard LeitnerThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] dt-bindings: vendor-prefixes: incorrect alphabetical sorting of vision-components --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] dt-bindings: vendor-prefixes: incorrect alphabetical sorting of vision-components --
commit 1128759ad400d01e3eb91ec0f2b73289ba5e494d
Author: Richard Leitner <[email protected]>
dt-bindings: vendor-prefixes: add Vision Components GmbH
Add vendor prefix for Vision Components GmbH, a manufacturer of camera modules.
Documentation/devicetree/bindings/vendor-prefixes.yaml patternProperties: · line 1849
Quoted 10 lines
Documentation/devicetree/bindings/vendor-prefixes.yaml +2
-0@@ -1845,6 +1845,8 @@ patternProperties: description: Vishay Intertechnology, Inc "^visionox,.*": description: Visionox + "^vision-components,.*": + description: Vision Components GmbH
[Severity: Low]
Does this insertion break the required alphabetical order?
Based on ASCII sorting, "vision-components" (where the hyphen is ASCII 45) should precede "visionox" (where the letter 'o' is ASCII 111).
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewRe: [PATCH 3/3] media: i2c: vc-mipi: add Vision Components MIPI Module Controller
In reply to Richard LeitnerThank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] clk: UAF window in OF clock provider during device removal - [Medium] of: memory leak of…
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] clk: UAF window in OF clock provider during device removal
- [Medium] of: memory leak of device_node due to double-increment and missing cleanup
- [Medium] clk: memory leak of clk_hw on probe error path
- [Low] pm: unconditional assignment of PM callbacks violates dev_pm_ops guidelines --
commit d0204937d4a594ae9bcc6ff943f4549e7368e364
Author: Richard Leitner <[email protected]>
media: i2c: vc-mipi: add Vision Components MIPI Module Controller
This commit adds a driver for the camera module controller found in the Vision Components MIPI modules. It manages power sequencing, provides a fixed clock output, and acts as an I2C tunnel to the camera sensor.
Quoted 6 lines
drivers/media/i2c/vc-mipi.c new file +0
-0@@ -0,0 +1,541 @@
[ ... ]
Quoted 2 lines
drivers/media/i2c/vc-mipi.c new file +2
-0+static int vc_mipi_clk_init (struct vc_mipi_ctrl *ctrl) +{
[ ... ]
drivers/media/i2c/vc-mipi.c line 242
Quoted 7 lines
drivers/media/i2c/vc-mipi.c new file +7
-0+ ctrl->clk_hw =clk_hw_register_fixed_rate (ctrl->dev, name,NULL ,0 , + freq); +if (IS_ERR (ctrl->clk_hw)) +return PTR_ERR (ctrl->clk_hw); + + ret =devm_of_clk_add_hw_provider (ctrl->dev, of_clk_hw_simple_get, + ctrl->clk_hw);
[Severity: High]
Does this create a use-after-free window during device removal?
The clock hardware is registered manually with clk_hw_register_fixed_rate(), while the OF provider is registered here with devm_of_clk_add_hw_provider().
Later in vc_mipi_i2c_remove(), vc_mipi_clk_cleanup() synchronously unregisters and frees ctrl->clk_hw. Because the OF provider is devm-managed, it remains active until devres cleanup, which happens after remove() returns.
Could concurrent OF clock lookups return a dangling pointer to freed memory during this window?
Quoted 7 lines
drivers/media/i2c/vc-mipi.c new file +7
-0+if (ret <0 ) { +clk_hw_unregister_fixed_rate (ctrl->clk_hw); +return ret; + } + +return 0 ; +}
[ ... ]
Quoted 5 lines
drivers/media/i2c/vc-mipi.c new file +5
-0+static struct device_node *vc_mipi_i2c_find_tunnel_bus (struct device *dev) +{ +struct device_node *child; + +for_each_child_of_node (dev->of_node, child) {
drivers/media/i2c/vc-mipi.c line 345
Quoted 10 lines
drivers/media/i2c/vc-mipi.c new file +10
-0+u32 addr_cells, size_cells; + +if (of_property_read_u32 (child,"#address-cells" , &addr_cells)) +continue ; +if (of_property_read_u32 (child,"#size-cells" , &size_cells)) +continue ; +if (addr_cells !=1 || size_cells !=0 ) +continue ; + +return of_node_get (child);
[Severity: Medium]
Does returning of_node_get(child) here cause a memory leak of the device_node?
The for_each_child_of_node macro automatically acquires a reference to the matched child node. Exiting the loop early with of_node_get(child) incorrectly adds a second reference, leaking the iterator's implicit reference.
Quoted 11 lines
drivers/media/i2c/vc-mipi.c new file +11
-0+ } + +return NULL ; +} + +static int vc_mipi_i2c_tunnel_add (struct i2c_client *i2c) +{ +struct vc_mipi_ctrl *ctrl =i2c_get_clientdata (i2c); +struct i2c_adapter *i2c_adapter = &ctrl->i2c_tunnel; +struct device_node *bus_node; +
drivers/media/i2c/vc-mipi.c line 366
Quoted 10 lines
drivers/media/i2c/vc-mipi.c new file +10
-0+ bus_node =vc_mipi_i2c_find_tunnel_bus (ctrl->dev); +if (!bus_node) +return -EINVAL ; + +strscpy (i2c_adapter->name,"vc-mipi-i2c" ,sizeof (i2c_adapter->name)); + i2c_adapter->owner =THIS_MODULE ; + i2c_adapter->algo = &vc_mipi_i2c_tunnel_algorithm; + i2c_adapter->quirks = &vc_mipi_i2c_tunnel_quirks; + i2c_adapter->dev.parent = ctrl->dev; + i2c_adapter->dev.of_node = bus_node;
[Severity: Medium]
Is there a missing of_node_put() for this reference?
The explicitly acquired reference is assigned to i2c_adapter->dev.of_node here, but it appears to never be released via of_node_put() in vc_mipi_i2c_tunnel_del() nor on the i2c_add_adapter() failure path. Will this cause a permanent memory leak?
Quoted 4 lines
drivers/media/i2c/vc-mipi.c new file +4
-0+ +i2c_set_adapdata (i2c_adapter, i2c); +return i2c_add_adapter (&ctrl->i2c_tunnel); +}
[ ... ]
Quoted 2 lines
drivers/media/i2c/vc-mipi.c new file +2
-0+static int vc_mipi_i2c_probe (struct i2c_client *i2c) +{
[ ... ]
Quoted 17 lines
drivers/media/i2c/vc-mipi.c new file +17
-0+ ret =vc_mipi_clk_init (ctrl); +if (ret <0 ) { +dev_err (ctrl->dev,"Failed to register clock\n" ); + goto err_power; + } + +/* Enable runtime PM and turn off the device. */ +pm_runtime_set_active (ctrl->dev); +pm_runtime_get_noresume (ctrl->dev); +pm_runtime_enable (ctrl->dev); +pm_runtime_set_autosuspend_delay (ctrl->dev,1000 ); +pm_runtime_use_autosuspend (ctrl->dev); +pm_runtime_mark_last_busy (ctrl->dev); +pm_runtime_put_autosuspend (ctrl->dev); + +/* As a last step create the proxied downstream I2C adapter */ + ret =vc_mipi_i2c_tunnel_add (i2c);
drivers/media/i2c/vc-mipi.c line 504
Quoted 10 lines
drivers/media/i2c/vc-mipi.c new file +10
-0+if (ret <0 ) { +dev_err (ctrl->dev,"Failed to register i2c tunnel adapter: %d\n" , ret); + goto err_power; + } + +return 0 ; + +err_power: +vc_mipi_power_off (ctrl->dev); +return ret;
[Severity: Medium]
Does this error path leak the clk_hw memory?
If vc_mipi_i2c_tunnel_add() fails during probe, the code jumps to err_power. The error handler only powers off the device but fails to call vc_mipi_clk_cleanup(). This permanently leaks the clk_fixed_rate memory and leaves it registered in the clock subsystem.
Quoted 1 line
+}
[ ... ]
drivers/media/i2c/vc-mipi.c line 531
Quoted 5 lines
drivers/media/i2c/vc-mipi.c new file +5
-0+static struct i2c_driver vc_mipi_driver = { + .driver = { + .name ="vc-mipi" , + .of_match_table = vc_mipi_dt_ids, + .pm = &vc_mipi_pm_ops,
[Severity: Low]
Should this use the pm_ptr() macro?
Subsystem guidelines require using the pm_ptr() wrapper macro for dev_pm_ops assignments. Failing to use pm_ptr() causes the pointer to remain even when CONFIG_PM is disabled, leaving a dead struct reference and generating unnecessary object code.
Quoted 4 lines
drivers/media/i2c/vc-mipi.c new file +4
-0+ }, + .probe = vc_mipi_i2c_probe, + .remove = vc_mipi_i2c_remove, +};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Rob Herring (Arm)
maintainerRe: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerQuoted 8 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.example.dts:32.23-47.19: Warning (unit_address_vs_reg): /example-0/i2c/controller@10/i2c@0: node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.example.dtb: controller@10 (vision-components,mipi-module-controller): Unevaluated properties are not allowed ('i2c@0' was unexpected)
from schema $id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yamlDocumentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.example.dtb: camera@60 (ovti,ov9281): 'clock-names' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/media/i2c/ovti,ov9282.yamlDocumentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.example.dtb: camera@60 (ovti,ov9281): 'port' is a required property
from schema $id: http://devicetree.org/schemas/media/i2c/ovti,ov9282.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/[email protected]
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.
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerQuoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)
This fails tests, so a very brief review / a few comments:
Quoted 23 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +16
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+ sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below the + controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controller
There is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the module
Drop, implied by the compatible
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0
No children allowed, so why these two?
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: false
additionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 14 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +14
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; +
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+ #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;
Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below the
Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
Quoted 13 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Do you mean dropping the whole property, or just the "description"?
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
Quoted 36 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;
Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
As the tunneled downstream i2c bus needs quirks applied this is modeled as a separate bus.
Previous discussions on this approach are available at:
https://lore.kernel.org/lkml/[email protected]/
Thanks again for your review Krzysztof!
regards;rl
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 78 lines · Richard Leitner
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 27 lines
Quoted 27 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
Different modules have different clock frequencies, don't they ? The property seems needed.
Quoted 76 lines
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
Quoted 35 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
As the tunneled downstream i2c bus needs quirks applied this is modeled as a separate bus.
Previous discussions on this approach are available at:
https://lore.kernel.org/lkml/[email protected]/Thanks again for your review Krzysztof!
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 12 lines · Laurent Pinchart
Quoted 12 lines
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 4 lines
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
Different modules have different clock frequencies, don't they ? The property seems needed.
Yes, that would be fine with assumption there is no actual sensor described. If there is a sensor in DT, that one will have a proper driver binding and asking for frequency?
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerQuoted 63 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
Quoted 8 lines
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/
Quoted 15 lines
Quoted 14 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 13 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Quoted 8 lines
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Quoted 46 lines
Quoted 37 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 13 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
As the tunneled downstream i2c bus needs quirks applied this is modeled as a separate bus.
Previous discussions on this approach are available at:
https://lore.kernel.org/lkml/[email protected]/
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
Quoted 8 lines
Quoted 5 lines
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/
Yes, there are different modules, but all feature the same controller. Which this is basically the device driver binding for. So the idea is to describe the controller independently from the sensor which is "behind" it.
This works because the controller "soft-core" should be the same on all modules. A downstream implemenation (which I haven't studied in detail) is available at https://github.com/VC-MIPI-modules/vc_mipi_core if that helps?
Quoted 38 lines
Quoted 17 lines
Quoted 4 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 17 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Quoted 47 lines
Quoted 47 lines
Quoted 46 lines
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +1
-0+Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 14 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +14
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; +Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+ #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 6 lines
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
Quoted 10 lines
Quoted 8 lines
As the tunneled downstream i2c bus needs quirks applied this is modeled as a separate bus.
Previous discussions on this approach are available at:
https://lore.kernel.org/lkml/[email protected]/Best regards,
Krzysztof
If you have any other questions or something is still unclear to you, please feel free to reach out!
regards;rl
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 137 lines · Richard Leitner
Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
Quoted 8 lines
Quoted 5 lines
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/Yes, there are different modules, but all feature the same controller. Which this is basically the device driver binding for. So the idea is to describe the controller independently from the sensor which is "behind" it.
This works because the controller "soft-core" should be the same on all modules. A downstream implemenation (which I haven't studied in detail) is available at https://github.com/VC-MIPI-modules/vc_mipi_core if that helps?
Quoted 38 lines
Quoted 17 lines
Quoted 4 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 17 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
Quoted 52 lines
Quoted 52 lines
Quoted 51 lines
Quoted 39 lines
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +1
-0+Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
Quoted 7 lines
Quoted 2 lines
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
Quoted 1 line
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 149 lines · Krzysztof Kozlowski
Quoted 137 lines · Richard Leitner
Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
Quoted 8 lines
Quoted 5 lines
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/Yes, there are different modules, but all feature the same controller. Which this is basically the device driver binding for. So the idea is to describe the controller independently from the sensor which is "behind" it.
This works because the controller "soft-core" should be the same on all modules. A downstream implemenation (which I haven't studied in detail) is available at https://github.com/VC-MIPI-modules/vc_mipi_core if that helps?
Quoted 38 lines
Quoted 17 lines
Quoted 4 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 17 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
Quoted 6 lines
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
From that point of view, of course all variants are different. But the interface towards the host is (according to vision components) stable. This is why I aimed for a separate device.
So what's your suggestion on how to best solve this? Provide a per sensor compatible like e.g. "vc-mipi-ov9281"?
Nonehteless this device must then provide a i2c sub node to place the actual imaging sensor on.
If that's fine with you I'm personally fine with this approach too.
Quoted 57 lines
Quoted 57 lines
Quoted 56 lines
Quoted 50 lines
Quoted 41 lines
Quoted 7 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +1
-0+Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +10
-0+required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
Quoted 4 lines
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
The sensor supply is switched by the vc-mipi device driver. That's why it registeres a regulator which is then referenced from the actual sensor driver. Same goes for the clock. Some other "enable pins" like the flash/strobe output are also enabled by the device driver on probe.
thanks & regards;rl
Quoted 3 lines
Quoted 1 line
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Krzysztof KozlowskiQuoted 121 lines · Krzysztof Kozlowski
Quoted 120 lines · Richard Leitner
Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
Quoted 8 lines
Quoted 5 lines
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/Yes, there are different modules, but all feature the same controller. Which this is basically the device driver binding for. So the idea is to describe the controller independently from the sensor which is "behind" it.
This works because the controller "soft-core" should be the same on all modules. A downstream implemenation (which I haven't studied in detail) is available at https://github.com/VC-MIPI-modules/vc_mipi_core if that helps?
Quoted 33 lines
Quoted 13 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 16 lines
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
To be clear, the sensor *is* addressable from the OS. The FPGA sits in the middle on the I2C bus instead of being a separate I2C device on the same bus as the sensor, but it forwards all I2C writes addressed to the sensor onto the backend I2C bus. This is why the DT binding is modelled with a child I2C bus. The sensor DT node is located on that node, and uses the regular DT bindings for the sensor.
Quoted 14 lines
Quoted 10 lines
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
Quoted 6 lines
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
The FPGA has an input clock whose frequency depends on the module. It uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+
|| <------------ MIPI CSI-2 ------------ | |
|| +-------+ | |
|| <--- I2C ---> | | <--- I2C ---> | Sensor |
|| | FPGA | | |
|| | | --- Clock --> | |
|| +-------+ +--------+
^
|
+-------+
| Clock |
| Osc. |
+-------+The frequency of the external clock oscillator is what the clock-frequency models.
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 44 lines
Quoted 35 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
Quoted 4 lines
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
Power supplies are managed in a similar way as the clock in the above diagram. There's one input supply to the camera module on the connector. Individual supplies for the sensor are generated from that main supply, and are controlled by the FPGA which exposes a register over I2C to enable/disable the supplies from the host (there's a single bit to enable/disable them all, they can't be controlled individually).
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 131 lines · Laurent Pinchart
Quoted 121 lines · Krzysztof Kozlowski
Quoted 120 lines · Richard Leitner
Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Richard Leitner
Hi Krzysztof,
thanks for the review!
Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Richard Leitner
Add bindings for the Vision Components MIPI Camera Module Controller.
Signed-off-by Richard Leitner <[email protected]>--- .../vision-components,mipi-module-controller.yaml | 92 ++++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 99 insertions(+)This fails tests, so a very brief review / a few comments:
Mea culpa, I simply failed to run the dtb check before submitting. Sorry. Will not happen again.
Quoted 29 lines
Quoted 29 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +21
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/vision-components,mipi-module-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Vision Components MIPI Camera Module Controller + +maintainers: + - Laurent Pinchart <[email protected]> + - Richard Leitner <[email protected]> + +description: |- + The MIPI camera module controller is an FPGA-based, I2C-accessible system + controller found on MIPI camera modules from Vision Components. It abstracts + the camera sensor behind a unified register interface, and controls and + sequences the on-board power supplies and clocks. + + The camera sensor abstraction is optional. The controller exposes a tunneled + downstream I2C bus used by the attached image sensor. The controller node + acts as the upstream device on the host bus, while child node below theQuoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 26
Quoted 5 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +5
-0+ controller represent the sensor device reachable through the tunnel. + +properties: + compatible: + const: vision-components,mipi-module-controllerThere is no model name, no version, nothing identifying it better? Compatible must be specific to the device (see also writing bindings).
There is one FPGA implemenation for all Vision Components MIPI camera modules AFAICT. So I have no idea how it could be more specific, TBH...
Adding the FPGA hardware model/type is wrong IMHO as it depends on its configuration/firmware, not the hw.
There are different versions of the configuration/firmware. But I think this is also not the correct way to distinguish those, or is it?
Quoted 8 lines
Quoted 5 lines
According to their homepage the vendor calls those modules simply "VC MIPI" modules, which implies this FPGA controller is available on it. So maybe "vision-components,vc-mipi-controller" would be a better fit?
Do you have any ideas/feedback on how improve this name?
So there are different modules? I see several different names on:
https://www.mipi-modules.com/en/mipi-camera-modules/Yes, there are different modules, but all feature the same controller. Which this is basically the device driver binding for. So the idea is to describe the controller independently from the sensor which is "behind" it.
This works because the controller "soft-core" should be the same on all modules. A downstream implemenation (which I haven't studied in detail) is available at https://github.com/VC-MIPI-modules/vc_mipi_core if that helps?
Quoted 33 lines
Quoted 13 lines
Quoted 12 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 35
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + clock-frequency: + description: Frequency of the sensor clock provided by the moduleDrop, implied by the compatible
Quoted 1 line
Do you mean dropping the whole property, or just the "description"?
I meant entire property, but we keep discussing in Laurent's reply.
Quoted 16 lines
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 44
Quoted 9 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +9
-0+ + vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Quoted 6 lines
To be clear, the sensor *is* addressable from the OS. The FPGA sits in the middle on the I2C bus instead of being a separate I2C device on the same bus as the sensor, but it forwards all I2C writes addressed to the sensor onto the backend I2C bus. This is why the DT binding is modelled with a child I2C bus. The sensor DT node is located on that node, and uses the regular DT bindings for the sensor.
Thanks, this should be explained in the description of the binding. It does mention "the sensor device reachable through the tunnel" but the rest about optionality of the sensor feels confusing in this case.
Quoted 15 lines
Quoted 15 lines
Quoted 11 lines
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
Quoted 8 lines
Quoted 6 lines
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
The FPGA has an input clock whose frequency depends on the module. It
There is no "clocks" property in the binding. If there is input, then there is a "clocks".
Then we never describe external oscillators with "clock-frequency" property. ACPI does, but not DT.
Quoted 81 lines
uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+The frequency of the external clock oscillator is what the clock-frequency models.
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 44 lines
Quoted 35 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 55
Quoted 11 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml line 79
Quoted 4 lines
Documentation/devicetree/bindings/media/i2c/vision-components,mipi-module-controller.yaml new file +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
Quoted 4 lines
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
Quoted 7 lines
Power supplies are managed in a similar way as the clock in the above diagram. There's one input supply to the camera module on the connector. Individual supplies for the sensor are generated from that main supply, and are controlled by the FPGA which exposes a register over I2C to enable/disable the supplies from the host (there's a single bit to enable/disable them all, they can't be controlled individually).
Thanks, I see this also shown in the example DTS. I think the sensor node is redundant here, but removing it would require moving all of this to swnodes, so not that much better either. It's fine to keep the sensor subnode for me.
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerQuoted 41 lines · Richard Leitner
Quoted 41 lines
Quoted 27 lines
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
Quoted 7 lines
Quoted 3 lines
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
From that point of view, of course all variants are different. But the interface towards the host is (according to vision components) stable. This is why I aimed for a separate device.
What makes you think that interface is stable and the same? Is the stable aspect or its versioning documented anywhere in the docs?
I can easily imagine that FPGA synthesis actually differs on some sensors or they ship a new, updated version, thus at some point the interface might change or already changed between models.
Quoted 8 lines
So what's your suggestion on how to best solve this? Provide a per sensor compatible like e.g. "vc-mipi-ov9281"?
Nonehteless this device must then provide a i2c sub node to place the actual imaging sensor on.
If that's fine with you I'm personally fine with this approach too.
If you have certainty, like documented spec somewhere telling this, that programming interface of FPGA to the OS is the same, then go with a generic fallback compatible like you have and add front compatibles specific to the sensor.
If you do not have certainty, then I would go only with sensor-specific compatibles for both front and fallbacks, so:
vc-mipi-ov9281, vc-mipi-imx297
It does feel a bit odd, but that is usual way to handle any future differences when two vc-mipi modules turn out not to be compatible.
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Krzysztof KozlowskiQuoted 7 lines · Krzysztof Kozlowski
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Richard Leitner
Quoted 3 lines · Krzysztof Kozlowski
Quoted 2 lines · Richard Leitner
Quoted 1 line · Krzysztof Kozlowski
On Tue, Sep 15, 2026 at 10:20:24PM +0200, Richard Leitner wrote:
[...]
Quoted 33 lines
Quoted 26 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Add bindings for the Vision Components MIPI Camera Module Controller.
(quoted diff) +3
-0+ + vcc-supply: + description: Power supply of the module (3.3V)Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Quoted 6 lines
To be clear, the sensor *is* addressable from the OS. The FPGA sits in the middle on the I2C bus instead of being a separate I2C device on the same bus as the sensor, but it forwards all I2C writes addressed to the sensor onto the backend I2C bus. This is why the DT binding is modelled with a child I2C bus. The sensor DT node is located on that node, and uses the regular DT bindings for the sensor.
Quoted 3 lines
Thanks, this should be explained in the description of the binding. It does mention "the sensor device reachable through the tunnel" but the rest about optionality of the sensor feels confusing in this case.
Thanks Laurent for the additional clarification!
I will adapt the description accordingly for v2.
Quoted 23 lines
Quoted 23 lines
Quoted 22 lines
Quoted 5 lines
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
Quoted 7 lines
Quoted 1 line
The FPGA has an input clock whose frequency depends on the module. It
There is no "clocks" property in the binding. If there is input, then there is a "clocks".
Then we never describe external oscillators with "clock-frequency" property. ACPI does, but not DT.
So how would that be best solved in DT?
Should there be a "fixed-clock" child node for that external oscillator? Something like:
vc_mipi_ctrl: controller@10 {
...
vc_mipi_clk: clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <37125000>;
};
i2c-tunnel {
... vc_mipi_sensor: camera@60 {
...
clocks = <&vc_mipi_clk>;
clock-names = "inck";
};
};Or should (as discussed in the other branch of this thread) there be a separate compatible for every vc-mipi sensor variant board? Then this could also be part of the compatible-dependent driver data.
Or are there any other/better approaches to this?
Quoted 91 lines
Quoted 83 lines
uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+The frequency of the external clock oscillator is what the clock-frequency models.
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 44 lines
Quoted 35 lines
Review
Quoted 11 lines
(quoted diff) +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
(quoted diff) +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
Quoted 4 lines
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
Quoted 7 lines
Power supplies are managed in a similar way as the clock in the above diagram. There's one input supply to the camera module on the connector. Individual supplies for the sensor are generated from that main supply, and are controlled by the FPGA which exposes a register over I2C to enable/disable the supplies from the host (there's a single bit to enable/disable them all, they can't be controlled individually).
Quoted 4 lines
Thanks, I see this also shown in the example DTS. I think the sensor node is redundant here, but removing it would require moving all of this to swnodes, so not that much better either. It's fine to keep the sensor subnode for me.
ACK.
Thanks Krzysztof!
regards;rl
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 11 lines · Richard Leitner
Quoted 5 lines
There is no "clocks" property in the binding. If there is input, then there is a "clocks".
Then we never describe external oscillators with "clock-frequency" property. ACPI does, but not DT.
So how would that be best solved in DT?
Should there be a "fixed-clock" child node for that external oscillator? Something like:
Quoted 9 lines
vc_mipi_ctrl: controller@10 {
...vc_mipi_clk: clock { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <37125000>; };
Oh, wait, I misread. The external oscillator is not external to the module? Below...
Quoted 11 lines
i2c-tunnel { ...vc_mipi_sensor: camera@60 { ... clocks = <&vc_mipi_clk>; clock-names = "inck"; }; };
Quoted 30 lines
Or should (as discussed in the other branch of this thread) there be a separate compatible for every vc-mipi sensor variant board? Then this could also be part of the compatible-dependent driver data.
Or are there any other/better approaches to this?
Quoted 24 lines
Quoted 24 lines
uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+The frequency of the external clock oscillator is what the clock-frequency models.
... this sentence confused me. If the oscillator is part of the module, then clock-frequency property is applicable or it is implied by the compatible.
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Richard LeitnerQuoted 98 lines · Richard Leitner
Quoted 7 lines · Krzysztof Kozlowski
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Richard Leitner
Quoted 3 lines · Krzysztof Kozlowski
Quoted 2 lines · Richard Leitner
Quoted 1 line · Krzysztof Kozlowski
On Tue, Sep 15, 2026 at 10:20:24PM +0200, Richard Leitner wrote:
[...]
Quoted 33 lines
Quoted 26 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 4 lines
Quoted 4 lines
Add bindings for the Vision Components MIPI Camera Module Controller.
(quoted diff) +3
-0+ + vcc-supply: + description: Power supply of the module (3.3V)Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+ + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Quoted 6 lines
To be clear, the sensor *is* addressable from the OS. The FPGA sits in the middle on the I2C bus instead of being a separate I2C device on the same bus as the sensor, but it forwards all I2C writes addressed to the sensor onto the backend I2C bus. This is why the DT binding is modelled with a child I2C bus. The sensor DT node is located on that node, and uses the regular DT bindings for the sensor.
Quoted 3 lines
Thanks, this should be explained in the description of the binding. It does mention "the sensor device reachable through the tunnel" but the rest about optionality of the sensor feels confusing in this case.
Thanks Laurent for the additional clarification!
I will adapt the description accordingly for v2.
Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 10 lines
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
Quoted 7 lines
Quoted 1 line
The FPGA has an input clock whose frequency depends on the module. It
There is no "clocks" property in the binding. If there is input, then there is a "clocks".
Then we never describe external oscillators with "clock-frequency" property. ACPI does, but not DT.
So how would that be best solved in DT?
Should there be a "fixed-clock" child node for that external oscillator? Something like:
vc_mipi_ctrl: controller@10 {
...vc_mipi_clk: clock { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <37125000>; }; i2c-tunnel { ...
Quoted 7 lines
vc_mipi_sensor: camera@60 {
...
clocks = <&vc_mipi_clk>;
clock-names = "inck";
};
};Not quite. I think what Krzysztof calls for is along the lines of (focussing on the clock, the I2C tunnel handling possibly needs to be adapted based on the rest of this mail thread)
&{/} {
vc_mipi_clk: clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <37125000>;
};
};&i2c {
vc_mipi_ctrl: controller@10 {
compatible = "vision-components,mipi-module-controller";
reg = <0x10>;
clocks = <&vc_mipi_clk>;
vcc-supply = <&cam_3v3>;
#clock-cells = <0>;
#address-cells = <1>;
#size-cells = <0>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
vc_mipi_sensor: camera@60 {
compatible = "ovti,ov9281";
reg = <0x60>;
clocks = <&vc_mipi_ctrl>;
clock-names = "inck";
avdd-supply = <&vc_mipi_ctrl>;
dvdd-supply = <&vc_mipi_ctrl>;
dovdd-supply = <&vc_mipi_ctrl>;
};
};
};
};Using clock-frequency in the mipi-module-controller node was a shortcut that I implemented a long time ago before you attempted to upstream a solution. While having a separate fixed clock node is arguably more standard, the additional complexity could be avoided in my opinion. As clock handling by the FPGA is part of the internal design of the modules, I believe we don't need the flexibility that a separate clock provider would bring. It would be different if that external clock was provided by the user of the module through the connector, in that case we shouldn't assume the external clocked has a fixed frequency and no means of controlling it.
Note that the FPGA can, and probably does, alter the clock frequency. There's no guarantee that the frequency of the clock provided to the sensor is the same as the external clock oscillator. The only guarantee is that the FPGA provides a fixed clock to the sensor at a frequency dependent on the type of module, matching the needs of that particular sensor. A separate fixed-clock node is one possible abstraction, but it's not guaranteed to match the hardware perfectly. It shouldn't cause any issue other than additional complexity though, as the frequency of the oscillator and the configuration of the FPGA's internal PLL is not observable from the outside. Only the frequency of the clock provided by the FPGA to the sensor matters, and that's guaranteed.
Note that we could also model this as
&{/} {
vc_mipi_clk: clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <37125000>;
};
};&i2c {
vc_mipi_ctrl: controller@10 {
compatible = "vision-components,mipi-module-controller";
reg = <0x10>;
vcc-supply = <&cam_3v3>;
#address-cells = <1>;
#size-cells = <0>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
vc_mipi_sensor: camera@60 {
compatible = "ovti,ov9281";
reg = <0x60>;
clocks = <&vc_mipi_clk>;
clock-names = "inck";
avdd-supply = <&vc_mipi_ctrl>;
dvdd-supply = <&vc_mipi_ctrl>;
dovdd-supply = <&vc_mipi_ctrl>;
};
};
};
};I still prefer the original proposal in your patch, as it lowers the complexity of the DT binding and DT overlays but centralizing all information in the controller DT node, but I won't make that a casus belli.
Quoted 100 lines
Or should (as discussed in the other branch of this thread) there be a separate compatible for every vc-mipi sensor variant board? Then this could also be part of the compatible-dependent driver data.
Or are there any other/better approaches to this?
Quoted 88 lines
Quoted 81 lines
uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+The frequency of the external clock oscillator is what the clock-frequency models.
Quoted 51 lines
Quoted 51 lines
Quoted 50 lines
Quoted 44 lines
Quoted 35 lines
Review
Quoted 11 lines
(quoted diff) +11
-0+ +required: + - compatible + - reg + - '#clock-cells' + - clock-frequency + - vcc-supply + - '#address-cells' + - '#size-cells' + +unevaluatedProperties: falseadditionalProperties instead, see writing bindings or writing schema. Unless you miss here some other schema $ref.
Quoted 20 lines
(quoted diff) +20
-0+ +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + vc_mipi_ctrl: controller@10 { + compatible = "vision-components,mipi-module-controller"; + reg = <0x10>; + #clock-cells = <0>; + clock-frequency = <37125000>; + vcc-supply = <&cam_3v3>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>;Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ + vc_mipi_sensor: camera@60 { + compatible = "ovti,ov9281"; + reg = <0x60>;Why having the child abstraction if it is completely abstracted? I don't fully get the explanation from description. Completely optional means no benefits, no point in it, no?
Quoted 3 lines
I will try to improve the description. The idea behind this device driver/devicetree node is to not rely on the sensor abstraction from vision components, but to use the upstream sensor specific driver.
You can use driver even without these nodes... but fine, let's assume you have them, so driver will talk with OV9281 sensor for example?
Quoted 7 lines
Quoted 4 lines
The vc-mipi driver does not talk to sensor at all. This is done by the dedicated sensor driver. The vc-mipi driver is only controlling the regulator, clock, etc. as described and sets up the "quirk aware" tunneled i2c interface.
I meant, driver for the sensor. So who controls sensor supplies? Not the sensor driver? It tells something how the hardware is managed, no?
Quoted 6 lines
Power supplies are managed in a similar way as the clock in the above diagram. There's one input supply to the camera module on the connector. Individual supplies for the sensor are generated from that main supply, and are controlled by the FPGA which exposes a register over I2C to enable/disable the supplies from the host (there's a single bit to enable/disable them all, they can't be controlled individually).
Quoted 4 lines
Thanks, I see this also shown in the example DTS. I think the sensor node is redundant here, but removing it would require moving all of this to swnodes, so not that much better either. It's fine to keep the sensor subnode for me.
ACK.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Krzysztof KozlowskiQuoted 63 lines · Krzysztof Kozlowski
Quoted 11 lines · Richard Leitner
Quoted 5 lines
There is no "clocks" property in the binding. If there is input, then there is a "clocks".
Then we never describe external oscillators with "clock-frequency" property. ACPI does, but not DT.
So how would that be best solved in DT?
Should there be a "fixed-clock" child node for that external oscillator? Something like:
Quoted 9 lines
vc_mipi_ctrl: controller@10 {
...vc_mipi_clk: clock { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <37125000>; };Oh, wait, I misread. The external oscillator is not external to the module? Below...
Quoted 38 lines
i2c-tunnel { ...vc_mipi_sensor: camera@60 { ... clocks = <&vc_mipi_clk>; clock-names = "inck"; }; };Or should (as discussed in the other branch of this thread) there be a separate compatible for every vc-mipi sensor variant board? Then this could also be part of the compatible-dependent driver data.
Or are there any other/better approaches to this?
Quoted 21 lines
Quoted 21 lines
uses it for internal purpose, and also to provide a clock to the sensor. Very roughly speaking, and ignoring power supplies as we focus on the clocks, the camera module is architectured this way:
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
The frequency of the external clock oscillator is what the clock-frequency models.
... this sentence confused me. If the oscillator is part of the module, then clock-frequency property is applicable or it is implied by the compatible.
Our replies have crossed each other. I should have waited, it would have saved me time writing a long message :-)
Yes, the external oscillator is in the module. That's why I initially proposed using the clock-frequency property. We could still model it as a separate DT node (see my other e-mail), but I think it brings complexity for little gain.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Quoted 22 lines · Laurent Pinchart
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Connector
|| +--------+ || <------------ MIPI CSI-2 ------------ | | || +-------+ | | || <--- I2C ---> | | <--- I2C ---> | Sensor | || | FPGA | | | || | | --- Clock --> | | || +-------+ +--------+ ^ | +-------+ | Clock | | Osc. | +-------+Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
The frequency of the external clock oscillator is what the clock-frequency models.
... this sentence confused me. If the oscillator is part of the module, then clock-frequency property is applicable or it is implied by the compatible.
Quoted 7 lines
Our replies have crossed each other. I should have waited, it would have saved me time writing a long message :-)
Yes, the external oscillator is in the module. That's why I initially proposed using the clock-frequency property. We could still model it as a separate DT node (see my other e-mail), but I think it brings complexity for little gain.
Yes, I agree.
Best regards,
Krzysztof
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
In reply to Krzysztof KozlowskiQuoted 50 lines · Krzysztof Kozlowski
Quoted 41 lines · Richard Leitner
Quoted 41 lines
Quoted 27 lines
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
Quoted 7 lines
Quoted 3 lines
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
From that point of view, of course all variants are different. But the interface towards the host is (according to vision components) stable. This is why I aimed for a separate device.
Quoted 6 lines
What makes you think that interface is stable and the same? Is the stable aspect or its versioning documented anywhere in the docs?
I can easily imagine that FPGA synthesis actually differs on some sensors or they ship a new, updated version, thus at some point the interface might change or already changed between models.
Alright, let's deep that in the real life aspect of this.
There is no stability guarantee in the sense of a strict, publicly documented commitment. What we have, instead, is direct and honest discussions with the vendor, and a decade of real-life experience with those modules. the result is both better and worse than I'd like. The good part is that the interface is stable with no plan from the vendor to change it, and we haven't noticed observable difference in behaviour between modules for different sensors.
The bad news, on the other hand, is that bugs happen. Newly manufactured versions of the same module sometimes ship with updated FPGA bitstreams that fix bugs. Previous module can't be fixed as the FPGA bitstream is not field-upgradable. Those updates don't affect the interface in the sense that the registers exposed by the FPGA stay the same, but they require different software workarounds. A sensor-specific compatible string wouldn't help here.
So far (again over the course of about a decade) the only two bugs I've observed are related to I2C access. One of the bugs require access to sensor registers to be broken into single-byte read/write operations (this is the job of the controller's driver that register an I2C "tunnel" adapter). The other bug causes the FPGA to shift data by one byte when the host reads the controller's EEPROM data. The driver posted by Richard works around the bugs unconditionally. It could be nice to disable the workaround that split register access into bytes as that can improve performance, and the plan would be to add a DT property to indicate if the module is affected as that can't be inferred from the compatible string (it depends on the revision of the FPGA bitstream as explained above), nor can it be queried at runtime from the controller (AFAIK).
Quoted 13 lines
Quoted 7 lines
So what's your suggestion on how to best solve this? Provide a per sensor compatible like e.g. "vc-mipi-ov9281"?
Nonehteless this device must then provide a i2c sub node to place the actual imaging sensor on.
If that's fine with you I'm personally fine with this approach too.
If you have certainty, like documented spec somewhere telling this, that programming interface of FPGA to the OS is the same, then go with a generic fallback compatible like you have and add front compatibles specific to the sensor.
Quoted 7 lines
If you do not have certainty, then I would go only with sensor-specific compatibles for both front and fallbacks, so:
vc-mipi-ov9281, vc-mipi-imx297
It does feel a bit odd, but that is usual way to handle any future differences when two vc-mipi modules turn out not to be compatible.
I'm not completely opposed to that, but my experience is that it will create additional complexity (to update the DT binding when a module for a new sensor is released) without much gain as bugs are not specific to a module type.
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/3] dt-bindings: media: i2c: Add vision-components,mipi-module-controller
Hi Laurent, Hi Krzysztof,
thanks for that discussion and feedback!
Quoted 76 lines · Laurent Pinchart
Quoted 50 lines · Krzysztof Kozlowski
Quoted 41 lines · Richard Leitner
Quoted 41 lines
Quoted 27 lines
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ vcc-supply: + description: Power supply of the module (3.3V) + + '#address-cells': + const: 1 + + '#size-cells': + const: 0No children allowed, so why these two?
Based on your and the bot feedback I would suggest for v2 to change this "generic i2c bus" to a simple "i2c-tunnel" property which has "$ref: /schemas/i2c/i2c-controller.yaml".
Quoted 8 lines
Quoted 4 lines
This would better reflect the actual hardware, as there is only this one, in firmware hard-coded I2C downstream bus.
Would this be a sane approach?
If the underlying I2C bus and sensor are important, then yes. But I have doubts that you need to describe the sensor if it is truly unadressable/invisible to the OS.
Yes, the I2C bus and sensor is important. The device driver of the sensor talks (via the tunneled I2C interface) directly to the sensor.
Quoted 7 lines
The separate I2C controller/bus description is necessary as the tunneled I2C bus has some quirks unfortunately. Those need to be addressed as otherwise the sensor drivers do not work.
So the idea is to not have a vc-mipi module binding per "sensor variant" of the camera modules, but provide a common controller driver which provides the I2C bus for the sensor driver.
Bindings must accurately describe the device and so far - based on the website - there is no device as mipi-module-controller alone.
I don't get why you assume that all of the variants are exactly identical, thus sensor variant is not applicable.
Quoted 7 lines
Quoted 3 lines
If they are identical in all aspects, then why clock-frequency property? That's obviously rhetorical question, because they are not identical in all aspects and must produce different clock at least.
From that point of view, of course all variants are different. But the interface towards the host is (according to vision components) stable. This is why I aimed for a separate device.
Quoted 6 lines
What makes you think that interface is stable and the same? Is the stable aspect or its versioning documented anywhere in the docs?
I can easily imagine that FPGA synthesis actually differs on some sensors or they ship a new, updated version, thus at some point the interface might change or already changed between models.
Alright, let's deep that in the real life aspect of this.
There is no stability guarantee in the sense of a strict, publicly documented commitment. What we have, instead, is direct and honest discussions with the vendor, and a decade of real-life experience with those modules. the result is both better and worse than I'd like. The good part is that the interface is stable with no plan from the vendor to change it, and we haven't noticed observable difference in behaviour between modules for different sensors.
The bad news, on the other hand, is that bugs happen. Newly manufactured versions of the same module sometimes ship with updated FPGA bitstreams that fix bugs. Previous module can't be fixed as the FPGA bitstream is not field-upgradable. Those updates don't affect the interface in the sense that the registers exposed by the FPGA stay the same, but they require different software workarounds. A sensor-specific compatible string wouldn't help here.
Quoted 13 lines
So far (again over the course of about a decade) the only two bugs I've observed are related to I2C access. One of the bugs require access to sensor registers to be broken into single-byte read/write operations (this is the job of the controller's driver that register an I2C "tunnel" adapter). The other bug causes the FPGA to shift data by one byte when the host reads the controller's EEPROM data. The driver posted by Richard works around the bugs unconditionally. It could be nice to disable the workaround that split register access into bytes as that can improve performance, and the plan would be to add a DT property to indicate if the module is affected as that can't be inferred from the compatible string (it depends on the revision of the FPGA bitstream as explained above), nor can it be queried at runtime from the controller (AFAIK).
Thanks for that explanation Laurent!
I try to get an answer from Vision Components on this. So maybe we can avoid the future "FPGA bug workaround DT properties" by implementing a FPGA bitstream identifier to quirks map.
Nonetheless this is likely not going to be in v2 (or even any version) of this series.
Quoted 19 lines
Quoted 19 lines
Quoted 8 lines
So what's your suggestion on how to best solve this? Provide a per sensor compatible like e.g. "vc-mipi-ov9281"?
Nonehteless this device must then provide a i2c sub node to place the actual imaging sensor on.
If that's fine with you I'm personally fine with this approach too.
If you have certainty, like documented spec somewhere telling this, that programming interface of FPGA to the OS is the same, then go with a generic fallback compatible like you have and add front compatibles specific to the sensor.
If you do not have certainty, then I would go only with sensor-specific compatibles for both front and fallbacks, so:
vc-mipi-ov9281, vc-mipi-imx297
Quoted 7 lines
Quoted 2 lines
It does feel a bit odd, but that is usual way to handle any future differences when two vc-mipi modules turn out not to be compatible.
I'm not completely opposed to that, but my experience is that it will create additional complexity (to update the DT binding when a module for a new sensor is released) without much gain as bugs are not specific to a module type.
I'm currently preparing v2 and I'm not sure on how to handle this compatibles topic. My suggestion would be to stick with "one generic" compatible due to the reasoning Laurent provided.
If we ever have sensor specific FPGA modification we need to address them in either case. And for now it brings no improvement to have separate compatibles for separate sensor types, IMHO.
Quoted 5 lines
Signature · 4 lines
-- Regards, Laurent Pinchart