Commit 16fb2a25 authored by Syed Saba Kareem's avatar Syed Saba Kareem Committed by Mark Brown

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: default avatarSyed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20231021145110.478744-8-Syed.SabaKareem@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 57e85777
......@@ -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;
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;
......
......@@ -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);
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;
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment