Re: [PATCH 1/1] regulator: max77802: set opmode to normal if off is read from hw

From: Mark Brown
Date: Wed Aug 27 2014 - 16:26:18 EST


On Wed, Aug 27, 2014 at 09:58:55PM +0200, Tomasz Figa wrote:
> On 27.08.2014 21:44, Mark Brown wrote:

> > The point is that if anything was setting the mode to something other
> > than normal it was almost certainly a previously running copy of Linux
> > and one would expect that if the mode does need to be changed the new
> > copy will be doing that anyway. It's rare enough to need to actively
> > manage modes in the first place.

> From what I know based on my experience with Samsung boards we used, the
> opmodes of regulators are preconfigured by board bootloader to certain
> values based on power design of the board (i.e. there is no need to keep
> a regulator in full power mode, if on given board only a little fraction
> of it is needed).

Well, presumably the bootloader is going to run again even for a warm
reboot?

> Now Linux should not change this mode (excluding cases when the values
> in the bootloader are wrong - they happen unfortunately), so I'm not
> getting why you say that it is Linux which changes the mode to something
> other than normal. Linux should only toggle between the value resulting
> from power design and off.

It's not in general true that Linux should never change the mode (the
main case for toggling modes is usually going between an idle/suspend
state and active state) and for practical purposes bootloader and
hardware defaults tend to be the same. You're talking about the case
where the bootloader does set something but avoids doing so on warm
reboots only here.

Besides, even if we did have a way of specifying modes in DT (with all
the problems that brings) we still have to pick a default if that's not
used).

Attachment: signature.asc
Description: Digital signature