]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: stm32: fix scan of multiple channels with DMA
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 5 Jan 2018 14:34:54 +0000 (15:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:43 +0000 (16:03 +0100)
commitcae8339cac4738f930d8e513f4c781e25b33c772
tree35ef884e23cf0e04478e2b3885d9a72a626d4632
parent3c88a5513b9857d326a78d372ed9f1f2142dfcdc
iio: adc: stm32: fix scan of multiple channels with DMA

By default, watermark is set to '1'. Watermark is used to fine tune
cyclic dma buffer period. In case watermark is left untouched (e.g. 1)
and several channels are being scanned, buffer period is wrongly set
(e.g. to 1 sample). As a consequence, data is never pushed to upper layer.
Fix buffer period size, by taking scan channels number into account.

Fixes: 7b68baad3a96 ("iio: adc: stm32: add optional dma support")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/stm32-adc.c