diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-12-11 05:24:23 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-12-11 15:05:02 +0300 |
commit | 41acc8ec04f32abb16e035ca1c9fe4d52819601e (patch) | |
tree | abb9041f3d7411bb31b92e7cc16a5eabe8803bdb /sound/soc/sh/rcar/ssi.c | |
parent | a914e44693d41ba43604afa8c435c98a6d2c7cb1 (diff) | |
download | linux-41acc8ec04f32abb16e035ca1c9fe4d52819601e.tar.xz |
ASoC: rsnd: don't use runtime->sample_bits
Current rsnd driver is judging 16bit/24bit data by using
runtime->sample_bits, but it is indicating physical size,
not format size. This is confusable code.
This patch uses snd_pcm_format_width() to be more correct code.
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/ssi.c')
-rw-r--r-- | sound/soc/sh/rcar/ssi.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index f21202429000..5a70fdc3c680 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -370,11 +370,11 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, if (rsnd_io_is_play(io)) cr_own |= TRMD; - switch (runtime->sample_bits) { + switch (snd_pcm_format_width(runtime->format)) { case 16: cr_own |= DWL_16; break; - case 32: + case 24: cr_own |= DWL_24; break; } @@ -677,11 +677,8 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, rsnd_ssi_pointer_offset(mod, io, 0)); int shift = 0; - switch (runtime->sample_bits) { - case 32: + if (snd_pcm_format_width(runtime->format) == 24) shift = 8; - break; - } /* * 8/16/32 data can be assesse to TDR/RDR register |