[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202222732.2453851-19-swboyd@chromium.org>
Date: Thu, 2 Dec 2021 14:27:16 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Daniel Vetter <daniel.vetter@...ll.ch>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Clark <robdclark@...il.com>,
Russell King <rmk+kernel@....linux.org.uk>,
Saravana Kannan <saravanak@...gle.com>
Subject: [PATCH v4 18/34] drm/mediatek: Migrate to aggregate driver
Use an aggregate driver instead of component ops so that we can get
proper driver probe ordering of the aggregate device with respect to all
the component devices that make up the aggregate device.
Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Rob Clark <robdclark@...il.com>
Cc: Russell King <rmk+kernel@....linux.org.uk>
Cc: Saravana Kannan <saravanak@...gle.com>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index aec39724ebeb..a3f27b8c9769 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -348,8 +348,9 @@ static int compare_of(struct device *dev, void *data)
return dev->of_node == data;
}
-static int mtk_drm_bind(struct device *dev)
+static int mtk_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct mtk_drm_private *private = dev_get_drvdata(dev);
struct drm_device *drm;
int ret;
@@ -380,8 +381,9 @@ static int mtk_drm_bind(struct device *dev)
return ret;
}
-static void mtk_drm_unbind(struct device *dev)
+static void mtk_drm_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct mtk_drm_private *private = dev_get_drvdata(dev);
drm_dev_unregister(private->drm);
@@ -391,9 +393,13 @@ static void mtk_drm_unbind(struct device *dev)
private->drm = NULL;
}
-static const struct component_master_ops mtk_drm_ops = {
- .bind = mtk_drm_bind,
- .unbind = mtk_drm_unbind,
+static struct aggregate_driver mtk_drm_aggregate_driver = {
+ .probe = mtk_drm_bind,
+ .remove = mtk_drm_unbind,
+ .driver = {
+ .name = "mtk_drm",
+ .owner = THIS_MODULE,
+ },
};
static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
@@ -593,7 +599,7 @@ static int mtk_drm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, private);
- ret = component_master_add_with_match(dev, &mtk_drm_ops, match);
+ ret = component_aggregate_register(dev, &mtk_drm_aggregate_driver, match);
if (ret)
goto err_pm;
@@ -616,7 +622,7 @@ static int mtk_drm_remove(struct platform_device *pdev)
struct mtk_drm_private *private = platform_get_drvdata(pdev);
int i;
- component_master_del(&pdev->dev, &mtk_drm_ops);
+ component_aggregate_unregister(&pdev->dev, &mtk_drm_aggregate_driver);
pm_runtime_disable(&pdev->dev);
of_node_put(private->mutex_node);
for (i = 0; i < DDP_COMPONENT_ID_MAX; i++)
--
https://chromeos.dev
Powered by blists - more mailing lists