[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-16-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:21 -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,
Paul Cercueil <paul@...pouillou.net>,
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 15/35] drm/ingenic: 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.
TODO: Move the helpers to PM in aggregate driver hooks.
Acked-by: Paul Cercueil <paul@...pouillou.net>
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/ingenic/ingenic-drm-drv.c | 25 +++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b4943a56be09..c094f9917874 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1317,8 +1317,10 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
return ret;
}
-static int ingenic_drm_bind_with_components(struct device *dev)
+static int ingenic_drm_bind_with_components(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
+
return ingenic_drm_bind(dev, true);
}
@@ -1341,9 +1343,20 @@ static void ingenic_drm_unbind(struct device *dev)
drm_atomic_helper_shutdown(&priv->drm);
}
-static const struct component_master_ops ingenic_master_ops = {
- .bind = ingenic_drm_bind_with_components,
- .unbind = ingenic_drm_unbind,
+static void ingenic_aggregate_remove(struct aggregate_device *adev)
+{
+ struct device *dev = aggregate_device_parent(adev);
+
+ ingenic_drm_unbind(dev);
+}
+
+static struct aggregate_driver ingenic_aggregate_driver = {
+ .probe = ingenic_drm_bind_with_components,
+ .remove = ingenic_aggregate_remove,
+ .driver = {
+ .name = "ingenic_drm",
+ .owner = THIS_MODULE,
+ },
};
static int ingenic_drm_probe(struct platform_device *pdev)
@@ -1363,7 +1376,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
drm_of_component_match_add(dev, &match, compare_of, np);
of_node_put(np);
- return component_master_add_with_match(dev, &ingenic_master_ops, match);
+ return component_aggregate_register(dev, &ingenic_aggregate_driver, match);
}
static int ingenic_drm_remove(struct platform_device *pdev)
@@ -1373,7 +1386,7 @@ static int ingenic_drm_remove(struct platform_device *pdev)
if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU))
ingenic_drm_unbind(dev);
else
- component_master_del(dev, &ingenic_master_ops);
+ component_aggregate_unregister(dev, &ingenic_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists