From: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Cameron <jic23@kernel.org>
Cc: lm-sensors <lm-sensors@lm-sensors.org>,
linux-iio@vger.kernel.org, Jean Delvare <jdelvare@suse.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>
Subject: Re: [PATCH] hwmon: (iio_hwmon) Add support for humidity and power sensors
Date: Sat, 04 Oct 2014 06:34:15 -0700 [thread overview]
Message-ID: <542FF757.5020204@roeck-us.net> (raw)
In-Reply-To: <542FDC0A.3070904@kernel.org>
On 10/04/2014 04:37 AM, Jonathan Cameron wrote:
> On 29/09/14 20:13, Guenter Roeck wrote:
>> On Mon, Sep 29, 2014 at 06:36:13PM +0100, Jonathan Cameron wrote:
>>> On 27/09/14 16:49, Guenter Roeck wrote:
>>>> The iio subsystem supports power and humidity sensors, so it makes sense
>>>> to support those sensor types in the iio-hwmon bridge as well.
>>>>
>>>> Cc: Jonathan Cameron <jic23@kernel.org>
>>>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>>> Looks good.
>>>> ---
>>>> Compile tested only.
>>>>
>>>> Question is if I got the scale conversion correct for power measurements.
>>>> I _assume_ that iio always reports processed values in milli-units,
>>>> but I am not entirely sure.
>>>
>>> IIO actually only keeps to milli units where we were copying from hwmom
>>> back when originally working this stuff out. Given we have the double
>>> int32 representation and IIO_TYPE_* we try to keep to the base SI units
>>> everywhere else. (If we were doing it again today, I'd be advocating
>>> using base units everywhere for consistency reasons)
>>>
>> What does that mean for the iio-hwmon bridge ? Should I get the base
>> units (or scaling factors) on a per-sensor basis, or does the above apply
>> on a per-type basis ? I checked the humidity ABI (which is documented),
>> and it says that humidity is reported in milli-units.
> It's per type unfortunately. Humidity is indeed in milli-units
> but power is probably in micro-units (as per hwmon).
> Right now it is undocumented and we only have one user so pretty much
> need to go with whatever that does (unless it's really silly).
>
> I haven't had a chance to go datasheet diving to work out what it is
> using as yet.
No problem. I'll simplify the patch and only add support for humidity for now.
Thanks,
Guenter
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Jonathan Cameron <jic23@kernel.org>
Cc: lm-sensors <lm-sensors@lm-sensors.org>,
linux-iio@vger.kernel.org, Jean Delvare <jdelvare@suse.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>
Subject: Re: [lm-sensors] [PATCH] hwmon: (iio_hwmon) Add support for humidity and power sensors
Date: Sat, 04 Oct 2014 13:34:15 +0000 [thread overview]
Message-ID: <542FF757.5020204@roeck-us.net> (raw)
In-Reply-To: <542FDC0A.3070904@kernel.org>
On 10/04/2014 04:37 AM, Jonathan Cameron wrote:
> On 29/09/14 20:13, Guenter Roeck wrote:
>> On Mon, Sep 29, 2014 at 06:36:13PM +0100, Jonathan Cameron wrote:
>>> On 27/09/14 16:49, Guenter Roeck wrote:
>>>> The iio subsystem supports power and humidity sensors, so it makes sense
>>>> to support those sensor types in the iio-hwmon bridge as well.
>>>>
>>>> Cc: Jonathan Cameron <jic23@kernel.org>
>>>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>>> Looks good.
>>>> ---
>>>> Compile tested only.
>>>>
>>>> Question is if I got the scale conversion correct for power measurements.
>>>> I _assume_ that iio always reports processed values in milli-units,
>>>> but I am not entirely sure.
>>>
>>> IIO actually only keeps to milli units where we were copying from hwmom
>>> back when originally working this stuff out. Given we have the double
>>> int32 representation and IIO_TYPE_* we try to keep to the base SI units
>>> everywhere else. (If we were doing it again today, I'd be advocating
>>> using base units everywhere for consistency reasons)
>>>
>> What does that mean for the iio-hwmon bridge ? Should I get the base
>> units (or scaling factors) on a per-sensor basis, or does the above apply
>> on a per-type basis ? I checked the humidity ABI (which is documented),
>> and it says that humidity is reported in milli-units.
> It's per type unfortunately. Humidity is indeed in milli-units
> but power is probably in micro-units (as per hwmon).
> Right now it is undocumented and we only have one user so pretty much
> need to go with whatever that does (unless it's really silly).
>
> I haven't had a chance to go datasheet diving to work out what it is
> using as yet.
No problem. I'll simplify the patch and only add support for humidity for now.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2014-10-04 13:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-27 15:49 [PATCH] hwmon: (iio_hwmon) Add support for humidity and power sensors Guenter Roeck
2014-09-27 15:49 ` [lm-sensors] " Guenter Roeck
2014-09-29 17:36 ` Jonathan Cameron
2014-09-29 17:36 ` [lm-sensors] " Jonathan Cameron
2014-09-29 19:13 ` Guenter Roeck
2014-09-29 19:13 ` [lm-sensors] " Guenter Roeck
2014-10-04 11:37 ` Jonathan Cameron
2014-10-04 11:37 ` [lm-sensors] " Jonathan Cameron
2014-10-04 13:34 ` Guenter Roeck [this message]
2014-10-04 13:34 ` Guenter Roeck
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=542FF757.5020204@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Michael.Hennerich@analog.com \
--cc=jdelvare@suse.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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 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.