[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211026000044.885195-12-swboyd@chromium.org>
Date: Mon, 25 Oct 2021 17:00:21 -0700
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,
Russell King <linux@...linux.org.uk>,
Daniel Vetter <daniel.vetter@...ll.ch>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Clark <robdclark@...il.com>,
Saravana Kannan <saravanak@...gle.com>
Subject: [PATCH v3 11/34] drm/armada: 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: Russell King <linux@...linux.org.uk>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Rob Clark <robdclark@...il.com>
Cc: Saravana Kannan <saravanak@...gle.com>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/gpu/drm/armada/armada_drv.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 8e3e98f13db4..b3559363ea43 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -60,8 +60,9 @@ static const struct drm_mode_config_funcs armada_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
-static int armada_drm_bind(struct device *dev)
+static int armada_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct armada_private *priv;
struct resource *mem = NULL;
int ret, n;
@@ -159,8 +160,9 @@ static int armada_drm_bind(struct device *dev)
return ret;
}
-static void armada_drm_unbind(struct device *dev)
+static void armada_drm_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm = dev_get_drvdata(dev);
struct armada_private *priv = drm_to_armada_dev(drm);
@@ -202,9 +204,13 @@ static void armada_add_endpoints(struct device *dev,
}
}
-static const struct component_master_ops armada_master_ops = {
- .bind = armada_drm_bind,
- .unbind = armada_drm_unbind,
+static struct aggregate_driver armada_aggregate_driver = {
+ .probe = armada_drm_bind,
+ .remove = armada_drm_unbind,
+ .driver = {
+ .name = "armada_drm",
+ .owner = THIS_MODULE,
+ },
};
static int armada_drm_probe(struct platform_device *pdev)
@@ -213,7 +219,7 @@ static int armada_drm_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
int ret;
- ret = drm_of_component_probe(dev, compare_dev_name, &armada_master_ops);
+ ret = drm_of_aggregate_probe(dev, compare_dev_name, &armada_aggregate_driver);
if (ret != -EINVAL)
return ret;
@@ -240,13 +246,12 @@ static int armada_drm_probe(struct platform_device *pdev)
}
}
- return component_master_add_with_match(&pdev->dev, &armada_master_ops,
- match);
+ return component_aggregate_register(&pdev->dev, &armada_aggregate_driver, match);
}
static int armada_drm_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &armada_master_ops);
+ component_aggregate_unregister(&pdev->dev, &armada_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists