From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Crt Mori <cmo@melexis.com>, linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2] iio: temperature: mlx90632: Interface to change object ambient temperature
Date: Sun, 6 Sep 2020 14:42:44 +0100 [thread overview]
Message-ID: <20200906144244.1049989c@archlinux> (raw)
In-Reply-To: <CAHp75VeiR1qQkBhA0XQ2_6aVAFHfQTWGcr+NeRhFNoCEiMK9kg@mail.gmail.com>
On Fri, 4 Sep 2020 15:19:27 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Fri, Sep 4, 2020 at 3:08 PM Crt Mori <cmo@melexis.com> wrote:
> >
> > Since object temperature might be different than the sensor temperature
> > the infrared sensors should provide an interface to inject ambient
> > temperature. This was in past done via write to ambient temperature
> > interface (in_temp_ambient_raw), but I think most people did not know
> > about it. This solution introduces a new iio type of the CALIBAMBIENT
> > which is hopefully more descriptive and more explicit about the purpose
> > and capabilities of the sensors.
>
> I'm fine, but one really picky comment below. I don't think a new
> version is needed till Jonathan will ask for it.
>
> > Signed-off-by: Crt Mori <cmo@melexis.com>
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Starting point for a new ABI is docs, so please add to
Documentation/ABI/testing/sysfs-bus-iio*
This is a somewhat odd corner case of saying don't use the local
measurement but one from 'over there' that we are supplying.
I'd love to come up with a more generic term for that, but if
we did I guess we'd back in the position that we are now, with a
non-obvious interface for this particular usecase.
So unless anyone else comments, please do a v3 with docs and
I'll pick it up.
Thanks,
Jonathan
> > ---
> > drivers/iio/industrialio-core.c | 1 +
> > drivers/iio/temperature/mlx90632.c | 8 +++++++-
> > include/linux/iio/types.h | 1 +
> > 3 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> > index 606d5e61c575..941011502f4d 100644
> > --- a/drivers/iio/industrialio-core.c
> > +++ b/drivers/iio/industrialio-core.c
> > @@ -165,6 +165,7 @@ static const char * const iio_chan_info_postfix[] = {
> > [IIO_CHAN_INFO_CALIBEMISSIVITY] = "calibemissivity",
> > [IIO_CHAN_INFO_OVERSAMPLING_RATIO] = "oversampling_ratio",
> > [IIO_CHAN_INFO_THERMOCOUPLE_TYPE] = "thermocouple_type",
> > + [IIO_CHAN_INFO_CALIBAMBIENT] = "calibambient",
> > };
> >
> > #if defined(CONFIG_DEBUG_FS)
> > diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> > index 94bca2b2866a..8e60d401b703 100644
> > --- a/drivers/iio/temperature/mlx90632.c
> > +++ b/drivers/iio/temperature/mlx90632.c
> > @@ -761,6 +761,9 @@ static int mlx90632_read_raw(struct iio_dev *indio_dev,
> > *val2 = data->emissivity * 1000;
> > }
> > return IIO_VAL_INT_PLUS_MICRO;
>
> Blank line is missed here.
>
> > + case IIO_CHAN_INFO_CALIBAMBIENT:
> > + *val = data->object_ambient_temperature;
> > + return IIO_VAL_INT;
> >
> > default:
> > return -EINVAL;
> > @@ -781,6 +784,9 @@ static int mlx90632_write_raw(struct iio_dev *indio_dev,
> > return -EINVAL;
> > data->emissivity = val * 1000 + val2 / 1000;
> > return 0;
> > + case IIO_CHAN_INFO_CALIBAMBIENT:
> > + data->object_ambient_temperature = val;
> > + return 0;
> > default:
> > return -EINVAL;
> > }
> > @@ -798,7 +804,7 @@ static const struct iio_chan_spec mlx90632_channels[] = {
> > .modified = 1,
> > .channel2 = IIO_MOD_TEMP_OBJECT,
> > .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED) |
> > - BIT(IIO_CHAN_INFO_CALIBEMISSIVITY),
> > + BIT(IIO_CHAN_INFO_CALIBEMISSIVITY) | BIT(IIO_CHAN_INFO_CALIBAMBIENT),
> > },
> > };
> >
> > diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> > index e6fd3645963c..1e3ed6f55bca 100644
> > --- a/include/linux/iio/types.h
> > +++ b/include/linux/iio/types.h
> > @@ -59,6 +59,7 @@ enum iio_chan_info_enum {
> > IIO_CHAN_INFO_CALIBEMISSIVITY,
> > IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> > IIO_CHAN_INFO_THERMOCOUPLE_TYPE,
> > + IIO_CHAN_INFO_CALIBAMBIENT,
> > };
> >
> > #endif /* _IIO_TYPES_H_ */
> > --
> > 2.25.1
> >
>
>
next prev parent reply other threads:[~2020-09-06 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 12:07 [PATCH v2] iio: temperature: mlx90632: Interface to change object ambient temperature Crt Mori
2020-09-04 12:19 ` Andy Shevchenko
2020-09-06 13:42 ` Jonathan Cameron [this message]
2020-09-06 21:04 ` Crt Mori
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=20200906144244.1049989c@archlinux \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=cmo@melexis.com \
--cc=linux-iio@vger.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