[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127200141.1295328-19-swboyd@chromium.org>
Date: Thu, 27 Jan 2022 12:01:24 -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,
Neil Armstrong <narmstrong@...libre.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 v6 18/35] drm/meson: 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: Neil Armstrong <narmstrong@...libre.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>
---
drivers/gpu/drm/meson/meson_drv.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 80f1d439841a..2add29b347a8 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -361,13 +361,16 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
return ret;
}
-static int meson_drv_bind(struct device *dev)
+static int meson_drv_bind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
+
return meson_drv_bind_master(dev, true);
}
-static void meson_drv_unbind(struct device *dev)
+static void meson_drv_unbind(struct aggregate_device *adev)
{
+ struct device *dev = aggregate_device_parent(adev);
struct meson_drm *priv = dev_get_drvdata(dev);
struct drm_device *drm = priv->drm;
@@ -391,9 +394,13 @@ static void meson_drv_unbind(struct device *dev)
}
}
-static const struct component_master_ops meson_drv_master_ops = {
- .bind = meson_drv_bind,
- .unbind = meson_drv_unbind,
+static struct aggregate_driver meson_aggregate_drv = {
+ .probe = meson_drv_bind,
+ .remove = meson_drv_unbind,
+ .driver = {
+ .name = "meson_drm",
+ .owner = THIS_MODULE,
+ },
};
static int __maybe_unused meson_drv_pm_suspend(struct device *dev)
@@ -487,9 +494,7 @@ static int meson_drv_probe(struct platform_device *pdev)
if (count) {
dev_info(&pdev->dev, "Queued %d outputs on vpu\n", count);
- return component_master_add_with_match(&pdev->dev,
- &meson_drv_master_ops,
- match);
+ return component_aggregate_register(&pdev->dev, &meson_aggregate_drv, match);
}
/* If no output endpoints were available, simply bail out */
--
https://chromeos.dev
Powered by blists - more mailing lists