From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Baluta <daniel.baluta@intel.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
lucas.demarchi@intel.com
Subject: Re: [PATCH v3 1/2] iio: pressure: ms5611: Add IIO_CHAN_INFO_SCALE to mask
Date: Sat, 6 Feb 2016 18:18:17 +0000 [thread overview]
Message-ID: <56B638E9.2030203@kernel.org> (raw)
In-Reply-To: <1454518238-7242-2-git-send-email-daniel.baluta@intel.com>
On 03/02/16 16:50, Daniel Baluta wrote:
> This allows data exported via buffer interface to be converted
> to standard units in userspace.
>
> Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Applied.
> ---
> drivers/iio/pressure/ms5611_core.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c
> index 2f3d9b4..6cf0e55 100644
> --- a/drivers/iio/pressure/ms5611_core.c
> +++ b/drivers/iio/pressure/ms5611_core.c
> @@ -201,6 +201,18 @@ static int ms5611_read_raw(struct iio_dev *indio_dev,
> default:
> return -EINVAL;
> }
> + case IIO_CHAN_INFO_SCALE:
> + switch (chan->type) {
> + case IIO_TEMP:
> + *val = 10;
> + return IIO_VAL_INT;
> + case IIO_PRESSURE:
> + *val = 0;
> + *val2 = 1000;
> + return IIO_VAL_INT_PLUS_MICRO;
> + default:
> + return -EINVAL;
> + }
> }
>
> return -EINVAL;
> @@ -218,11 +230,13 @@ static struct ms5611_chip_info chip_info_tbl[] = {
> static const struct iio_chan_spec ms5611_channels[] = {
> {
> .type = IIO_PRESSURE,
> - .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
> + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
> + BIT(IIO_CHAN_INFO_SCALE),
> },
> {
> .type = IIO_TEMP,
> - .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
> + .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
> + BIT(IIO_CHAN_INFO_SCALE),
> }
> };
>
>
next prev parent reply other threads:[~2016-02-06 18:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 16:50 [PATCH v3 0/2] ms5611: Add triggered buffer support Daniel Baluta
2016-02-03 16:50 ` [PATCH v3 1/2] iio: pressure: ms5611: Add IIO_CHAN_INFO_SCALE to mask Daniel Baluta
2016-02-06 18:18 ` Jonathan Cameron [this message]
2016-02-03 16:50 ` [PATCH v3 2/2] iio: pressure: ms5611: Add triggered buffer support Daniel Baluta
2016-02-06 18:18 ` Jonathan Cameron
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=56B638E9.2030203@kernel.org \
--to=jic23@kernel.org \
--cc=daniel.baluta@intel.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=pmeerw@pmeerw.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.