Skip to content
Commit 54d39490 authored by Javier Carrasco's avatar Javier Carrasco Committed by Jonathan Cameron
Browse files

iio: adc: ti-ads1119: fix sample size in scan struct for triggered buffer



This device returns signed, 16-bit samples as stated in its datasheet
(see 8.5.2 Data Format). That is in line with the scan_type definition
for the IIO_VOLTAGE channel, but 'unsigned int' is being used to read
and push the data to userspace.

Given that the size of that type depends on the architecture (at least
2 bytes to store values up to 65535, but its actual size is often 4
bytes), use the 's16' type to provide the same structure in all cases.

Fixes: a9306887 ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: default avatarJavier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20241202-ti-ads1119_s16_chan-v1-1-fafe3136dc90@gmail.com


Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2f43d520
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment