[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231021145110.478744-8-Syed.SabaKareem@amd.com>
Date: Sat, 21 Oct 2023 20:20:49 +0530
From: Syed Saba Kareem <Syed.SabaKareem@....com>
To: <broonie@...nel.org>, <alsa-devel@...a-project.org>
CC: <Vijendar.Mukunda@....com>, <Basavaraj.Hiregoudar@....com>,
<Sunil-kumar.Dommati@....com>, <mario.limonciello@....com>,
<venkataprasad.potturu@....com>, <arungopal.kondaveeti@....com>,
<mastan.katragadda@....com>, <juan.martinez@....com>,
Syed Saba Kareem <Syed.SabaKareem@....com>,
Liam Girdwood <lgirdwood@...il.com>,
"Jaroslav Kysela" <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Yang Li <yang.lee@...ux.alibaba.com>,
Dan Carpenter <dan.carpenter@...aro.org>,
open list <linux-kernel@...r.kernel.org>
Subject: [PATCH 08/13] ASoC: amd: acp: add condition check for i2s clock generation
for only PDM endpoint i2s master clock is not required.
Add a condition check for the same based on chip flag value.
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@....com>
---
sound/soc/amd/acp/acp-rembrandt.c | 12 ++++++++++--
sound/soc/amd/acp/acp63.c | 12 ++++++++----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index ef5fe6438efd..158f819f8da4 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -191,6 +191,7 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
struct acp_chip_info *chip;
struct acp_dev_data *adata;
struct resource *res;
+ u32 ret;
chip = dev_get_platdata(&pdev->dev);
if (!chip || !chip->base) {
@@ -234,7 +235,12 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
acp_machine_select(adata);
dev_set_drvdata(dev, adata);
- acp6x_master_clock_generate(dev);
+
+ if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) {
+ ret = acp6x_master_clock_generate(dev);
+ if (ret)
+ return ret;
+ }
acp_enable_interrupts(adata);
acp_platform_register(dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
@@ -263,7 +269,9 @@ static int __maybe_unused rmb_pcm_resume(struct device *dev)
snd_pcm_uframes_t buf_in_frames;
u64 buf_size;
- acp6x_master_clock_generate(dev);
+ if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC)
+ acp6x_master_clock_generate(dev);
+
spin_lock(&adata->acp_lock);
list_for_each_entry(stream, &adata->stream_list, list) {
substream = stream->substream;
diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c
index 0cec6ecaadfa..b871a216a6af 100644
--- a/sound/soc/amd/acp/acp63.c
+++ b/sound/soc/amd/acp/acp63.c
@@ -244,10 +244,12 @@ static int acp63_audio_probe(struct platform_device *pdev)
adata->machines = snd_soc_acpi_amd_acp63_acp_machines;
acp_machine_select(adata);
dev_set_drvdata(dev, adata);
- ret = acp63_i2s_master_clock_generate(adata);
- if (ret)
- return ret;
+ if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) {
+ ret = acp63_i2s_master_clock_generate(adata);
+ if (ret)
+ return ret;
+ }
acp_enable_interrupts(adata);
acp_platform_register(dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
@@ -276,7 +278,9 @@ static int __maybe_unused acp63_pcm_resume(struct device *dev)
snd_pcm_uframes_t buf_in_frames;
u64 buf_size;
- acp63_i2s_master_clock_generate(adata);
+ if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC)
+ acp63_i2s_master_clock_generate(adata);
+
spin_lock(&adata->acp_lock);
list_for_each_entry(stream, &adata->stream_list, list) {
if (stream) {
--
2.25.1
Powered by blists - more mailing lists