[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-25-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:30 -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,
Emma Anholt <emma@...olt.net>,
Maxime Ripard <mripard@...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 24/35] drm/vc4: 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: Emma Anholt <emma@...olt.net>
Cc: Maxime Ripard <mripard@...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/vc4/vc4_drv.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 16abc3a3d601..297ecddea5fb 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -212,8 +212,9 @@ static void vc4_match_add_drivers(struct device *dev,
}
}
-static int vc4_drm_bind(struct device *dev)
+static int vc4_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct platform_device *pdev = to_platform_device(dev);
struct drm_device *drm;
struct vc4_dev *vc4;
@@ -284,8 +285,9 @@ static int vc4_drm_bind(struct device *dev)
return ret;
}
-static void vc4_drm_unbind(struct device *dev)
+static void vc4_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);
@@ -293,9 +295,13 @@ static void vc4_drm_unbind(struct device *dev)
drm_atomic_helper_shutdown(drm);
}
-static const struct component_master_ops vc4_drm_ops = {
- .bind = vc4_drm_bind,
- .unbind = vc4_drm_unbind,
+static struct aggregate_driver vc4_aggregate_driver = {
+ .probe = vc4_drm_bind,
+ .remove = vc4_drm_unbind,
+ .driver = {
+ .name = "vc4_drm",
+ .owner = THIS_MODULE,
+ },
};
/*
@@ -326,12 +332,12 @@ static int vc4_platform_drm_probe(struct platform_device *pdev)
vc4_match_add_drivers(dev, &match,
component_drivers, ARRAY_SIZE(component_drivers));
- return component_master_add_with_match(dev, &vc4_drm_ops, match);
+ return component_aggregate_register(dev, &vc4_aggregate_driver, match);
}
static int vc4_platform_drm_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &vc4_drm_ops);
+ component_aggregate_unregister(&pdev->dev, &vc4_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists