]> www.infradead.org Git - users/dwmw2/linux.git/commit
iio: adc: stm32-dfsdm: fix data type
authorOlivier Moysan <olivier.moysan@st.com>
Wed, 19 Jun 2019 13:03:48 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:11:07 +0000 (09:11 +0200)
commit63e3de7299ba44f879eb2fc3e17b4e246f1e3756
tree2c2dcc3c8eedabf0255a0dd1cc50da8cfbf40ab6
parentbb9dee6edb5a70e70144e076c3193d14ca181337
iio: adc: stm32-dfsdm: fix data type

commit c6013bf50e2a2a94ab3d012e191096432aa50c6f upstream.

Fix the data type as DFSDM raw output is complements 2,
24bits left aligned in a 32-bit register.
This change does not affect AUDIO path
- Set data as signed for IIO (as for AUDIO)
- Set 8 bit right shift for IIO.
The 8 LSBs bits of data contains channel info and are masked.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Fixes: e2e6771c6462 ("IIO: ADC: add STM32 DFSDM sigma delta ADC support")
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/stm32-dfsdm-adc.c