From cd5e4efde23ad8050921672ed777ec3f7aa310ec Mon Sep 17 00:00:00 2001 From: Trevor Wu Date: Tue, 31 Aug 2021 10:13:03 +0800 Subject: ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency randconfig builds show the warning below, WARNING: unmet direct dependencies detected for SND_SOC_MT6359 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MTK_PMIC_WRAP [=n] Selected by [y]: - SND_SOC_MT8195_MT6359_RT1019_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y] Add a dependency to avoid it. Signed-off-by: Trevor Wu Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20210831021303.5230-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown --- sound/soc/mediatek/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index cf567a89f421..f6bf0f9c91e3 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -197,7 +197,7 @@ config SND_SOC_MT8195 config SND_SOC_MT8195_MT6359_RT1019_RT5682 tristate "ASoC Audio driver for MT8195 with MT6359 RT1019 RT5682 codec" depends on I2C - depends on SND_SOC_MT8195 + depends on SND_SOC_MT8195 && MTK_PMIC_WRAP select SND_SOC_MT6359 select SND_SOC_RT1015P select SND_SOC_RT5682_I2C -- cgit v1.2.3 From 5f939f49771002f347039edf984aca42f30fc31a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 30 Aug 2021 09:44:44 +0900 Subject: ASoC: audio-graph: respawn Platform Support commit 63f2f9cceb09f8 ("ASoC: audio-graph: remove Platform support") removed Platform support from audio-graph, because it doesn't have "plat" support on DT (simple-card has). But, Platform support is needed if user is using snd_dmaengine_pcm_register() which adds generic DMA as Platform. And this Platform dev is using CPU dev. Without this patch, at least STM32MP15 audio sound card is no more functional (v5.13 or later). This patch respawn Platform Support on audio-graph again. Reported-by: Olivier MOYSAN Signed-off-by: Kuninori Morimoto Tested-by: Olivier MOYSAN Link: https://lore.kernel.org/r/878s0jzrpf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/generic/audio-graph-card.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 5e71382467e8..546f6fd0609e 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -285,6 +285,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, if (li->cpu) { struct snd_soc_card *card = simple_priv_to_card(priv); struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); int is_single_links = 0; /* Codec is dummy */ @@ -313,6 +314,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, dai_link->no_pcm = 1; asoc_simple_canonicalize_cpu(cpus, is_single_links); + asoc_simple_canonicalize_platform(platforms, cpus); } else { struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0); struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); @@ -366,6 +368,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); char dai_name[64]; int ret, is_single_links = 0; @@ -383,6 +386,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, "%s-%s", cpus->dai_name, codecs->dai_name); asoc_simple_canonicalize_cpu(cpus, is_single_links); + asoc_simple_canonicalize_platform(platforms, cpus); ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name); if (ret < 0) @@ -608,6 +612,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv, li->num[li->link].cpus = 1; li->num[li->link].codecs = 1; + li->num[li->link].platforms = 1; li->link += 1; /* 1xCPU-Codec */ @@ -630,6 +635,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv, if (li->cpu) { li->num[li->link].cpus = 1; + li->num[li->link].platforms = 1; li->link++; /* 1xCPU-dummy */ } else { -- cgit v1.2.3 From 2a6a0a03117ee349308ab77ac0925fdca8ef32f5 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 27 Aug 2021 19:50:03 +0100 Subject: ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device" There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210827185003.507006-1-colin.king@canonical.com Signed-off-by: Mark Brown --- sound/soc/samsung/s3c24xx_simtec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c index 81a29d12c57d..0cc66774b85d 100644 --- a/sound/soc/samsung/s3c24xx_simtec.c +++ b/sound/soc/samsung/s3c24xx_simtec.c @@ -327,7 +327,7 @@ int simtec_audio_core_probe(struct platform_device *pdev, snd_dev = platform_device_alloc("soc-audio", -1); if (!snd_dev) { - dev_err(&pdev->dev, "failed to alloc soc-audio devicec\n"); + dev_err(&pdev->dev, "failed to alloc soc-audio device\n"); ret = -ENOMEM; goto err_gpio; } -- cgit v1.2.3 From 940ffa19454704ca2ecd23b0d8dd604c93421bfa Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 31 Aug 2021 15:18:54 +0200 Subject: ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK The Mediatek MT8195 sound hardware is only present on Mediatek MT8195 SoCs. Hence add a dependency on ARCH_MEDIATEK, to prevent asking the user about this driver when configuring a kernel without Mediatek SoC support. Fixes: 6746cc858259985a ("ASoC: mediatek: mt8195: add platform driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7e628e359bde04ceb9ddd74a45931059b4a4623c.1630415860.git.geert+renesas@glider.be Signed-off-by: Mark Brown --- sound/soc/mediatek/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/soc') diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index f6bf0f9c91e3..5a2f4667d50b 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -187,6 +187,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682 config SND_SOC_MT8195 tristate "ASoC support for Mediatek MT8195 chip" + depends on ARCH_MEDIATEK || COMPILE_TEST select SND_SOC_MEDIATEK help This adds ASoC platform driver support for Mediatek MT8195 chip -- cgit v1.2.3 From 0866d645b76d062b7d55091fd6fb80f058d0c384 Mon Sep 17 00:00:00 2001 From: Shuming Fan Date: Wed, 1 Sep 2021 18:07:54 +0800 Subject: ASoC: rt5682: fix headset background noise when S3 state Remove CBJ power off setting to avoid floating state. Signed-off-by: Jack Yu Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20210901100754.21045-1-shumingf@realtek.com Signed-off-by: Mark Brown --- sound/soc/codecs/rt5682.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index e822fa1b9d4b..4a64cab99c55 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -2942,9 +2942,6 @@ static int rt5682_suspend(struct snd_soc_component *component) break; } - snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3, - RT5682_PWR_CBJ, 0); - /* enter SAR ADC power saving mode */ snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1, RT5682_SAR_BUTT_DET_MASK | RT5682_SAR_BUTDET_MODE_MASK | -- cgit v1.2.3 From b3dded7e2f98e2672deb9606514c0e13e3094640 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 2 Sep 2021 11:12:18 -0700 Subject: ASoC: Intel: boards: Fix CONFIG_SND_SOC_SDW_MOCKUP select When CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH is enabled without CONFIG_EXPERT, there is a Kconfig warning about unmet dependencies: WARNING: unmet direct dependencies detected for SND_SOC_SDW_MOCKUP Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && EXPERT [=n] && SOUNDWIRE [=y] Selected by [y]: - SND_SOC_INTEL_SOUNDWIRE_SOF_MACH [=y] && ... Selecting a symbol does not account for dependencies. There are three ways to resolve this: 1. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select CONFIG_SND_SOC_SDW_MOCKUP only if CONFIG_EXPERT is set. 2. Make CONFIG_SND_SOC_SDW_MOCKUP's prompt depend on CONFIG_EXPERT so that it can be selected by options that only depend on CONFIG_SOUNDWIRE but still appear as a prompt to the user when CONFIG_EXPERT is set. 3. Make CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH imply CONFIG_SND_SOC_SDW_MOCKUP, which will select CONFIG_SND_SOC_SDW_MOCKUP when its dependencies are enabled but still allow the user to disable it. Go with the third option as it gives the most flexibility while retaining the original intent of the select. Fixes: 0ccac3bcf356 ("ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests") Suggested-by: Pierre-Louis Bossart Acked-by: Pierre-Louis Bossart Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20210902181217.2958966-1-nathan@kernel.org Signed-off-by: Mark Brown --- sound/soc/intel/boards/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 046955bf717c..61b71d6c44cf 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -602,7 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_DMIC select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON - select SND_SOC_SDW_MOCKUP + imply SND_SOC_SDW_MOCKUP help Add support for Intel SoundWire-based platforms connected to MAX98373, RT700, RT711, RT1308 and RT715 -- cgit v1.2.3 From 7eac1e24fbf6c56c9e3be302748ae73104bb40bd Mon Sep 17 00:00:00 2001 From: Trevor Wu Date: Fri, 3 Sep 2021 14:00:49 +0800 Subject: ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX According to the description in dt-bindings, phandle assignment of HDMI TX and DP TX are not required properties, but driver regards them as required properties. In real use case, it's expected that DP TX and HDMI TX are optional features, so correct the behavior in driver. Fixes: 40d605df0a7b ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682") Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20210903060049.20764-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown --- .../mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c b/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c index 5dc217f59bd6..c97ace7387b4 100644 --- a/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c +++ b/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c @@ -1018,13 +1018,12 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev) of_parse_phandle(pdev->dev.of_node, "mediatek,dptx-codec", 0); if (!dai_link->codecs->of_node) { - dev_err(&pdev->dev, "Property 'dptx-codec' missing or invalid\n"); - return -EINVAL; + dev_dbg(&pdev->dev, "No property 'dptx-codec'\n"); + } else { + dai_link->codecs->name = NULL; + dai_link->codecs->dai_name = "i2s-hifi"; + dai_link->init = mt8195_dptx_codec_init; } - - dai_link->codecs->name = NULL; - dai_link->codecs->dai_name = "i2s-hifi"; - dai_link->init = mt8195_dptx_codec_init; } if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) { @@ -1032,13 +1031,12 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev) of_parse_phandle(pdev->dev.of_node, "mediatek,hdmi-codec", 0); if (!dai_link->codecs->of_node) { - dev_err(&pdev->dev, "Property 'hdmi-codec' missing or invalid\n"); - return -EINVAL; + dev_dbg(&pdev->dev, "No property 'hdmi-codec'\n"); + } else { + dai_link->codecs->name = NULL; + dai_link->codecs->dai_name = "i2s-hifi"; + dai_link->init = mt8195_hdmi_codec_init; } - - dai_link->codecs->name = NULL; - dai_link->codecs->dai_name = "i2s-hifi"; - dai_link->init = mt8195_hdmi_codec_init; } } -- cgit v1.2.3 From fcb958ee8e832e9cdf43408535207e15f14af755 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Fri, 3 Sep 2021 21:07:14 +0800 Subject: ASoC: rockchip: i2s: Fix concurrency between tx/rx This patch adds lock to fix comcurrency between tx/rx to fix 'rockchip-i2s ff070000.i2s; fail to clear' Considering the situation; tx stream rx stream | | | disable enable | | reset After this patch: lock | tx stream | enable | unlock -------- --------- lock | rx stream | disable | reset | unlock Signed-off-by: Sugar Zhang Link: https://lore.kernel.org/r/1630674434-650-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Mark Brown --- sound/soc/rockchip/rockchip_i2s.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index 53e0b4a1c7d2..7e89f5b0c237 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,7 @@ struct rk_i2s_dev { bool is_master_mode; const struct rk_i2s_pins *pins; unsigned int bclk_ratio; + spinlock_t lock; /* tx/rx lock */ }; static int i2s_runtime_suspend(struct device *dev) @@ -96,6 +98,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) unsigned int val = 0; int retry = 10; + spin_lock(&i2s->lock); if (on) { regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_ENABLE); @@ -136,6 +139,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on) } } } + spin_unlock(&i2s->lock); } static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) @@ -143,6 +147,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) unsigned int val = 0; int retry = 10; + spin_lock(&i2s->lock); if (on) { regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_ENABLE); @@ -183,6 +188,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on) } } } + spin_unlock(&i2s->lock); } static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai, @@ -684,6 +690,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev) if (!i2s) return -ENOMEM; + spin_lock_init(&i2s->lock); i2s->dev = &pdev->dev; i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf"); -- cgit v1.2.3