2013/4/15 Bengt Jönsson <bengt.g.jonsson@xxxxxxxxxxxxxx>:Reverting 500b4ac90d1103 makes sense, but first I want to mention two things:On 04/15/2013 02:13 PM, Axel Lin wrote:It looks to me a simple fix is to just get rid of the check of old mode withI understand your point of view, but I think that the framework (as it isI guess what you don't like with the current approach is that the driverI got your point now.
returns REGULATOR_MODE_IDLE in some cases where the mode register is set
LP. But I think, with patch applied, the control may be wrong in some
because the regulator framework will call get_mode and see that the mode
already correct and not call set_mode so lp_mode_req will not get
My point is get_mode() should always return "correct" status by
reading register value.
And as you mentioned, regulator_set_mode() did check current mode and
set_mode callback if current mode is the same as the target mode.
And that is why this patch won't work.
However, Make get_mode() return "incorrect" status to avoid above
issue looks wrong to me.
currently implemented) expects to get the requested mode of the regulator in
this case, not the actual mode (in the shared mode register).The alternative
could be to change the framework in some way.
Any ideas? Otherwise I propose to keep the code and maybe add a comment.
new mode setting.
Something like reverse of commit 500b4ac90d1103
"regulator: return set_mode is same mode is requested" would work.