ASoC: rsnd: SSI PIO adjust to 24bit mode

commit 90431eb49b ("ASoC: rsnd: don't use PDTA bit for 24bit on SSI")
fixups 24bit mode data alignment, but PIO was not cared.
This patch fixes PIO mode 24bit data alignment

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2017-05-24 01:17:10 +00:00 committed by Mark Brown
parent 1f8754d4da
commit 7819a942de
1 changed files with 9 additions and 2 deletions

View File

@ -550,6 +550,13 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
u32 *buf = (u32 *)(runtime->dma_area + u32 *buf = (u32 *)(runtime->dma_area +
rsnd_dai_pointer_offset(io, 0)); rsnd_dai_pointer_offset(io, 0));
int shift = 0;
switch (runtime->sample_bits) {
case 32:
shift = 8;
break;
}
/* /*
* 8/16/32 data can be assesse to TDR/RDR register * 8/16/32 data can be assesse to TDR/RDR register
@ -557,9 +564,9 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
* see rsnd_ssi_init() * see rsnd_ssi_init()
*/ */
if (rsnd_io_is_play(io)) if (rsnd_io_is_play(io))
rsnd_mod_write(mod, SSITDR, *buf); rsnd_mod_write(mod, SSITDR, (*buf) << shift);
else else
*buf = rsnd_mod_read(mod, SSIRDR); *buf = (rsnd_mod_read(mod, SSIRDR) >> shift);
elapsed = rsnd_dai_pointer_update(io, sizeof(*buf)); elapsed = rsnd_dai_pointer_update(io, sizeof(*buf));
} }