[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-14-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:19 -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,
Inki Dae <inki.dae@...sung.com>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
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 13/35] drm/exynos: 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: Inki Dae <inki.dae@...sung.com>
Cc: Joonyoung Shim <jy0922.shim@...sung.com>
Cc: Seung-Woo Kim <sw0312.kim@...sung.com>
Cc: Kyungmin Park <kyungmin.park@...sung.com>
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/exynos/exynos_drm_drv.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 9743b6b17447..f9a3e7041254 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -244,8 +244,9 @@ static struct component_match *exynos_drm_match_add(struct device *dev)
return match ?: ERR_PTR(-ENODEV);
}
-static int exynos_drm_bind(struct device *dev)
+static int exynos_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct exynos_drm_private *private;
struct drm_encoder *encoder;
struct drm_device *drm;
@@ -321,8 +322,9 @@ static int exynos_drm_bind(struct device *dev)
return ret;
}
-static void exynos_drm_unbind(struct device *dev)
+static void exynos_drm_unbind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct drm_device *drm = dev_get_drvdata(dev);
drm_dev_unregister(drm);
@@ -341,9 +343,13 @@ static void exynos_drm_unbind(struct device *dev)
drm_dev_put(drm);
}
-static const struct component_master_ops exynos_drm_ops = {
- .bind = exynos_drm_bind,
- .unbind = exynos_drm_unbind,
+static struct aggregate_driver exynos_drm_aggregate_driver = {
+ .probe = exynos_drm_bind,
+ .remove = exynos_drm_unbind,
+ .driver = {
+ .name = "exynos_drm",
+ .owner = THIS_MODULE,
+ },
};
static int exynos_drm_platform_probe(struct platform_device *pdev)
@@ -356,13 +362,12 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
if (IS_ERR(match))
return PTR_ERR(match);
- return component_master_add_with_match(&pdev->dev, &exynos_drm_ops,
- match);
+ return component_aggregate_register(&pdev->dev, &exynos_drm_aggregate_driver, match);
}
static int exynos_drm_platform_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &exynos_drm_ops);
+ component_aggregate_unregister(&pdev->dev, &exynos_drm_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists