ASoC: stm32: dfsdm: fix 16 bits record
authorOlivier Moysan <olivier.moysan@st.com>
Fri, 10 Jan 2020 13:11:31 +0000 (14:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:22:29 +0000 (08:22 +0100)
commit065f819dfab35278028e7e39f4c3472883588cac
treef3e0682a81b1a96034efc9da5c9535b411c3f6b3
parent24e9094d0673b4ef478561cd9e8bb94ade863b34
ASoC: stm32: dfsdm: fix 16 bits record

commit 8e55ea19125b65cffe42747359af99d545e85f2f upstream.

In stm32_afsdm_pcm_cb function, the transfer size is provided in bytes.
However, samples are copied as 16 bits words from iio buffer.
Divide by two the transfer size, to copy the right number of samples.

Fixes: 1e7f6e1c69f0 ("ASoC: stm32: dfsdm: add 16 bits audio record support")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200110131131.3191-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/stm/stm32_adfsdm.c