Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-27 Thread Nicolin Chen
On Thu, Sep 27, 2018 at 03:52:00PM -0700, Guenter Roeck wrote: > The proper fix for this problem would be to add support for suspend / > resume to the driver. At resume time, all channels will have been > re-enabled if the chip was powered off, even if they were explicitly > disabled by devicetree

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-27 Thread Guenter Roeck
On Thu, Sep 27, 2018 at 03:26:14PM -0700, Nicolin Chen wrote: > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > > > +static inline bool ina3221_is_enable(struct ina3221_data *ina, int > > > channel) > > > > s/is_enable/is_enabled/, maybe ? > > Fixing. > > > > + return (config &

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-27 Thread Nicolin Chen
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > > +static inline bool ina3221_is_enable(struct ina3221_data *ina, int channel) > > s/is_enable/is_enabled/, maybe ? Fixing. > > + return (config & INA3221_CONFIG_CHx_EN(channel)) > 0; > > The "> 0" is unnecessary. Conversion to

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-27 Thread Nicolin Chen
Hello Guenter, On Thu, Sep 27, 2018 at 09:05:09AM -0700, Guenter Roeck wrote: > > > Point is that I don't _know_ how this is going to be used, so I'd > > > rather keep it flexible. > > > > Well, taking one step back, I am okay to follow your way if you > > are really firm about it. Just please gi

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-27 Thread Guenter Roeck
Hi Nicolin, On Wed, Sep 26, 2018 at 02:55:06PM -0700, Nicolin Chen wrote: > On Wed, Sep 26, 2018 at 01:44:55PM -0700, Guenter Roeck wrote: > > On Wed, Sep 26, 2018 at 01:25:20PM -0700, Nicolin Chen wrote: > > > Hello, > > > > > > On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote: > >

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Nicolin Chen
On Wed, Sep 26, 2018 at 01:44:55PM -0700, Guenter Roeck wrote: > On Wed, Sep 26, 2018 at 01:25:20PM -0700, Nicolin Chen wrote: > > Hello, > > > > On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote: > > > On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote: > > > > On Wed, Sep 2

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Guenter Roeck
On Wed, Sep 26, 2018 at 01:25:20PM -0700, Nicolin Chen wrote: > Hello, > > On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote: > > On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote: > > > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > > > > On 09/25/2018 11:

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Nicolin Chen
Hello, On Wed, Sep 26, 2018 at 12:58:17PM -0700, Guenter Roeck wrote: > On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote: > > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > > > On 09/25/2018 11:42 PM, Nicolin Chen wrote: > > > > The inX_enable interface allows user sp

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Guenter Roeck
Nicolin, On Wed, Sep 26, 2018 at 11:02:44AM -0700, Nicolin Chen wrote: > On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > > On 09/25/2018 11:42 PM, Nicolin Chen wrote: > > > The inX_enable interface allows user space to enable or disable > > > the corresponding channel. Meanwhile,

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Nicolin Chen
On Wed, Sep 26, 2018 at 06:06:32AM -0700, Guenter Roeck wrote: > On 09/25/2018 11:42 PM, Nicolin Chen wrote: > > The inX_enable interface allows user space to enable or disable > > the corresponding channel. Meanwhile, according to hwmon ABI, a > > disabled channel/sensor should return -ENODATA as

Re: [PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-26 Thread Guenter Roeck
Hi Nicolin, On 09/25/2018 11:42 PM, Nicolin Chen wrote: The inX_enable interface allows user space to enable or disable the corresponding channel. Meanwhile, according to hwmon ABI, a disabled channel/sensor should return -ENODATA as a read result. However, there're configurable nodes sharing t

[PATCH 2/2] hwmon: ina3221: Add enable sysfs nodes

2018-09-25 Thread Nicolin Chen
The inX_enable interface allows user space to enable or disable the corresponding channel. Meanwhile, according to hwmon ABI, a disabled channel/sensor should return -ENODATA as a read result. However, there're configurable nodes sharing the same __show() functions. So this change also adds to che