[PATCH v3 1/4] media: qcom: camss: populate child platform devices
From: Atanas Filipov
Date: Mon Jun 29 2026 - 08:23:13 EST
Call of_platform_populate() at the end of camss_probe() so that child
nodes of the CAMSS DT node are registered as platform devices and
probed via their own platform_driver. This allows hardware blocks that
are physically part of the Camera SubSystem - such as the JPEG encoder
- to be described as sub-nodes of the CAMSS DT node and probe
automatically without any changes to their own drivers.
Call of_platform_depopulate() at the start of camss_remove() to tear
down child devices before the parent unwinds its own resources.
Suggested-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
Link: https://patchwork.linuxtv.org/project/linux-media/patch/20260326-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v11-4-5b93415be6dd@xxxxxxxxxx/
Signed-off-by: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 2123f6388e3d..d2ecc79d5269 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
+#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
#include <linux/pm_domain.h>
#include <linux/slab.h>
@@ -5460,6 +5461,8 @@ static int camss_probe(struct platform_device *pdev)
goto err_media_device_unregister;
}
+ of_platform_populate(dev->of_node, NULL, NULL, dev);
+
return 0;
err_media_device_unregister:
@@ -5497,6 +5500,7 @@ static void camss_remove(struct platform_device *pdev)
{
struct camss *camss = platform_get_drvdata(pdev);
+ of_platform_depopulate(&pdev->dev);
v4l2_async_nf_unregister(&camss->notifier);
v4l2_async_nf_cleanup(&camss->notifier);
camss_unregister_entities(camss);
--
2.34.1