From f3fe5ad04b2ac54658fa9933b8e31bca5591b5ef Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 20 Sep 2022 15:37:04 +0800 Subject: [PATCH] ASoC: rockchip: i2s-tdm: Workaround for Skyworth 8K TVs' Playback Bring back CLK ASAP after cfg changed to make SINK devices active on HDMI-PATH-ALWAYS-ON situation, this workaround for some TVs no sound issue. at the moment, it's 8K@60Hz display situation. On HDMI-PATH-ALWAYS-ON situation, we almost keep XFER always on, so, for new data start, suggested to STOP-CLEAR-START to make sure data aligned. Signed-off-by: Sugar Zhang Change-Id: I56f97d7246cf790ea33a7410eff418baeeecc6d0 --- sound/soc/rockchip/rockchip_i2s_tdm.c | 32 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 20c8a4e9c3bc..19691b6d5a39 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -591,6 +591,17 @@ static void rockchip_i2s_tdm_trcm_resume(struct snd_pcm_substream *substream, static void rockchip_i2s_tdm_start(struct rk_i2s_tdm_dev *i2s_tdm, int stream) { + /* + * On HDMI-PATH-ALWAYS-ON situation, we almost keep XFER always on, + * so, for new data start, suggested to STOP-CLEAR-START to make sure + * data aligned. + */ + if ((i2s_tdm->quirks & QUIRK_HDMI_PATH) && + (i2s_tdm->quirks & QUIRK_ALWAYS_ON) && + (stream == SNDRV_PCM_STREAM_PLAYBACK)) { + rockchip_i2s_tdm_xfer_stop(i2s_tdm, stream, true); + } + rockchip_i2s_tdm_dma_ctrl(i2s_tdm, stream, 1); if (i2s_tdm->clk_trcm) @@ -1127,6 +1138,17 @@ static int rockchip_i2s_tdm_params(struct snd_pcm_substream *substream, fmt); } + /* + * Bring back CLK ASAP after cfg changed to make SINK devices active + * on HDMI-PATH-ALWAYS-ON situation, this workaround for some TVs no + * sound issue. at the moment, it's 8K@60Hz display situation. + */ + if ((i2s_tdm->quirks & QUIRK_HDMI_PATH) && + (i2s_tdm->quirks & QUIRK_ALWAYS_ON) && + (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) { + rockchip_i2s_tdm_xfer_start(i2s_tdm, SNDRV_PCM_STREAM_PLAYBACK); + } + return 0; } @@ -1498,16 +1520,6 @@ static int rockchip_i2s_tdm_startup(struct snd_pcm_substream *substream, i2s_tdm->substreams[substream->stream] = substream; - /* - * Suggested to stop audio source before HDMI configure to make - * sure audio data integrity on HDMI-PATH-ALWAYS-ON situation. - */ - if ((i2s_tdm->quirks & QUIRK_HDMI_PATH) && - (i2s_tdm->quirks & QUIRK_ALWAYS_ON) && - (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) { - rockchip_i2s_tdm_xfer_stop(i2s_tdm, substream->stream, true); - } - return 0; }