* [PATCH 0/6] media: v4l: add support for Virtual Channel IDs
@ 2025-02-20 14:17 Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.
CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.
Cameras sometimes have support for changing the VC IDs they output
themselves.
For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.
Add support for specifying these Virtual Channel IDs in Video Interface
Endpoints.
Add support for parsing VC IDs in v4l2_fwnode_endpoint_parse().
This allows us to retrieve the specified VC IDs in camera drivers and
configure the hardware to use them.
The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.
The driver must validate the number of VC IDs and the VC IDs
themselves.
Add an example implementation for IMX219.
Cosmin Tanislav (5):
dt-bindings: media: video-interfaces: add support for Virtual Channel
IDs
media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses
dt-bindings: media: imx219: add support for Virtual Channel IDs
media: i2c: imx219: pass format's code to imx219_get_format_bpp()
media: i2c: imx219: implement configurable VC ID
Laurent Pinchart (1):
media: i2c: imx219: Report streams using frame descriptors
.../devicetree/bindings/media/i2c/imx219.yaml | 2 +
.../bindings/media/video-interfaces.yaml | 11 ++++
drivers/media/i2c/imx219.c | 54 +++++++++++++++++--
drivers/media/v4l2-core/v4l2-fwnode.c | 15 ++++++
include/media/v4l2-mediabus.h | 5 ++
5 files changed, 84 insertions(+), 3 deletions(-)
--
2.48.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] dt-bindings: media: video-interfaces: add support for Virtual Channel IDs
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.
CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.
Cameras sometimes have support for changing the VC IDs they output
themselves.
For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.
Add support for specifying these Virtual Channel IDs in Video Interface
Endpoints. The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
.../devicetree/bindings/media/video-interfaces.yaml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/video-interfaces.yaml b/Documentation/devicetree/bindings/media/video-interfaces.yaml
index 038e85b45befa..414b5fa8f3472 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.yaml
+++ b/Documentation/devicetree/bindings/media/video-interfaces.yaml
@@ -231,6 +231,17 @@ properties:
shall be interpreted as 0 (ABC). This property is valid for CSI-2 C-PHY
busses only.
+ vc-ids:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 4
+ items:
+ maximum: 3
+ description:
+ An array of Virtual Channel IDs. These are unsigned integers that specify
+ the VC IDs used by the device for its data streams. This property is valid
+ for MIPI CSI-2 only.
+
strobe:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 0, 1 ]
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
Multi-camera systems often have issues with receiving video streams
from multiple cameras at the same time because the cameras use the same
Virtual Channel IDs.
CSI bridges might not support remapping the Virtual Channel IDs, making
it impossible to receive the separate video streams at the same
time, while the CSI receiver is able to de-mux streams based on VC IDs.
Cameras sometimes have support for changing the VC IDs they output
themselves.
For a practical example, GMSL2 deserializer chips do not support VC ID
remapping in tunnel mode, and neither do the serializers. Allowing the
cameras to have their VC IDs configured would allow multi-camera setups
to use tunnel mode.
Add support for parsing VC IDs in v4l2_fwnode_endpoint_parse().
This allows us to retrieve the specified VC IDs in camera drivers and
configure the hardware to use them.
The supported values are 0 to 3, with a maximum of 4 values.
Although the CSI-2 specification allows for up to 32 virtual channels,
most hardware doesn't support more than 4. This can be extended later
if need be.
The driver must validate the number of VC IDs and the VC IDs
themselves.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 15 +++++++++++++++
include/media/v4l2-mediabus.h | 5 +++++
2 files changed, 20 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index cb153ce42c45d..97ecc01e1e39e 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -129,8 +129,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
bool have_clk_lane = false, have_data_lanes = false,
have_lane_polarities = false, have_line_orders = false;
unsigned int flags = 0, lanes_used = 0;
+ u32 vc_ids_array[V4L2_MBUS_CSI2_MAX_VC_IDS];
u32 array[1 + V4L2_MBUS_CSI2_MAX_DATA_LANES];
u32 clock_lane = 0;
+ unsigned int num_vc_ids = 0;
unsigned int num_data_lanes = 0;
bool use_default_lane_mapping = false;
unsigned int i;
@@ -208,6 +210,15 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
have_line_orders = true;
}
+ rval = fwnode_property_count_u32(fwnode, "vc-ids");
+ if (rval > 0) {
+ num_vc_ids =
+ min_t(unsigned int, V4L2_MBUS_CSI2_MAX_VC_IDS, rval);
+
+ fwnode_property_read_u32_array(fwnode, "vc-ids", vc_ids_array,
+ num_vc_ids);
+ }
+
if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
clock_lane = v;
pr_debug("clock lane position %u\n", v);
@@ -248,6 +259,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
bus->data_lanes[i] = array[i];
}
+ bus->num_vc_ids = num_vc_ids;
+ for (i = 0; i < num_vc_ids; i++)
+ bus->vc_ids[i] = vc_ids_array[i];
+
if (have_lane_polarities) {
fwnode_property_read_u32_array(fwnode,
"lane-polarities", array,
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 24c738cd78940..291b680d2a845 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -72,6 +72,7 @@
#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK BIT(0)
#define V4L2_MBUS_CSI2_MAX_DATA_LANES 8
+#define V4L2_MBUS_CSI2_MAX_VC_IDS 4
/**
* enum v4l2_mbus_csi2_cphy_line_orders_type - CSI-2 C-PHY line order
@@ -94,8 +95,10 @@ enum v4l2_mbus_csi2_cphy_line_orders_type {
/**
* struct v4l2_mbus_config_mipi_csi2 - MIPI CSI-2 data bus configuration
* @flags: media bus (V4L2_MBUS_*) flags
+ * @vc_ids: an array of Virtual Channel IDs
* @data_lanes: an array of physical data lane indexes
* @clock_lane: physical lane index of the clock lane
+ * @num_vc_ids: number of Virtual Channel IDs
* @num_data_lanes: number of data lanes
* @lane_polarities: polarity of the lanes. The order is the same of
* the physical lanes.
@@ -104,8 +107,10 @@ enum v4l2_mbus_csi2_cphy_line_orders_type {
*/
struct v4l2_mbus_config_mipi_csi2 {
unsigned int flags;
+ unsigned char vc_ids[V4L2_MBUS_CSI2_MAX_VC_IDS];
unsigned char data_lanes[V4L2_MBUS_CSI2_MAX_DATA_LANES];
unsigned char clock_lane;
+ unsigned char num_vc_ids;
unsigned char num_data_lanes;
bool lane_polarities[1 + V4L2_MBUS_CSI2_MAX_DATA_LANES];
enum v4l2_mbus_csi2_cphy_line_orders_type line_orders[V4L2_MBUS_CSI2_MAX_DATA_LANES];
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
IMX219 supports configuring the Virtual Channel ID used for image and
embedded data streams.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
Documentation/devicetree/bindings/media/i2c/imx219.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/i2c/imx219.yaml b/Documentation/devicetree/bindings/media/i2c/imx219.yaml
index 07d088cf66e0b..766b0e5fedb05 100644
--- a/Documentation/devicetree/bindings/media/i2c/imx219.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/imx219.yaml
@@ -66,6 +66,8 @@ properties:
clock-noncontinuous: true
link-frequencies: true
+ vc-ids:
+ maxItems: 1
required:
- link-frequencies
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp()
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
` (2 preceding siblings ...)
2025-02-20 14:17 ` [PATCH 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
imx219_get_format_bpp() only uses the code of the format, pass it
instead of the whole format to allow usage when the whole format is not
available.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
drivers/media/i2c/imx219.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index fcd98ee54768e..ad1965a91ae3c 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -387,9 +387,9 @@ static u32 imx219_get_format_code(struct imx219 *imx219, u32 code)
return imx219_mbus_formats[i];
}
-static u32 imx219_get_format_bpp(const struct v4l2_mbus_framefmt *format)
+static u32 imx219_get_format_bpp(u32 code)
{
- switch (format->code) {
+ switch (code) {
case MEDIA_BUS_FMT_SRGGB8_1X8:
case MEDIA_BUS_FMT_SGRBG8_1X8:
case MEDIA_BUS_FMT_SGBRG8_1X8:
@@ -680,7 +680,7 @@ static int imx219_set_framefmt(struct imx219 *imx219,
format = v4l2_subdev_state_get_format(state, 0);
crop = v4l2_subdev_state_get_crop(state, 0);
- bpp = imx219_get_format_bpp(format);
+ bpp = imx219_get_format_bpp(format->code);
cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A,
crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret);
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/6] media: i2c: imx219: Report streams using frame descriptors
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
` (3 preceding siblings ...)
2025-02-20 14:17 ` [PATCH 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Implement the .get_frame_desc() subdev operation to report information
about streams to the connected CSI-2 receiver. This is required to let
the CSI-2 receiver driver know about virtual channels and data types for
each stream.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/i2c/imx219.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index ad1965a91ae3c..4c4ebe54f191b 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -23,6 +23,7 @@
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
+#include <media/mipi-csi2.h>
#include <media/v4l2-cci.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
@@ -990,6 +991,28 @@ static int imx219_init_state(struct v4l2_subdev *sd,
return 0;
}
+static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
+ struct v4l2_mbus_frame_desc *fd)
+{
+ struct v4l2_subdev_state *state;
+ u32 code;
+
+ state = v4l2_subdev_lock_and_get_active_state(sd);
+ code = v4l2_subdev_state_get_format(state, 0)->code;
+ v4l2_subdev_unlock_state(state);
+
+ fd->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2;
+ fd->num_entries = 1;
+
+ fd->entry[0].pixelcode = code;
+ fd->entry[0].stream = 0;
+ fd->entry[0].bus.csi2.vc = 0;
+ fd->entry[0].bus.csi2.dt = imx219_get_format_bpp(code) == 8
+ ? MIPI_CSI2_DT_RAW8 : MIPI_CSI2_DT_RAW10;
+
+ return 0;
+}
+
static const struct v4l2_subdev_video_ops imx219_video_ops = {
.s_stream = imx219_set_stream,
};
@@ -1000,6 +1023,7 @@ static const struct v4l2_subdev_pad_ops imx219_pad_ops = {
.set_fmt = imx219_set_pad_format,
.get_selection = imx219_get_selection,
.enum_frame_size = imx219_enum_frame_size,
+ .get_frame_desc = imx219_get_frame_desc,
};
static const struct v4l2_subdev_ops imx219_subdev_ops = {
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/6] media: i2c: imx219: implement configurable VC ID
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
` (4 preceding siblings ...)
2025-02-20 14:17 ` [PATCH 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
@ 2025-02-20 14:17 ` Cosmin Tanislav
5 siblings, 0 replies; 7+ messages in thread
From: Cosmin Tanislav @ 2025-02-20 14:17 UTC (permalink / raw)
Cc: Dave Stevenson, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Sakari Ailus,
Laurent Pinchart, linux-media, devicetree, imx, linux-arm-kernel,
linux-kernel, Cosmin Tanislav
IMX219 supports configuring the Virtual Channel ID used for image and
embedded data streams.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
---
drivers/media/i2c/imx219.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
index 4c4ebe54f191b..5790106b35936 100644
--- a/drivers/media/i2c/imx219.c
+++ b/drivers/media/i2c/imx219.c
@@ -38,6 +38,8 @@
#define IMX219_MODE_STANDBY 0x00
#define IMX219_MODE_STREAMING 0x01
+#define IMX219_REG_CSI_CH_ID CCI_REG8(0x0110)
+
#define IMX219_REG_CSI_LANE_MODE CCI_REG8(0x0114)
#define IMX219_CSI_2_LANE_MODE 0x01
#define IMX219_CSI_4_LANE_MODE 0x03
@@ -363,6 +365,9 @@ struct imx219 {
/* Two or Four lanes */
u8 lanes;
+
+ /* Virtual channel ID */
+ u8 vc_id;
};
static inline struct imx219 *to_imx219(struct v4l2_subdev *_sd)
@@ -724,6 +729,12 @@ static int imx219_configure_lanes(struct imx219 *imx219)
ARRAY_SIZE(imx219_4lane_regs), NULL);
};
+static int imx219_configure_vc(struct imx219 *imx219)
+{
+ return cci_write(imx219->regmap, IMX219_REG_CSI_CH_ID,
+ imx219->vc_id, NULL);
+}
+
static int imx219_start_streaming(struct imx219 *imx219,
struct v4l2_subdev_state *state)
{
@@ -749,6 +760,11 @@ static int imx219_start_streaming(struct imx219 *imx219,
goto err_rpm_put;
}
+ /* Configure Virtual Channel ID */
+ ret = imx219_configure_vc(imx219);
+ if (ret)
+ return ret;
+
/* Apply format and crop settings. */
ret = imx219_set_framefmt(imx219, state);
if (ret) {
@@ -994,6 +1010,7 @@ static int imx219_init_state(struct v4l2_subdev *sd,
static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_frame_desc *fd)
{
+ struct imx219 *imx219 = to_imx219(sd);
struct v4l2_subdev_state *state;
u32 code;
@@ -1006,7 +1023,7 @@ static int imx219_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
fd->entry[0].pixelcode = code;
fd->entry[0].stream = 0;
- fd->entry[0].bus.csi2.vc = 0;
+ fd->entry[0].bus.csi2.vc = imx219->vc_id;
fd->entry[0].bus.csi2.dt = imx219_get_format_bpp(code) == 8
? MIPI_CSI2_DT_RAW8 : MIPI_CSI2_DT_RAW10;
@@ -1149,6 +1166,13 @@ static int imx219_check_hwcfg(struct device *dev, struct imx219 *imx219)
}
imx219->lanes = ep_cfg.bus.mipi_csi2.num_data_lanes;
+ if (ep_cfg.bus.mipi_csi2.num_vc_ids > 1) {
+ dev_err_probe(dev, -EINVAL,
+ "only 1 virtual channel id is supported\n");
+ goto error_out;
+ }
+ imx219->vc_id = ep_cfg.bus.mipi_csi2.vc_ids[0];
+
/* Check the link frequency set in device tree */
switch (imx219->lanes) {
case 2:
--
2.48.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-20 14:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 14:17 [PATCH 0/6] media: v4l: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 1/6] dt-bindings: media: video-interfaces: " Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 2/6] media: v4l: fwnode: parse Virtual Channel IDs for CSI2 buses Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 3/6] dt-bindings: media: imx219: add support for Virtual Channel IDs Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp() Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 5/6] media: i2c: imx219: Report streams using frame descriptors Cosmin Tanislav
2025-02-20 14:17 ` [PATCH 6/6] media: i2c: imx219: implement configurable VC ID Cosmin Tanislav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox