Skip to content

Commit

Permalink
ASoC: rockchip: spdif: Set transmit data level to 16 samples
Browse files Browse the repository at this point in the history
Explicitly set the transmit data level on the transceiver to 16 samples
rather then the default 0. This matches both the level set in the vendor
kernel and the (seemingly very similar) i2s engine. This fixes audio
glitches when playing back at 192k rate.

At the same time, fix a trivial typo in the TDL mask definition

Signed-off-by: Sjoerd Simons <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
sjoerdsimons authored and broonie committed Dec 12, 2015
1 parent 8005c49 commit 5042f93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions sound/soc/rockchip/rockchip_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ static int rk_spdif_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
ret = regmap_update_bits(spdif->regmap, SPDIF_DMACR,
SPDIF_DMACR_TDE_ENABLE,
SPDIF_DMACR_TDE_ENABLE);
SPDIF_DMACR_TDE_ENABLE |
SPDIF_DMACR_TDL_MASK,
SPDIF_DMACR_TDE_ENABLE |
SPDIF_DMACR_TDL(16));

if (ret != 0)
return ret;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/rockchip/rockchip_spdif.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#define SPDIF_DMACR_TDL_SHIFT 0
#define SPDIF_DMACR_TDL(x) ((x) << SPDIF_DMACR_TDL_SHIFT)
#define SPDIF_DMACR_TDL_MASK (0x1f << SDPIF_DMACR_TDL_SHIFT)
#define SPDIF_DMACR_TDL_MASK (0x1f << SPDIF_DMACR_TDL_SHIFT)

/*
* XFER
Expand Down

0 comments on commit 5042f93

Please sign in to comment.