From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To: <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <venkataprasad.potturu@amd.com>,
<Basavaraj.Hiregoudar@amd.com>, <Sunil-kumar.Dommati@amd.com>,
"Vijendar Mukunda" <Vijendar.Mukunda@amd.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
"Syed Saba Kareem" <Syed.SabaKareem@amd.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
V Sujith Kumar Reddy <vsujithkumar.reddy@amd.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
"Yang Li" <yang.lee@linux.alibaba.com>,
"open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<linux-sound@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 6/8] ASoC: amd: acp: modify conditional check for programming i2s mclk
Date: Mon, 17 Jun 2024 12:58:39 +0530 [thread overview]
Message-ID: <20240617072844.871468-6-Vijendar.Mukunda@amd.com> (raw)
In-Reply-To: <20240617072844.871468-1-Vijendar.Mukunda@amd.com>
ACP provides different IO configurations(ACP PDM, I2S and SoundWire).
I2S mclk should be programmed only when I2S configuration is selected and
I2S controller is programmed as clock master.
Modify the conditional check for programming i2s mclk.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
sound/soc/amd/acp/acp-rembrandt.c | 5 +++--
sound/soc/amd/acp/acp63.c | 5 +++--
sound/soc/amd/acp/amd.h | 1 +
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/sound/soc/amd/acp/acp-rembrandt.c b/sound/soc/amd/acp/acp-rembrandt.c
index 953a793de9a3..e19981c7d65a 100644
--- a/sound/soc/amd/acp/acp-rembrandt.c
+++ b/sound/soc/amd/acp/acp-rembrandt.c
@@ -229,12 +229,13 @@ static int rembrandt_audio_probe(struct platform_device *pdev)
adata->rsrc = &rsrc;
adata->platform = REMBRANDT;
adata->flag = chip->flag;
+ adata->is_i2s_config = chip->is_i2s_config;
adata->machines = snd_soc_acpi_amd_rmb_acp_machines;
acp_machine_select(adata);
dev_set_drvdata(dev, adata);
- if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) {
+ if (chip->is_i2s_config && rsrc.soc_mclk) {
ret = acp6x_master_clock_generate(dev);
if (ret)
return ret;
@@ -267,7 +268,7 @@ static int __maybe_unused rmb_pcm_resume(struct device *dev)
snd_pcm_uframes_t buf_in_frames;
u64 buf_size;
- if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC)
+ if (adata->is_i2s_config && adata->rsrc->soc_mclk)
acp6x_master_clock_generate(dev);
spin_lock(&adata->acp_lock);
diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c
index f223311b6740..f340920b3289 100644
--- a/sound/soc/amd/acp/acp63.c
+++ b/sound/soc/amd/acp/acp63.c
@@ -239,11 +239,12 @@ static int acp63_audio_probe(struct platform_device *pdev)
adata->rsrc = &rsrc;
adata->platform = ACP63;
adata->flag = chip->flag;
+ adata->is_i2s_config = chip->is_i2s_config;
adata->machines = snd_soc_acpi_amd_acp63_acp_machines;
acp_machine_select(adata);
dev_set_drvdata(dev, adata);
- if (chip->flag != FLAG_AMD_LEGACY_ONLY_DMIC) {
+ if (chip->is_i2s_config && rsrc.soc_mclk) {
ret = acp63_i2s_master_clock_generate(adata);
if (ret)
return ret;
@@ -276,7 +277,7 @@ static int __maybe_unused acp63_pcm_resume(struct device *dev)
snd_pcm_uframes_t buf_in_frames;
u64 buf_size;
- if (adata->flag != FLAG_AMD_LEGACY_ONLY_DMIC)
+ if (adata->is_i2s_config && adata->rsrc->soc_mclk)
acp63_i2s_master_clock_generate(adata);
spin_lock(&adata->acp_lock);
diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
index cbf9ca26f3ee..87a4813783f9 100644
--- a/sound/soc/amd/acp/amd.h
+++ b/sound/soc/amd/acp/amd.h
@@ -173,6 +173,7 @@ struct acp_dev_data {
unsigned int i2s_irq;
bool tdm_mode;
+ bool is_i2s_config;
/* SOC specific dais */
struct snd_soc_dai_driver *dai_driver;
int num_dai;
--
2.34.1
next prev parent reply other threads:[~2024-06-17 7:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-17 7:28 [PATCH 1/8] ASoC: amd: acp: add a null check for chip_pdev structure Vijendar Mukunda
2024-06-17 7:28 ` [PATCH 2/8] ASoC: amd: acp: remove i2s configuration check in acp_i2s_probe() Vijendar Mukunda
2024-06-17 7:28 ` [PATCH 3/8] ASoC: amd: acp: move chip->flag variable assignment Vijendar Mukunda
2024-06-17 7:28 ` [PATCH 4/8] ASoC: amd: acp: remove acp_i2s_probe function Vijendar Mukunda
2024-06-17 7:28 ` [PATCH 5/8] ASoC: amd: acp: remove unused variables from acp_resource structure Vijendar Mukunda
2024-06-17 7:28 ` Vijendar Mukunda [this message]
2024-06-17 7:28 ` [PATCH 7/8] ASoC: amd: acp: move i2s clock generation sequence Vijendar Mukunda
2024-06-17 7:28 ` [PATCH 8/8] ASoC: amd: acp: add pcm constraints for buffer size and period size Vijendar Mukunda
2024-06-20 11:47 ` (subset) [PATCH 1/8] ASoC: amd: acp: add a null check for chip_pdev structure Mark Brown
2024-06-23 10:50 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240617072844.871468-6-Vijendar.Mukunda@amd.com \
--to=vijendar.mukunda@amd.com \
--cc=Basavaraj.Hiregoudar@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Syed.SabaKareem@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=venkataprasad.potturu@amd.com \
--cc=vsujithkumar.reddy@amd.com \
--cc=yang.lee@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox