[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202222732.2453851-9-swboyd@chromium.org>
Date: Thu, 2 Dec 2021 14:27:06 -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,
James Qian Wang <james.qian.wang@....com>,
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 08/34] drm/komeda: 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: James Qian Wang (Arm Technology China) <james.qian.wang@....com>
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>
---
.../gpu/drm/arm/display/komeda/komeda_drv.c | 20 ++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
index e7933930a657..0463386a6ed2 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
@@ -25,8 +25,9 @@ struct komeda_dev *dev_to_mdev(struct device *dev)
return mdrv ? mdrv->mdev : NULL;
}
-static void komeda_unbind(struct device *dev)
+static void komeda_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct komeda_drv *mdrv = dev_get_drvdata(dev);
if (!mdrv)
@@ -45,8 +46,9 @@ static void komeda_unbind(struct device *dev)
devm_kfree(dev, mdrv);
}
-static int komeda_bind(struct device *dev)
+static int komeda_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct komeda_drv *mdrv;
int err;
@@ -87,9 +89,13 @@ static int komeda_bind(struct device *dev)
return err;
}
-static const struct component_master_ops komeda_master_ops = {
- .bind = komeda_bind,
- .unbind = komeda_unbind,
+static struct aggregate_driver komeda_aggregate_driver = {
+ .probe = komeda_bind,
+ .remove = komeda_unbind,
+ .driver = {
+ .name = "komeda_drm",
+ .owner = THIS_MODULE,
+ },
};
static int compare_of(struct device *dev, void *data)
@@ -129,12 +135,12 @@ static int komeda_platform_probe(struct platform_device *pdev)
komeda_add_slave(dev, &match, child, KOMEDA_OF_PORT_OUTPUT, 1);
}
- return component_master_add_with_match(dev, &komeda_master_ops, match);
+ return component_aggregate_register(dev, &komeda_aggregate_driver, match);
}
static int komeda_platform_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &komeda_master_ops);
+ component_aggregate_unregister(&pdev->dev, &komeda_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists