diff mbox series

[1/9] ASoC: amd: vg: fix for pm resume callback sequence

Message ID 20220223071959.13539-1-Vijendar.Mukunda@amd.com
State Superseded
Headers show
Series [1/9] ASoC: amd: vg: fix for pm resume callback sequence | expand

Commit Message

Vijendar Mukunda Feb. 23, 2022, 7:19 a.m. UTC
The previous condition is used to cross check only the active
stream status for I2S HS instance playback and capture use cases.

Modified logic to invoke sequence for two i2s controller instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/vangogh/acp5x-pcm-dma.c | 62 ++++++++++++++-------------
 1 file changed, 32 insertions(+), 30 deletions(-)

Comments

Vijendar Mukunda Feb. 25, 2022, 6:32 p.m. UTC | #1
On 2/24/22 5:52 PM, Mark Brown wrote:
> On Wed, 23 Feb 2022 12:49:30 +0530, Vijendar Mukunda wrote:
>> The previous condition is used to cross check only the active
>> stream status for I2S HS instance playback and capture use cases.
>>
>> Modified logic to invoke sequence for two i2s controller instances.
>>
>>
> 
> Applied to
> 
>    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fbroonie%2Fsound.git&amp;data=04%7C01%7CVijendar.Mukunda%40amd.com%7C3a19f223da704ef29da308d9f7904df5%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637813021442156506%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=EfbRAjgpLmD0cuSsnfJVtdRIP1OqVPh3pxcTD6AKx6c%3D&amp;reserved=0 for-linus
> 
> Thanks!
> 
> [1/9] ASoC: amd: vg: fix for pm resume callback sequence
>       (no commit info)
This patch hasn't been applied to tree.
Should I re-send the patch ?

--
Vijendar
> [2/9] ASoC: amd: vangogh: refactor i2s master mode clock sequence code
>       commit: 5ca4cf2c83dac27768f1d7d3e2404f5a17830ca5
> [3/9] ASoC: nau8821: enable no_capture_mute flag
>       commit: aa9753a4677d0a2c53e7e46ca173c985a3f7b83e
> [4/9] ASoC: amd: vg: update platform clock control sequence
>       commit: 9a617f0e109cfba2017d76f807ebb3a00c47bdca
> [5/9] ASoC: amd: vg: apply sample bits pcm constraint
>       commit: 0c38cc1dd17e766eada0aa44be4c1a47bcbb7bc3
> [6/9] ASoC: amd: vg: update acp init and deinit sequence
>       commit: a9230ccc0c6f5fca0b94f57729dc61e0a6098a0a
> 
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
Mark Brown Feb. 25, 2022, 7:03 p.m. UTC | #2
On Sat, Feb 26, 2022 at 12:02:53AM +0530, Mukunda,Vijendar wrote:
> On 2/24/22 5:52 PM, Mark Brown wrote:

> > [1/9] ASoC: amd: vg: fix for pm resume callback sequence
> >       (no commit info)

> This patch hasn't been applied to tree.
> Should I re-send the patch ?

There were some issues reported by 0day that should be fixed but yes,
please resend with those fixed.
diff mbox series

Patch

diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
index f10de38976cb..17853d8d56d3 100644
--- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c
+++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
@@ -426,6 +426,7 @@  static int acp5x_audio_remove(struct platform_device *pdev)
 static int __maybe_unused acp5x_pcm_resume(struct device *dev)
 {
 	struct i2s_dev_data *adata;
+	struct i2s_stream_instance *rtd;
 	u32 val, reg_val, frmt_val;
 
 	reg_val = 0;
@@ -433,44 +434,45 @@  static int __maybe_unused acp5x_pcm_resume(struct device *dev)
 	adata = dev_get_drvdata(dev);
 
 	if (adata->play_stream && adata->play_stream->runtime) {
-		struct i2s_stream_instance *rtd =
-			adata->play_stream->runtime->private_data;
+		rtd = adata->play_stream->runtime->private_data;
 		config_acp5x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK);
-		switch (rtd->i2s_instance) {
-		case I2S_HS_INSTANCE:
-			reg_val = ACP_HSTDM_ITER;
-			frmt_val = ACP_HSTDM_TXFRMT;
-			break;
-		case I2S_SP_INSTANCE:
-		default:
-			reg_val = ACP_I2STDM_ITER;
-			frmt_val = ACP_I2STDM_TXFRMT;
+		acp_writel((rtd->xfer_resolution  << 3), rtd->acp5x_base + ACP_HSTDM_ITER);
+		if (adata->tdm_mode == TDM_ENABLE) {
+			acp_writel(adata->tdm_fmt, adata->acp5x_base + ACP_HSTDM_TXFRMT);
+			val = acp_readl(adata->acp5x_base + ACP_HSTDM_ITER);
+			acp_writel(val | 0x2, adata->acp5x_base + ACP_HSTDM_ITER);
+		}
+	}
+	if (adata->i2ssp_play_stream && adata->i2ssp_play_stream->runtime) {
+		rtd = adata->i2ssp_play_stream->runtime->private_data;
+		config_acp5x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK);
+		acp_writel((rtd->xfer_resolution  << 3), rtd->acp5x_base + ACP_I2STDM_ITER);
+		if (adata->tdm_mode == TDM_ENABLE) {
+			acp_writel(adata->tdm_fmt, adata->acp5x_base + ACP_I2STDM_TXFRMT);
+			val = acp_readl(adata->acp5x_base + ACP_I2STDM_ITER);
+			acp_writel(val | 0x2, adata->acp5x_base + ACP_I2STDM_ITER);
 		}
-		acp_writel((rtd->xfer_resolution  << 3),
-			   rtd->acp5x_base + reg_val);
 	}
 
 	if (adata->capture_stream && adata->capture_stream->runtime) {
-		struct i2s_stream_instance *rtd =
-			adata->capture_stream->runtime->private_data;
+		rtd = adata->capture_stream->runtime->private_data;
 		config_acp5x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE);
-		switch (rtd->i2s_instance) {
-		case I2S_HS_INSTANCE:
-			reg_val = ACP_HSTDM_IRER;
-			frmt_val = ACP_HSTDM_RXFRMT;
-			break;
-		case I2S_SP_INSTANCE:
-		default:
-			reg_val = ACP_I2STDM_IRER;
-			frmt_val = ACP_I2STDM_RXFRMT;
+		acp_writel((rtd->xfer_resolution  << 3), rtd->acp5x_base + ACP_HSTDM_IRER);
+		if (adata->tdm_mode == TDM_ENABLE) {
+			acp_writel(adata->tdm_fmt, adata->acp5x_base + ACP_HSTDM_RXFRMT);
+			val = acp_readl(adata->acp5x_base + ACP_HSTDM_IRER);
+			acp_writel(val | 0x2, adata->acp5x_base + ACP_HSTDM_IRER);
 		}
-		acp_writel((rtd->xfer_resolution  << 3),
-			   rtd->acp5x_base + reg_val);
 	}
-	if (adata->tdm_mode == TDM_ENABLE) {
-		acp_writel(adata->tdm_fmt, adata->acp5x_base + frmt_val);
-		val = acp_readl(adata->acp5x_base + reg_val);
-		acp_writel(val | 0x2, adata->acp5x_base + reg_val);
+	if (adata->i2ssp_capture_stream && adata->i2ssp_capture_stream->runtime) {
+		rtd = adata->i2ssp_capture_stream->runtime->private_data;
+		config_acp5x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE);
+		acp_writel((rtd->xfer_resolution  << 3), rtd->acp5x_base + ACP_I2STDM_IRER);
+		if (adata->tdm_mode == TDM_ENABLE) {
+			acp_writel(adata->tdm_fmt, adata->acp5x_base + ACP_I2STDM_RXFRMT);
+			val = acp_readl(adata->acp5x_base + ACP_I2STDM_IRER);
+			acp_writel(val | 0x2, adata->acp5x_base + ACP_I2STDM_IRER);
+		}
 	}
 	acp_writel(1, adata->acp5x_base + ACP_EXTERNAL_INTR_ENB);
 	return 0;