lkml.org 
[lkml]   [2020]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 06/13] iio: imu: inv_icm42600: add temperature sensor support
From
Date
On 6/8/20 10:42 PM, Jean-Baptiste Maneyrol wrote:
> + case IIO_CHAN_INFO_PROCESSED:
> + ret = iio_device_claim_direct_mode(indio_dev);
> + if (ret)
> + return ret;
> + ret = inv_icm42600_temp_read(st, &temp);
> + iio_device_release_direct_mode(indio_dev);
> + if (ret)
> + return ret;
> + *val = temp;
> + return IIO_VAL_INT;
> + case IIO_CHAN_INFO_SCALE:
> + *val = 483;
> + *val2 = 91787;
> + return IIO_VAL_INT_PLUS_MICRO;
> + case IIO_CHAN_INFO_OFFSET:
> + *val = 25000;
> + return IIO_VAL_INT;

If the data is returned processed there is no need to specify scale and
offset.

But since the transformation to turn the data into standard units is a
simple linear transform the preferred way to handle this is to return
RAW data and specify scale and offset.

\
 
 \ /
  Last update: 2020-06-14 17:11    [W:0.153 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site