From 8d43ac92128b9f8b30ffbe8c6988fa46913acad4 Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Tue, 20 Jun 2023 19:10:44 +0900 Subject: [PATCH] ASoC: SOC: Fix fmt with dai naming Kernel v6.y does not support the legacy_dai_naming format, so there is a problem that i2s does not work due to dai_name. Fix that issue. Change-Id: I9aae5c683b4b5d803c12959ca2994e8cc3e6c577 Signed-off-by: Hoegeun Kwon --- sound/soc/starfive/starfive_i2s.c | 11 ++++++----- sound/soc/starfive/starfive_pwmdac_transmitter.c | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/starfive/starfive_i2s.c b/sound/soc/starfive/starfive_i2s.c index 8a1ccfe0e8cf..e1f236a78d22 100644 --- a/sound/soc/starfive/starfive_i2s.c +++ b/sound/soc/starfive/starfive_i2s.c @@ -391,21 +391,21 @@ static int dw_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(cpu_dai); int ret = 0; - switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBM_CFM: + switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_BC_FC: if (dev->capability & DW_I2S_SLAVE) ret = 0; else ret = -EINVAL; break; - case SND_SOC_DAIFMT_CBS_CFS: + case SND_SOC_DAIFMT_BP_FP: if (dev->capability & DW_I2S_MASTER) ret = 0; else ret = -EINVAL; break; - case SND_SOC_DAIFMT_CBM_CFS: - case SND_SOC_DAIFMT_CBS_CFM: + case SND_SOC_DAIFMT_BC_FP: + case SND_SOC_DAIFMT_BP_FC: ret = -EINVAL; break; default: @@ -413,6 +413,7 @@ static int dw_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) ret = -EINVAL; break; } + return ret; } diff --git a/sound/soc/starfive/starfive_pwmdac_transmitter.c b/sound/soc/starfive/starfive_pwmdac_transmitter.c index c580800dd597..74373dd90088 100755 --- a/sound/soc/starfive/starfive_pwmdac_transmitter.c +++ b/sound/soc/starfive/starfive_pwmdac_transmitter.c @@ -52,7 +52,6 @@ static struct snd_soc_component_driver soc_codec_pwmdac_dit = { .idle_bias_on = 1, .use_pmdown_time = 1, .endianness = 1, - .legacy_dai_naming = 1, }; static struct snd_soc_dai_driver dit_stub_dai = { -- 2.34.1