[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211026000044.885195-22-swboyd@chromium.org>
Date: Mon, 25 Oct 2021 17:00:31 -0700
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,
Sandy Huang <hjc@...k-chips.com>,
Heiko Stübner <heiko@...ech.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 v3 21/34] drm/rockchip: 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: Sandy Huang <hjc@...k-chips.com>
Cc: "Heiko Stübner" <heiko@...ech.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/rockchip/rockchip_drm_drv.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index bfba9793d238..cc63222c3ad0 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -109,8 +109,9 @@ static void rockchip_iommu_cleanup(struct drm_device *drm_dev)
iommu_domain_free(private->domain);
}
-static int rockchip_drm_bind(struct device *dev)
+static int rockchip_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm_dev;
struct rockchip_drm_private *private;
int ret;
@@ -186,8 +187,9 @@ static int rockchip_drm_bind(struct device *dev)
return ret;
}
-static void rockchip_drm_unbind(struct device *dev)
+static void rockchip_drm_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm_dev = dev_get_drvdata(dev);
drm_dev_unregister(drm_dev);
@@ -342,9 +344,13 @@ static struct component_match *rockchip_drm_match_add(struct device *dev)
return match ?: ERR_PTR(-ENODEV);
}
-static const struct component_master_ops rockchip_drm_ops = {
- .bind = rockchip_drm_bind,
- .unbind = rockchip_drm_unbind,
+static struct aggregate_driver rockchip_aggregate_driver = {
+ .probe = rockchip_drm_bind,
+ .remove = rockchip_drm_unbind,
+ .driver = {
+ .name = "rockchip_drm",
+ .owner = THIS_MODULE,
+ },
};
static int rockchip_drm_platform_of_probe(struct device *dev)
@@ -415,7 +421,7 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev)
if (IS_ERR(match))
return PTR_ERR(match);
- ret = component_master_add_with_match(dev, &rockchip_drm_ops, match);
+ ret = component_aggregate_register(dev, &rockchip_aggregate_driver, match);
if (ret < 0) {
rockchip_drm_match_remove(dev);
return ret;
@@ -426,7 +432,7 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev)
static int rockchip_drm_platform_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &rockchip_drm_ops);
+ component_aggregate_unregister(&pdev->dev, &rockchip_aggregate_driver);
rockchip_drm_match_remove(&pdev->dev);
--
https://chromeos.dev
Powered by blists - more mailing lists