[PATCH v3 02/10] media: synopsys: hdmirx: add media device infrastructure

From: Sascha Hauer

Date: Mon Oct 05 2026 - 09:36:54 EST


From: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx>

Initialize the media device to enable integration with HDMI bridge
devices in the video capture pipeline. This provides the foundation
for representing the hardware topology through the media controller
framework.

Signed-off-by: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx>
Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index bc541431638e7..8b04c84be75ec 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -31,6 +31,7 @@
#include <linux/workqueue.h>

#include <media/cec.h>
+#include <media/media-device.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
@@ -123,6 +124,7 @@ struct snps_hdmirx_dev {
struct device *dev;
struct hdmirx_stream stream;
struct v4l2_device v4l2_dev;
+ struct media_device mdev;
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl *detect_tx_5v_ctrl;
struct v4l2_ctrl *rgb_range;
@@ -2649,6 +2651,7 @@ static void hdmirx_v4l2_release(struct v4l2_device *v4l2_dev)
container_of(v4l2_dev, struct snps_hdmirx_dev, v4l2_dev);

v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
+ media_device_cleanup(&hdmirx_dev->mdev);
kfree(hdmirx_dev);
}

@@ -2751,6 +2754,11 @@ static int hdmirx_probe(struct platform_device *pdev)
goto err_pm;
}

+ hdmirx_dev->mdev.dev = dev;
+ strscpy(hdmirx_dev->mdev.model, "snps-hdmirx", sizeof(hdmirx_dev->mdev.model));
+ media_device_init(&hdmirx_dev->mdev);
+ hdmirx_dev->v4l2_dev.mdev = &hdmirx_dev->mdev;
+
stream = &hdmirx_dev->stream;
stream->hdmirx_dev = hdmirx_dev;
ret = hdmirx_register_stream_vdev(stream);

--
2.47.3