From: Lars-Peter Clausen <lars@metafoo.de>
To: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>,
jic23@kernel.org, robh+dt@kernel.org, robh@kernel.org,
mchehab+huawei@kernel.org, davem@davemloft.net,
gregkh@linuxfoundation.org
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 06/13] iio: imu: inv_icm42600: add temperature sensor support
Date: Sun, 14 Jun 2020 17:10:51 +0200 [thread overview]
Message-ID: <fd4918b6-a55f-4047-7f18-b796a8ccd020@metafoo.de> (raw)
In-Reply-To: <20200608204250.3291-7-jmaneyrol@invensense.com>
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.
next prev parent reply other threads:[~2020-06-14 15:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 20:42 [PATCH v3 00/13] iio: imu: new inv_icm42600 driver Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 01/13] iio: imu: inv_icm42600: add core of " Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 02/13] iio: imu: inv_icm42600: add I2C driver for " Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 03/13] iio: imu: inv_icm42600: add SPI " Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 04/13] iio: imu: inv_icm42600: add gyroscope IIO device Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 05/13] iio: imu: inv_icm42600: add accelerometer " Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 06/13] iio: imu: inv_icm42600: add temperature sensor support Jean-Baptiste Maneyrol
2020-06-14 15:10 ` Lars-Peter Clausen [this message]
2020-06-14 20:35 ` Jean-Baptiste Maneyrol
2020-06-20 15:57 ` Jonathan Cameron
2020-06-22 9:21 ` Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 07/13] iio: imu: add Kconfig and Makefile for inv_icm42600 driver Jean-Baptiste Maneyrol
2020-06-08 23:03 ` kernel test robot
2020-06-14 13:52 ` Jonathan Cameron
2020-06-08 20:42 ` [PATCH v3 08/13] Documentation: ABI: add specific icm42600 documentation Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 09/13] iio: imu: inv_icm42600: add device interrupt Jean-Baptiste Maneyrol
2020-06-08 20:42 ` [PATCH v3 10/13] iio: imu: inv_icm42600: add buffer support in iio devices Jean-Baptiste Maneyrol
2020-06-14 14:17 ` Jonathan Cameron
2020-06-08 20:42 ` [PATCH v3 11/13] iio: imu: inv_icm42600: add accurate timestamping Jean-Baptiste Maneyrol
2020-06-14 14:21 ` Jonathan Cameron
2020-06-08 20:42 ` [PATCH v3 12/13] dt-bindings: iio: imu: Add inv_icm42600 documentation Jean-Baptiste Maneyrol
2020-06-17 20:53 ` Rob Herring
2020-06-08 20:42 ` [PATCH v3 13/13] MAINTAINERS: add entry for inv_icm42600 6-axis imu sensor Jean-Baptiste Maneyrol
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd4918b6-a55f-4047-7f18-b796a8ccd020@metafoo.de \
--to=lars@metafoo.de \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=jmaneyrol@invensense.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).