[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-20-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:25 -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,
Tomi Valkeinen <tomba@...nel.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 v6 19/35] drm/omap: 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: Tomi Valkeinen <tomba@...nel.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/omapdrm/dss/dss.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 69b3e15b9356..96a290a7bd68 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1304,8 +1304,9 @@ static const struct soc_device_attribute dss_soc_devices[] = {
{ /* sentinel */ }
};
-static int dss_bind(struct device *dev)
+static int dss_bind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct dss_device *dss = dev_get_drvdata(dev);
struct platform_device *drm_pdev;
struct dss_pdata pdata;
@@ -1330,8 +1331,9 @@ static int dss_bind(struct device *dev)
return 0;
}
-static void dss_unbind(struct device *dev)
+static void dss_unbind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct dss_device *dss = dev_get_drvdata(dev);
platform_device_unregister(dss->drm_pdev);
@@ -1339,9 +1341,13 @@ static void dss_unbind(struct device *dev)
component_unbind_all(dev, NULL);
}
-static const struct component_master_ops dss_component_ops = {
- .bind = dss_bind,
- .unbind = dss_unbind,
+static struct aggregate_driver dss_aggregate_driver = {
+ .probe = dss_bind,
+ .remove = dss_unbind,
+ .driver = {
+ .name = "dss_drm",
+ .owner = THIS_MODULE,
+ },
};
static int dss_component_compare(struct device *dev, void *data)
@@ -1502,7 +1508,7 @@ static int dss_probe(struct platform_device *pdev)
cmatch.match = &match;
device_for_each_child(&pdev->dev, &cmatch, dss_add_child_component);
- r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match);
+ r = component_aggregate_register(&pdev->dev, &dss_aggregate_driver, match);
if (r)
goto err_of_depopulate;
@@ -1541,7 +1547,7 @@ static int dss_remove(struct platform_device *pdev)
of_platform_depopulate(&pdev->dev);
- component_master_del(&pdev->dev, &dss_component_ops);
+ component_aggregate_unregister(&pdev->dev, &dss_aggregate_driver);
dss_debugfs_remove_file(dss->debugfs.clk);
dss_debugfs_remove_file(dss->debugfs.dss);
--
https://chromeos.dev
Powered by blists - more mailing lists