Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
ASoC: rockchip: i2s-tdm: Workaround for Skyworth 8K TVs' Playback
Browse files Browse the repository at this point in the history
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 <sugar.zhang@rock-chips.com>
Change-Id: I56f97d7246cf790ea33a7410eff418baeeecc6d0
  • Loading branch information
Sugar Zhang authored and rkhuangtao committed Sep 29, 2022
1 parent bc8ef86 commit f3fe5ad
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions sound/soc/rockchip/rockchip_i2s_tdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit f3fe5ad

Please sign in to comment.