[PATCH v4 06/10] ASoC: qcom: Switch lpass-cpu and qaif-cpu to snd_soc_of_xlate_dai_name()
From: Harendra Gautam
Date: Thu Sep 03 2026 - 03:51:23 EST
Use the new generic snd_soc_of_xlate_dai_name() helper in lpass-cpu.c
and qaif-cpu.c, and remove the local lpass implementation.
Signed-off-by: Harendra Gautam <harendra.gautam@xxxxxxxxxxxxxxxx>
---
sound/soc/qcom/lpass-cpu.c | 23 +----------------------
sound/soc/qcom/qaif-cpu.c | 1 +
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 242bc16da36d..61efa45376cd 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -458,30 +458,9 @@ const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops2 = {
};
EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_ops2);
-static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component,
- const struct of_phandle_args *args,
- const char **dai_name)
-{
- struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
- const struct lpass_variant *variant = drvdata->variant;
- int id = args->args[0];
- int ret = -EINVAL;
- int i;
-
- for (i = 0; i < variant->num_dai; i++) {
- if (variant->dai_driver[i].id == id) {
- *dai_name = variant->dai_driver[i].name;
- ret = 0;
- break;
- }
- }
-
- return ret;
-}
-
static const struct snd_soc_component_driver lpass_cpu_comp_driver = {
.name = "lpass-cpu",
- .of_xlate_dai_name = asoc_qcom_of_xlate_dai_name,
+ .of_xlate_dai_name = snd_soc_of_xlate_dai_name,
.legacy_dai_naming = 1,
};
diff --git a/sound/soc/qcom/qaif-cpu.c b/sound/soc/qcom/qaif-cpu.c
index c75b139ecb2a..d751abb7a888 100644
--- a/sound/soc/qcom/qaif-cpu.c
+++ b/sound/soc/qcom/qaif-cpu.c
@@ -594,6 +594,7 @@ EXPORT_SYMBOL_GPL(asoc_qcom_qaif_aif_cpu_dai_ops);
static const struct snd_soc_component_driver qaif_cpu_comp_driver = {
.name = "qaif-cpu",
+ .of_xlate_dai_name = snd_soc_of_xlate_dai_name,
};
static const struct regmap_config audio_qaif_regmap_config = {
--
2.34.1