mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
iio: adc: stm32-dfsdm: fix data type
commitc6013bf50eupstream. 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:e2e6771c64("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bb9dee6edb
commit
63e3de7299
@@ -1365,11 +1365,11 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
|
|||||||
BIT(IIO_CHAN_INFO_SAMP_FREQ);
|
BIT(IIO_CHAN_INFO_SAMP_FREQ);
|
||||||
|
|
||||||
if (adc->dev_data->type == DFSDM_AUDIO) {
|
if (adc->dev_data->type == DFSDM_AUDIO) {
|
||||||
ch->scan_type.sign = 's';
|
|
||||||
ch->ext_info = dfsdm_adc_audio_ext_info;
|
ch->ext_info = dfsdm_adc_audio_ext_info;
|
||||||
} else {
|
} else {
|
||||||
ch->scan_type.sign = 'u';
|
ch->scan_type.shift = 8;
|
||||||
}
|
}
|
||||||
|
ch->scan_type.sign = 's';
|
||||||
ch->scan_type.realbits = 24;
|
ch->scan_type.realbits = 24;
|
||||||
ch->scan_type.storagebits = 32;
|
ch->scan_type.storagebits = 32;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user