[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181119221842.GA26382@Asurada-Nvidia.nvidia.com>
Date: Mon, 19 Nov 2018 14:18:43 -0800
From: Nicolin Chen <nicoleotsuka@...il.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: jdelvare@...e.com, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org, corbet@....net,
linux-doc@...r.kernel.org
Subject: Re: [PATCH] hwmon (ina3221) Add single-shot mode support
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@...el.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@...el.com>
Acked-by: Rob Herring <robh@...nel.org>
Signed-off-by: Jonathan Cameron <jic23@...nel.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.
Thanks
Nicolin
Powered by blists - more mailing lists