Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Mark Brown
On Mon, Apr 15, 2013 at 04:48:03PM +0200, Bengt Jönsson wrote: > Reverting 500b4ac90d1103 makes sense, but first I want to mention > two things: > 1. In some cases it is not even possible to know the actual current > state of a regulator because it is controlled by HW as well as SW. > We have sev

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Bengt Jönsson
On 04/15/2013 04:11 PM, Axel Lin wrote: 2013/4/15 Bengt Jönsson : On 04/15/2013 02:13 PM, Axel Lin wrote: I guess what you don't like with the current approach is that the driver returns REGULATOR_MODE_IDLE in some cases where the mode register is set to LP. But I think, with patch applied, the

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Axel Lin
2013/4/15 Bengt Jönsson : > On 04/15/2013 02:13 PM, Axel Lin wrote: >>> >>> I guess what you don't like with the current approach is that the driver >>> returns REGULATOR_MODE_IDLE in some cases where the mode register is set >>> to >>> LP. But I think, with patch applied, the control may be wrong

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Bengt Jönsson
On 04/15/2013 02:13 PM, Axel Lin wrote: I guess what you don't like with the current approach is that the driver returns REGULATOR_MODE_IDLE in some cases where the mode register is set to LP. But I think, with patch applied, the control may be wrong in some cases because the regulator framework

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Axel Lin
> I guess what you don't like with the current approach is that the driver > returns REGULATOR_MODE_IDLE in some cases where the mode register is set to > LP. But I think, with patch applied, the control may be wrong in some cases > because the regulator framework will call get_mode and see that th

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Bengt Jönsson
On 04/15/2013 10:50 AM, Axel Lin wrote: My understanding is for shared mode regulators: It can be in LP mode only when *BOTH* are in LP mode. If only one of the regulator in HP mode, then *BOTH* should be in HP mode. Did I misunderstand something? Your understanding is correct. Let me put this

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Axel Lin
> My understanding is for shared mode regulators: > It can be in LP mode only when *BOTH* are in LP mode. > If only one of the regulator in HP mode, then *BOTH* should be in HP mode. > Did I misunderstand something? Let me put this issue this way: Current code behavior: get_mode() returns IDLE if

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Axel Lin
2013/4/15 Bengt Jönsson : > On 04/08/2013 02:31 PM, Axel Lin wrote: >> >> The special handling code for getting shared mode status is wrong >> because it needs to check info->shared_mode->lp_mode_req for >> both regulators that shared the same mode register. >> >> In set_mode(), current code ensure

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Lee Jones
Hi Axel, > Ping. > > Hi Lee, > Can you review this patch. > I think this one is a bug fix. Bengt is the SME for all things ab*-regulator related. No one knows the driver better than him. Bengt, would you mind reviewing? > 2013/4/8 Axel Lin : > > The special handling code for getting shared mo

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-15 Thread Bengt Jönsson
On 04/08/2013 02:31 PM, Axel Lin wrote: The special handling code for getting shared mode status is wrong because it needs to check info->shared_mode->lp_mode_req for both regulators that shared the same mode register. In set_mode(), current code ensures we won't set mode to REGULATOR_MODE_IDLE

Re: [PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-13 Thread Axel Lin
Ping. Hi Lee, Can you review this patch. I think this one is a bug fix. Regards, Axel 2013/4/8 Axel Lin : > The special handling code for getting shared mode status is wrong > because it needs to check info->shared_mode->lp_mode_req for > both regulators that shared the same mode register. > > I

[PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-08 Thread Axel Lin
The special handling code for getting shared mode status is wrong because it needs to check info->shared_mode->lp_mode_req for both regulators that shared the same mode register. In set_mode(), current code ensures we won't set mode to REGULATOR_MODE_IDLE if only one of the regulator requests to s