mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: i2c: cvs: Register subdev nodes upon binding remote sensor
@ 2026-09-30 11:28 Mauro Marinoni
  2026-09-30 11:59 ` sakari.ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Mauro Marinoni @ 2026-09-30 11:28 UTC (permalink / raw)
  To: miguel.vadillo, mchehab; +Cc: linux-media, linux-kernel, sakari.ailus

The Intel CVS driver acts as an intermediate CSI-2 bridge between
the host receiver (e.g. IPU7 ISYS) and the downstream camera sensor.
When the host driver initializes, its async notifier completes upon
binding the CVS bridge and registers its initial subdev nodes.

However, when the CVS bridge subsequently binds the downstream sensor
via its own async notifier callback (cvs_csi_notify_bound), it creates
the media pad link but omits calling v4l2_device_register_subdev_nodes().
As a consequence, downstream sensors declaring the flag
V4L2_SUBDEV_FL_HAS_DEVNODE (such as ov02c10) never have their
/dev/v4l-subdev* character device created, preventing userspace
frameworks like libcamera from opening the sensor.

Call v4l2_device_register_subdev_nodes() in cvs_csi_notify_bound() once
the media pad link is established to expose newly bound subdevices.

Signed-off-by: Mauro Nino Marinoni <mauro.marinoni@santannapisa.it>
---
 drivers/media/i2c/cvs/v4l2.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/cvs/v4l2.c b/drivers/media/i2c/cvs/v4l2.c
index 9fadca7a3bee..6ac4ad6d871c 100644
--- a/drivers/media/i2c/cvs/v4l2.c
+++ b/drivers/media/i2c/cvs/v4l2.c
@@ -13,6 +13,7 @@
 #include <media/v4l2-async.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-mc.h>
@@ -401,6 +402,7 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
 {
         struct icvs *ctx = notifier_to_csi(notifier);
         int pad;
+       int ret;
 
         pad = media_entity_get_fwnode_pad(&sd->entity, asc->match.fwnode,
                                           MEDIA_PAD_FL_SOURCE);
@@ -409,9 +411,16 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
 
         ctx->remote = &sd->entity.pads[pad];
 
-       return media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
-                                    ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
-                                    MEDIA_LNK_FL_IMMUTABLE);
+       ret = media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
+                                   ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
+                                   MEDIA_LNK_FL_IMMUTABLE);
+       if (ret)
+               return ret;
+
+       if (ctx->subdev.v4l2_dev)
+               return v4l2_device_register_subdev_nodes(ctx->subdev.v4l2_dev);
+
+       return 0;
 }
 
 /**
--
2.53.0

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] media: i2c: cvs: Register subdev nodes upon binding remote sensor
@ 2026-09-30 11:19 Mauro Marinoni
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Marinoni @ 2026-09-30 11:19 UTC (permalink / raw)
  To: Miguel Vadillo, mchehab; +Cc: linux-media, linux-kernel, sakari.ailus

The Intel CVS driver acts as an intermediate CSI-2 bridge between
the host receiver (e.g. IPU7 ISYS) and the downstream camera sensor.
When the host driver initializes, its async notifier completes upon
binding the CVS bridge and registers its initial subdev nodes.

However, when the CVS bridge subsequently binds the downstream sensor
via its own async notifier callback (cvs_csi_notify_bound), it creates
the media pad link but omits calling v4l2_device_register_subdev_nodes().
As a consequence, downstream sensors declaring the flag
V4L2_SUBDEV_FL_HAS_DEVNODE (such as ov02c10) never have their
/dev/v4l-subdev* character device created, preventing userspace
frameworks like libcamera from opening the sensor.

Call v4l2_device_register_subdev_nodes() in cvs_csi_notify_bound() once
the media pad link is established to expose newly bound subdevices.

Signed-off-by: Mauro Nino Marinoni <mauro.marinoni@santannapisa.it>
---
 drivers/media/i2c/cvs/v4l2.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/cvs/v4l2.c b/drivers/media/i2c/cvs/v4l2.c
index 9fadca7a3bee..6ac4ad6d871c 100644
--- a/drivers/media/i2c/cvs/v4l2.c
+++ b/drivers/media/i2c/cvs/v4l2.c
@@ -13,6 +13,7 @@
 #include <media/v4l2-async.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-mc.h>
@@ -401,6 +402,7 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
 {
         struct icvs *ctx = notifier_to_csi(notifier);
         int pad;
+       int ret;
 
         pad = media_entity_get_fwnode_pad(&sd->entity, asc->match.fwnode,
                                           MEDIA_PAD_FL_SOURCE);
@@ -409,9 +411,16 @@ static int cvs_csi_notify_bound(struct v4l2_async_notifier *notifier,
 
         ctx->remote = &sd->entity.pads[pad];
 
-       return media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
-                                    ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
-                                    MEDIA_LNK_FL_IMMUTABLE);
+       ret = media_create_pad_link(&sd->entity, pad, &ctx->subdev.entity,
+                                   ICVS_CSI_PAD_SINK, MEDIA_LNK_FL_ENABLED |
+                                   MEDIA_LNK_FL_IMMUTABLE);
+       if (ret)
+               return ret;
+
+       if (ctx->subdev.v4l2_dev)
+               return v4l2_device_register_subdev_nodes(ctx->subdev.v4l2_dev);
+
+       return 0;
 }
 
 /**
--
2.53.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-30 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 11:28 [PATCH] media: i2c: cvs: Register subdev nodes upon binding remote sensor Mauro Marinoni
2026-09-30 11:59 ` sakari.ailus
2026-09-30 14:37   ` R: " Mauro Marinoni
  -- strict thread matches above, loose matches on Subject: below --
2026-09-30 11:19 Mauro Marinoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®