[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202222732.2453851-24-swboyd@chromium.org>
Date: Thu, 2 Dec 2021 14:27:21 -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,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
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 23/34] drm/sun4i: 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: Maxime Ripard <mripard@...nel.org>
Cc: Chen-Yu Tsai <wens@...e.org>
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/sun4i/sun4i_drv.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 54dd562e294c..700f5e32eaf7 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -56,8 +56,9 @@ static const struct drm_driver sun4i_drv_driver = {
DRM_GEM_CMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(drm_sun4i_gem_dumb_create),
};
-static int sun4i_drv_bind(struct device *dev)
+static int sun4i_drv_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm;
struct sun4i_drv *drv;
int ret;
@@ -125,8 +126,9 @@ static int sun4i_drv_bind(struct device *dev)
return ret;
}
-static void sun4i_drv_unbind(struct device *dev)
+static void sun4i_drv_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm = dev_get_drvdata(dev);
drm_dev_unregister(drm);
@@ -140,9 +142,13 @@ static void sun4i_drv_unbind(struct device *dev)
drm_dev_put(drm);
}
-static const struct component_master_ops sun4i_drv_master_ops = {
- .bind = sun4i_drv_bind,
- .unbind = sun4i_drv_unbind,
+static struct aggregate_driver sun4i_aggregate_driver = {
+ .probe = sun4i_drv_bind,
+ .remove = sun4i_drv_unbind,
+ .driver = {
+ .name = "sun4i_drm",
+ .owner = THIS_MODULE,
+ },
};
static bool sun4i_drv_node_is_connector(struct device_node *node)
@@ -398,16 +404,14 @@ static int sun4i_drv_probe(struct platform_device *pdev)
}
if (count)
- return component_master_add_with_match(&pdev->dev,
- &sun4i_drv_master_ops,
- match);
- else
- return 0;
+ return component_aggregate_register(&pdev->dev, &sun4i_aggregate_driver, match);
+
+ return 0;
}
static int sun4i_drv_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &sun4i_drv_master_ops);
+ component_aggregate_unregister(&pdev->dev, &sun4i_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists