Skip to content

Commit 198c93e

Browse files
vijendarmukundabroonie
authored andcommitted
ASoC: amd: ps: add acp_reset flag check in acp pci driver pm ops.
AMD SoundWire manager supports different power modes. acp_reset flag will be set to false only when SoundWire manager power mode is selected as ClockStop Mode. For rest of the combinations (ACP PDM + SDW), acp_reset flag will be set to true. When acp_reset flag is set, acp de-init and acp init sequence should be invoked during suspend/resume callbacks. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20230612095903.2113464-10-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6e8f7cb commit 198c93e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

sound/soc/amd/ps/pci-ps.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,24 +669,28 @@ static int snd_acp63_probe(struct pci_dev *pci,
669669
static int __maybe_unused snd_acp63_suspend(struct device *dev)
670670
{
671671
struct acp63_dev_data *adata;
672-
int ret;
672+
int ret = 0;
673673

674674
adata = dev_get_drvdata(dev);
675-
ret = acp63_deinit(adata->acp63_base, dev);
676-
if (ret)
677-
dev_err(dev, "ACP de-init failed\n");
675+
if (adata->acp_reset) {
676+
ret = acp63_deinit(adata->acp63_base, dev);
677+
if (ret)
678+
dev_err(dev, "ACP de-init failed\n");
679+
}
678680
return ret;
679681
}
680682

681683
static int __maybe_unused snd_acp63_resume(struct device *dev)
682684
{
683685
struct acp63_dev_data *adata;
684-
int ret;
686+
int ret = 0;
685687

686688
adata = dev_get_drvdata(dev);
687-
ret = acp63_init(adata->acp63_base, dev);
688-
if (ret)
689-
dev_err(dev, "ACP init failed\n");
689+
if (adata->acp_reset) {
690+
ret = acp63_init(adata->acp63_base, dev);
691+
if (ret)
692+
dev_err(dev, "ACP init failed\n");
693+
}
690694
return ret;
691695
}
692696

0 commit comments

Comments
 (0)