[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202222732.2453851-32-swboyd@chromium.org>
Date: Thu, 2 Dec 2021 14:27:29 -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,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
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 31/34] ASoC: codecs: wcd938x: 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.
Acked-by: Mark Brown <broonie@...nel.org>
Cc: Jaroslav Kysela <perex@...ex.cz>
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>
---
sound/soc/codecs/wcd938x.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 52de7d14b139..f44f5d41bfdb 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -4316,8 +4316,9 @@ static struct snd_soc_dai_driver wcd938x_dais[] = {
},
};
-static int wcd938x_bind(struct device *dev)
+static int wcd938x_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct wcd938x_priv *wcd938x = dev_get_drvdata(dev);
int ret;
@@ -4400,8 +4401,9 @@ static int wcd938x_bind(struct device *dev)
}
-static void wcd938x_unbind(struct device *dev)
+static void wcd938x_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct wcd938x_priv *wcd938x = dev_get_drvdata(dev);
device_link_remove(dev, wcd938x->txdev);
@@ -4411,9 +4413,13 @@ static void wcd938x_unbind(struct device *dev)
component_unbind_all(dev, wcd938x);
}
-static const struct component_master_ops wcd938x_comp_ops = {
- .bind = wcd938x_bind,
- .unbind = wcd938x_unbind,
+static struct aggregate_driver wcd938x_aggregate_driver = {
+ .probe = wcd938x_bind,
+ .remove = wcd938x_unbind,
+ .driver = {
+ .name = "wcd938x_snd",
+ .owner = THIS_MODULE,
+ },
};
static int wcd938x_compare_of(struct device *dev, void *data)
@@ -4482,7 +4488,7 @@ static int wcd938x_probe(struct platform_device *pdev)
wcd938x_reset(wcd938x);
- ret = component_master_add_with_match(dev, &wcd938x_comp_ops, match);
+ ret = component_aggregate_register(dev, &wcd938x_aggregate_driver, match);
if (ret)
return ret;
@@ -4498,7 +4504,7 @@ static int wcd938x_probe(struct platform_device *pdev)
static int wcd938x_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &wcd938x_comp_ops);
+ component_aggregate_unregister(&pdev->dev, &wcd938x_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists