lkml.org 
[lkml]   [2014]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/9] regulator: max77802: Add .{get,set}_mode callbacks
Hello Mark,

Thanks a lot for your feedback.

On 10/16/2014 10:36 AM, Mark Brown wrote:
> On Wed, Oct 15, 2014 at 06:20:32PM +0200, Javier Martinez Canillas wrote:
>
>> +#define MAX77802_MODE(pval) ((pval == MAX77802_OPMODE_NORMAL) ? \
>> + REGULATOR_MODE_NORMAL : REGULATOR_MODE_STANDBY)
>> +
>
> Make this a static inline function if there's any need for it, this is
> both more legible and more helpful for the compiler.
>

Ok, will change that.

>> + switch (mode) {
>> + case REGULATOR_MODE_IDLE:
>> + case REGULATOR_MODE_STANDBY:
>> + val = MAX77802_OPMODE_LP; /* ON in Low Power Mode */
>> + break;
>
> You should never have multiple modes mapping onto a singel value - if
> the user sets a mode they should find that the device has that mode.
>

I see, thanks for the clarification. I think STANDBY better maps the device
Low Power Mode according the description in include/linux/regulator/consumer.h
so I'll just make IDLE invalid in v2.

Best regards,
Javier


\
 
 \ /
  Last update: 2014-10-16 13:01    [W:0.408 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site