From: Guenter Roeck <linux@roeck-us.net>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, corbet@lwn.net,
linux-doc@vger.kernel.org
Subject: Re: [PATCH] hwmon (ina3221) Add single-shot mode support
Date: Fri, 23 Nov 2018 08:38:50 -0800 [thread overview]
Message-ID: <b1a34c68-d5e3-9a6f-67b1-6b6d2332f1c6@roeck-us.net> (raw)
In-Reply-To: <20181119221842.GA26382@Asurada-Nvidia.nvidia.com>
On 11/19/18 2:18 PM, Nicolin Chen wrote:
> On Mon, Nov 19, 2018 at 09:45:59AM -0800, Guenter Roeck wrote:
>>> In short, other than exposing it via a generic ABI to the user
>>> space, how about defining some policy to maintaining it within
>>> the driver?
>
>> I think that would be a bad idea. It changes timing for everyone
>> curently using the driver. It also effectively disables monitoring,
>> which is the main purpose for using this chip (and other hardware
>> monitoring chips). This is indeed a key difference between iio
>> and hwmon - the main purpose of chips in the iio subsystem is to
>> be able report data efficiently to user space, not hardware monitoring.
>> I do not think it is appropriate to use iio requirements as argument
>> to change hwmon driver behavior (and vice versa).
>
> OK...what about setting a default mode via DT? I didn't expect it
> to be possible until I found this existing solution. Though it is
> still in an iio driver, I don't think this should be iio specific.
>
> commit 023e30fb0d3a3b9d6b8dc9e47590aa544d58a22f
> Author: Adriana Reus <adriana.reus@intel.com>
> Date: Tue Nov 24 12:59:49 2015 +0200
>
> Documentation: devicetree: Add property for controlling power saving
> mode for the us5182 als sensor
>
> Add a property to allow changing the default power-saving mode.
> By default, at read raw the chip will activate and provide
> one measurent, then it will shut itself down. However, the
> chip can also work in "continuous" mode which may be more reliable
> but is also more power consuming.
>
> Signed-off-by: Adriana Reus <adriana.reus@intel.com>
> Acked-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
>
> Would it be possible for me to apply a similar one? Since hwmon
> driver uses continuous mode by default, I will add a "one-shot"
> property instead of "continuous" -- all existing users won't be
> effected unless they place one-shot properties in DT bindings.
>
I would accept such a patch, but it would for all practical purposes
disable the monitoring of limits. Make sure that is well documented.
Guenter
prev parent reply other threads:[~2018-11-24 3:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 4:23 [PATCH] hwmon (ina3221) Add single-shot mode support Nicolin Chen
2018-11-13 4:32 ` Guenter Roeck
2018-11-13 4:58 ` Nicolin Chen
2018-11-13 17:21 ` Guenter Roeck
2018-11-14 0:11 ` Nicolin Chen
2018-11-14 17:23 ` Guenter Roeck
2018-11-17 1:51 ` Nicolin Chen
2018-11-19 17:45 ` Guenter Roeck
2018-11-19 22:18 ` Nicolin Chen
2018-11-23 16:38 ` Guenter Roeck [this message]
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=b1a34c68-d5e3-9a6f-67b1-6b6d2332f1c6@roeck-us.net \
--to=linux@roeck-us.net \
--cc=corbet@lwn.net \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicoleotsuka@gmail.com \
/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).