[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-21-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:26 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Douglas Anderson <dianders@...omium.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 v6 20/35] 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 bec207de4544..6a6ed293d7a0 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -108,8 +108,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 = aggregate_device_parent(adev);
struct drm_device *drm_dev;
struct rockchip_drm_private *private;
int ret;
@@ -179,8 +180,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 = aggregate_device_parent(adev);
struct drm_device *drm_dev = dev_get_drvdata(dev);
drm_dev_unregister(drm_dev);
@@ -331,9 +333,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)
@@ -404,7 +410,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;
@@ -415,7 +421,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