summaryrefslogtreecommitdiff
path: root/sound/soc/sof/mediatek
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@nxp.com>2021-12-15 11:57:03 +0300
committerMark Brown <broonie@kernel.org>2021-12-15 17:02:50 +0300
commit28084f4a0e031a87b624ea121bd8fd782b90ff2a (patch)
tree7d48bc30412371641bb607b35ed26178f49c8574 /sound/soc/sof/mediatek
parent9e376b14ef3e0a78f3697d586cb6013c76e0f5f5 (diff)
downloadlinux-28084f4a0e031a87b624ea121bd8fd782b90ff2a.tar.xz
ASoC: SOF: OF: Avoid reverse module dependency
Similar with commit 8a49cd11e68ed0 ("ASoC: SOF: ACPI: avoid reverse module dependency") we will be having hardware specific drivers that link against a common "helper" framework. sof-of-dev.c becomes a library with the interface defined in the newly created file sof-of-dev.h. This is the final step started with Kconfig simplification in commit 7548a391c53ca ("ASoC: SOF: i.MX: simplify Kconfig") Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/mediatek')
-rw-r--r--sound/soc/sof/mediatek/mediatek-ops.h8
-rw-r--r--sound/soc/sof/mediatek/mt8195/mt8195.c31
2 files changed, 28 insertions, 11 deletions
diff --git a/sound/soc/sof/mediatek/mediatek-ops.h b/sound/soc/sof/mediatek/mediatek-ops.h
deleted file mode 100644
index e0ffa69ecb0c..000000000000
--- a/sound/soc/sof/mediatek/mediatek-ops.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
-
-#ifndef __MEDIATEK_OPS_H__
-#define __MEDIATEK_OPS_H__
-
-extern const struct snd_sof_dsp_ops sof_mt8195_ops;
-
-#endif
diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c
index c719ba470620..3ab12f352935 100644
--- a/sound/soc/sof/mediatek/mt8195/mt8195.c
+++ b/sound/soc/sof/mediatek/mt8195/mt8195.c
@@ -21,9 +21,9 @@
#include <sound/sof.h>
#include <sound/sof/xtensa.h>
#include "../../ops.h"
+#include "../../sof-of-dev.h"
#include "../../sof-audio.h"
#include "../adsp_helper.h"
-#include "../mediatek-ops.h"
#include "mt8195.h"
#include "mt8195-clk.h"
@@ -388,7 +388,7 @@ static struct snd_soc_dai_driver mt8195_dai[] = {
};
/* mt8195 ops */
-const struct snd_sof_dsp_ops sof_mt8195_ops = {
+static const struct snd_sof_dsp_ops sof_mt8195_ops = {
/* probe and remove */
.probe = mt8195_dsp_probe,
.remove = mt8195_dsp_remove,
@@ -432,7 +432,32 @@ const struct snd_sof_dsp_ops sof_mt8195_ops = {
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
};
-EXPORT_SYMBOL(sof_mt8195_ops);
+
+static const struct sof_dev_desc sof_of_mt8195_desc = {
+ .default_fw_path = "mediatek/sof",
+ .default_tplg_path = "mediatek/sof-tplg",
+ .default_fw_filename = "sof-mt8195.ri",
+ .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg",
+ .ops = &sof_mt8195_ops,
+};
+
+static const struct of_device_id sof_of_mt8195_ids[] = {
+ { .compatible = "mediatek,mt8195-dsp", .data = &sof_of_mt8195_desc},
+ { }
+};
+MODULE_DEVICE_TABLE(of, sof_of_mt8195_ids);
+
+/* DT driver definition */
+static struct platform_driver snd_sof_of_mt8195_driver = {
+ .probe = sof_of_probe,
+ .remove = sof_of_remove,
+ .driver = {
+ .name = "sof-audio-of-mt8195",
+ .pm = &sof_of_pm,
+ .of_match_table = sof_of_mt8195_ids,
+ },
+};
+module_platform_driver(snd_sof_of_mt8195_driver);
MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA);
MODULE_LICENSE("Dual BSD/GPL");