[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211026000044.885195-32-swboyd@chromium.org>
Date: Mon, 25 Oct 2021 17:00:41 -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,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.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 v3 31/34] sound: hdac: 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: Jaroslav Kysela <perex@...ex.cz>
Cc: Takashi Iwai <tiwai@...e.com>
Cc: Kai Vehmanen <kai.vehmanen@...ux.intel.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>
---
sound/hda/hdac_component.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/sound/hda/hdac_component.c b/sound/hda/hdac_component.c
index bb37e7e0bd79..9e4dab97f485 100644
--- a/sound/hda/hdac_component.c
+++ b/sound/hda/hdac_component.c
@@ -181,8 +181,9 @@ int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
}
EXPORT_SYMBOL_GPL(snd_hdac_acomp_get_eld);
-static int hdac_component_master_bind(struct device *dev)
+static int hdac_component_master_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_audio_component *acomp = hdac_get_acomp(dev);
int ret;
@@ -222,8 +223,9 @@ static int hdac_component_master_bind(struct device *dev)
return ret;
}
-static void hdac_component_master_unbind(struct device *dev)
+static void hdac_component_master_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_audio_component *acomp = hdac_get_acomp(dev);
if (acomp->audio_ops && acomp->audio_ops->master_unbind)
@@ -233,9 +235,13 @@ static void hdac_component_master_unbind(struct device *dev)
WARN_ON(acomp->ops || acomp->dev);
}
-static const struct component_master_ops hdac_component_master_ops = {
- .bind = hdac_component_master_bind,
- .unbind = hdac_component_master_unbind,
+static struct aggregate_driver hdac_aggregate_driver = {
+ .probe = hdac_component_master_bind,
+ .remove = hdac_component_master_unbind,
+ .driver = {
+ .name = "hdac_agg",
+ .owner = THIS_MODULE,
+ },
};
/**
@@ -303,8 +309,7 @@ int snd_hdac_acomp_init(struct hdac_bus *bus,
devres_add(dev, acomp);
component_match_add_typed(dev, &match, match_master, bus);
- ret = component_master_add_with_match(dev, &hdac_component_master_ops,
- match);
+ ret = component_aggregate_register(dev, &hdac_aggregate_driver, match);
if (ret < 0)
goto out_err;
@@ -344,7 +349,7 @@ int snd_hdac_acomp_exit(struct hdac_bus *bus)
bus->display_power_active = 0;
bus->display_power_status = 0;
- component_master_del(dev, &hdac_component_master_ops);
+ component_aggregate_unregister(dev, &hdac_aggregate_driver);
bus->audio_component = NULL;
devres_destroy(dev, hdac_acomp_release, NULL, NULL);
--
https://chromeos.dev
Powered by blists - more mailing lists