summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek/mt7986
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mediatek/mt7986')
-rw-r--r--sound/soc/mediatek/mt7986/Makefile2
-rw-r--r--sound/soc/mediatek/mt7986/mt7986-afe-pcm.c33
-rw-r--r--sound/soc/mediatek/mt7986/mt7986-dai-etdm.c4
-rw-r--r--sound/soc/mediatek/mt7986/mt7986-wm8960.c8
4 files changed, 16 insertions, 31 deletions
diff --git a/sound/soc/mediatek/mt7986/Makefile b/sound/soc/mediatek/mt7986/Makefile
index fc4c82559b29..4b54bbe88683 100644
--- a/sound/soc/mediatek/mt7986/Makefile
+++ b/sound/soc/mediatek/mt7986/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# platform driver
-snd-soc-mt7986-afe-objs := \
+snd-soc-mt7986-afe-y := \
mt7986-afe-pcm.o \
mt7986-dai-etdm.o
diff --git a/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c b/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c
index d497e1129889..7a6ad9116e55 100644
--- a/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c
+++ b/sound/soc/mediatek/mt7986/mt7986-afe-pcm.c
@@ -106,7 +106,7 @@ static const struct snd_pcm_hardware mt7986_afe_hardware = {
static int mt7986_memif_fs(struct snd_pcm_substream *substream,
unsigned int rate)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
@@ -116,7 +116,7 @@ static int mt7986_memif_fs(struct snd_pcm_substream *substream,
static int mt7986_irq_fs(struct snd_pcm_substream *substream,
unsigned int rate)
{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
@@ -429,18 +429,6 @@ static int mt7986_afe_runtime_resume(struct device *dev)
return 0;
}
-static int mt7986_afe_component_probe(struct snd_soc_component *component)
-{
- return mtk_afe_add_sub_dai_control(component);
-}
-
-static const struct snd_soc_component_driver mt7986_afe_component = {
- .name = AFE_PCM_NAME,
- .probe = mt7986_afe_component_probe,
- .pointer = mtk_afe_pcm_pointer,
- .pcm_construct = mtk_afe_pcm_new,
-};
-
static int mt7986_dai_memif_register(struct mtk_base_afe *afe)
{
struct mtk_base_afe_dai *dai;
@@ -541,10 +529,9 @@ static int mt7986_afe_pcm_dev_probe(struct platform_device *pdev)
/* request irq */
irq_id = platform_get_irq(pdev, 0);
- if (irq_id < 0) {
- ret = irq_id;
- return dev_err_probe(dev, ret, "No irq found\n");
- }
+ if (irq_id < 0)
+ return irq_id;
+
ret = devm_request_irq(dev, irq_id, mt7986_afe_irq_handler,
IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);
if (ret)
@@ -573,7 +560,7 @@ static int mt7986_afe_pcm_dev_probe(struct platform_device *pdev)
/* register component */
ret = devm_snd_soc_register_component(&pdev->dev,
- &mt7986_afe_component,
+ &mtk_afe_pcm_platform,
NULL, 0);
if (ret)
return dev_err_probe(dev, ret, "Cannot register AFE component\n");
@@ -602,18 +589,18 @@ static const struct of_device_id mt7986_afe_pcm_dt_match[] = {
MODULE_DEVICE_TABLE(of, mt7986_afe_pcm_dt_match);
static const struct dev_pm_ops mt7986_afe_pm_ops = {
- SET_RUNTIME_PM_OPS(mt7986_afe_runtime_suspend,
- mt7986_afe_runtime_resume, NULL)
+ RUNTIME_PM_OPS(mt7986_afe_runtime_suspend,
+ mt7986_afe_runtime_resume, NULL)
};
static struct platform_driver mt7986_afe_pcm_driver = {
.driver = {
.name = "mt7986-audio",
.of_match_table = mt7986_afe_pcm_dt_match,
- .pm = &mt7986_afe_pm_ops,
+ .pm = pm_ptr(&mt7986_afe_pm_ops),
},
.probe = mt7986_afe_pcm_dev_probe,
- .remove_new = mt7986_afe_pcm_dev_remove,
+ .remove = mt7986_afe_pcm_dev_remove,
};
module_platform_driver(mt7986_afe_pcm_driver);
diff --git a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
index d57971413a04..fc55ff47b7bc 100644
--- a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
+++ b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
@@ -348,10 +348,10 @@ static int mtk_dai_etdm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
}
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
- case SND_SOC_DAIFMT_CBM_CFM:
+ case SND_SOC_DAIFMT_CBP_CFP:
etdm_data->slave_mode = true;
break;
- case SND_SOC_DAIFMT_CBS_CFS:
+ case SND_SOC_DAIFMT_CBC_CFC:
etdm_data->slave_mode = false;
break;
default:
diff --git a/sound/soc/mediatek/mt7986/mt7986-wm8960.c b/sound/soc/mediatek/mt7986/mt7986-wm8960.c
index 6982e833421d..f1dc18222be7 100644
--- a/sound/soc/mediatek/mt7986/mt7986-wm8960.c
+++ b/sound/soc/mediatek/mt7986/mt7986-wm8960.c
@@ -45,7 +45,7 @@ static struct snd_soc_dai_link mt7986_wm8960_dai_links[] = {
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.dynamic = 1,
- .dpcm_playback = 1,
+ .playback_only = 1,
SND_SOC_DAILINK_REG(playback),
},
{
@@ -54,7 +54,7 @@ static struct snd_soc_dai_link mt7986_wm8960_dai_links[] = {
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.dynamic = 1,
- .dpcm_capture = 1,
+ .capture_only = 1,
SND_SOC_DAILINK_REG(capture),
},
/* BE */
@@ -63,10 +63,8 @@ static struct snd_soc_dai_link mt7986_wm8960_dai_links[] = {
.no_pcm = 1,
.dai_fmt = SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBS_CFS |
+ SND_SOC_DAIFMT_CBC_CFC |
SND_SOC_DAIFMT_GATED,
- .dpcm_playback = 1,
- .dpcm_capture = 1,
SND_SOC_DAILINK_REG(codec),
},
};