linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay
@ 2014-05-07  9:52 Krzysztof Kozlowski
  2014-05-07 11:10 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-05-07  9:52 UTC (permalink / raw)
  To: Sangbeom Kim, Liam Girdwood, Mark Brown, Sachin Kamat, linux-kernel
  Cc: Krzysztof Kozlowski, stable

Buck1 and buck6 share the field (offset 4) in ramp delay register
(S2MPA01_REG_RAMP1). The buck3 uses its own field in S2MPA01_REG_RAMP2
register, also at offset 4.

The driver interchanged the registers for ramp delay of buck3 and buck6.
This lead to updating ramp delay for wrong buck (buck3 instead of buck6
and vice versa).

Cc: <stable@vger.kernel.org>
Fixes: f18792714608 ("regulator: Add support for S2MPA01 regulator")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/regulator/s2mpa01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
index f19a30f0fb42..67a5ab335dae 100644
--- a/drivers/regulator/s2mpa01.c
+++ b/drivers/regulator/s2mpa01.c
@@ -137,17 +137,16 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 		enable_shift = S2MPA01_BUCK3_RAMP_EN_SHIFT;
 		if (!ramp_delay) {
 			ramp_enable = 0;
 			break;
 		}
 
 		s2mpa01->ramp_delay3 = ramp_delay;
 		ramp_shift = S2MPA01_BUCK3_RAMP_SHIFT;
-		ramp_reg = S2MPA01_REG_RAMP1;
 		break;
 	case S2MPA01_BUCK4:
 		enable_shift = S2MPA01_BUCK4_RAMP_EN_SHIFT;
 		if (!ramp_delay) {
 			ramp_enable = 0;
 			break;
 		}
 
@@ -165,16 +164,17 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 		break;
 	case S2MPA01_BUCK6:
 		if (ramp_delay > s2mpa01->ramp_delay16)
 			s2mpa01->ramp_delay16 = ramp_delay;
 		else
 			ramp_delay = s2mpa01->ramp_delay16;
 
 		ramp_shift = S2MPA01_BUCK16_RAMP_SHIFT;
+		ramp_reg = S2MPA01_REG_RAMP1;
 		break;
 	case S2MPA01_BUCK7:
 		s2mpa01->ramp_delay7 = ramp_delay;
 		ramp_shift = S2MPA01_BUCK7_RAMP_SHIFT;
 		break;
 	case S2MPA01_BUCK8:
 	case S2MPA01_BUCK9:
 	case S2MPA01_BUCK10:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay
  2014-05-07  9:52 [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay Krzysztof Kozlowski
@ 2014-05-07 11:10 ` Krzysztof Kozlowski
  2014-05-23 14:19   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-05-07 11:10 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Liam Girdwood, Mark Brown, linux-kernel, stable, Sangbeom Kim

Hi Sachin,


I'm looking at SM-N7505 JB Open source code and it seems that I was
wrong - the ramp delay for buck1 is set in wrong register, not buck3.

I don't have the datasheet for S2MPA01 so could you confirm the
registers for ramp delay of buck1, buck3 and buck6?


Best regards,
Krzysztof


On śro, 2014-05-07 at 11:52 +0200, Krzysztof Kozlowski wrote:
> Buck1 and buck6 share the field (offset 4) in ramp delay register
> (S2MPA01_REG_RAMP1). The buck3 uses its own field in S2MPA01_REG_RAMP2
> register, also at offset 4.
> 
> The driver interchanged the registers for ramp delay of buck3 and buck6.
> This lead to updating ramp delay for wrong buck (buck3 instead of buck6
> and vice versa).
> 
> Cc: <stable@vger.kernel.org>
> Fixes: f18792714608 ("regulator: Add support for S2MPA01 regulator")
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  drivers/regulator/s2mpa01.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
> index f19a30f0fb42..67a5ab335dae 100644
> --- a/drivers/regulator/s2mpa01.c
> +++ b/drivers/regulator/s2mpa01.c
> @@ -137,17 +137,16 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
>  		enable_shift = S2MPA01_BUCK3_RAMP_EN_SHIFT;
>  		if (!ramp_delay) {
>  			ramp_enable = 0;
>  			break;
>  		}
>  
>  		s2mpa01->ramp_delay3 = ramp_delay;
>  		ramp_shift = S2MPA01_BUCK3_RAMP_SHIFT;
> -		ramp_reg = S2MPA01_REG_RAMP1;
>  		break;
>  	case S2MPA01_BUCK4:
>  		enable_shift = S2MPA01_BUCK4_RAMP_EN_SHIFT;
>  		if (!ramp_delay) {
>  			ramp_enable = 0;
>  			break;
>  		}
>  
> @@ -165,16 +164,17 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
>  		break;
>  	case S2MPA01_BUCK6:
>  		if (ramp_delay > s2mpa01->ramp_delay16)
>  			s2mpa01->ramp_delay16 = ramp_delay;
>  		else
>  			ramp_delay = s2mpa01->ramp_delay16;
>  
>  		ramp_shift = S2MPA01_BUCK16_RAMP_SHIFT;
> +		ramp_reg = S2MPA01_REG_RAMP1;
>  		break;
>  	case S2MPA01_BUCK7:
>  		s2mpa01->ramp_delay7 = ramp_delay;
>  		ramp_shift = S2MPA01_BUCK7_RAMP_SHIFT;
>  		break;
>  	case S2MPA01_BUCK8:
>  	case S2MPA01_BUCK9:
>  	case S2MPA01_BUCK10:


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay
  2014-05-07 11:10 ` Krzysztof Kozlowski
@ 2014-05-23 14:19   ` Krzysztof Kozlowski
  2014-05-26  8:07     ` Sachin Kamat
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-05-23 14:19 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Liam Girdwood, Mark Brown, linux-kernel, stable, Sangbeom Kim

Hi Sachin,

The s2mpa01 regulator driver uses wrong registers for ramp delay (buck1
and buck3 in RAMP1, buck6 in RAMP2) but I am not sure which layout is
proper (it seems that that buck1 should be in RAMP2 register).

Could you check in S2MPA01 datasheet the registers for ramp delay for
buck1, buck3 and buck6?

I have prepared patches for merging s2mpa01 and s2mps11 but this one
issue is holding them.

Best regards,
Krzysztof


On śro, 2014-05-07 at 13:10 +0200, Krzysztof Kozlowski wrote:
> Hi Sachin,
> 
> 
> I'm looking at SM-N7505 JB Open source code and it seems that I was
> wrong - the ramp delay for buck1 is set in wrong register, not buck3.
> 
> I don't have the datasheet for S2MPA01 so could you confirm the
> registers for ramp delay of buck1, buck3 and buck6?
> 
> 
> Best regards,
> Krzysztof
> 
> 
> On śro, 2014-05-07 at 11:52 +0200, Krzysztof Kozlowski wrote:
> > Buck1 and buck6 share the field (offset 4) in ramp delay register
> > (S2MPA01_REG_RAMP1). The buck3 uses its own field in S2MPA01_REG_RAMP2
> > register, also at offset 4.
> > 
> > The driver interchanged the registers for ramp delay of buck3 and buck6.
> > This lead to updating ramp delay for wrong buck (buck3 instead of buck6
> > and vice versa).
> > 
> > Cc: <stable@vger.kernel.org>
> > Fixes: f18792714608 ("regulator: Add support for S2MPA01 regulator")
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > ---
> >  drivers/regulator/s2mpa01.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
> > index f19a30f0fb42..67a5ab335dae 100644
> > --- a/drivers/regulator/s2mpa01.c
> > +++ b/drivers/regulator/s2mpa01.c
> > @@ -137,17 +137,16 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
> >  		enable_shift = S2MPA01_BUCK3_RAMP_EN_SHIFT;
> >  		if (!ramp_delay) {
> >  			ramp_enable = 0;
> >  			break;
> >  		}
> >  
> >  		s2mpa01->ramp_delay3 = ramp_delay;
> >  		ramp_shift = S2MPA01_BUCK3_RAMP_SHIFT;
> > -		ramp_reg = S2MPA01_REG_RAMP1;
> >  		break;
> >  	case S2MPA01_BUCK4:
> >  		enable_shift = S2MPA01_BUCK4_RAMP_EN_SHIFT;
> >  		if (!ramp_delay) {
> >  			ramp_enable = 0;
> >  			break;
> >  		}
> >  
> > @@ -165,16 +164,17 @@ static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
> >  		break;
> >  	case S2MPA01_BUCK6:
> >  		if (ramp_delay > s2mpa01->ramp_delay16)
> >  			s2mpa01->ramp_delay16 = ramp_delay;
> >  		else
> >  			ramp_delay = s2mpa01->ramp_delay16;
> >  
> >  		ramp_shift = S2MPA01_BUCK16_RAMP_SHIFT;
> > +		ramp_reg = S2MPA01_REG_RAMP1;
> >  		break;
> >  	case S2MPA01_BUCK7:
> >  		s2mpa01->ramp_delay7 = ramp_delay;
> >  		ramp_shift = S2MPA01_BUCK7_RAMP_SHIFT;
> >  		break;
> >  	case S2MPA01_BUCK8:
> >  	case S2MPA01_BUCK9:
> >  	case S2MPA01_BUCK10:


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay
  2014-05-23 14:19   ` Krzysztof Kozlowski
@ 2014-05-26  8:07     ` Sachin Kamat
  2014-05-26  8:34       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Sachin Kamat @ 2014-05-26  8:07 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: Liam Girdwood, Mark Brown, LKML, stable, Sangbeom Kim

Hi Krzysztof

Apologies for the delay. I was on vacation during the early part of
this month and
got busy with some other stuff later and this mail fell through the cracks.


On 23 May 2014 19:49, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> Hi Sachin,
>
> The s2mpa01 regulator driver uses wrong registers for ramp delay (buck1
> and buck3 in RAMP1, buck6 in RAMP2) but I am not sure which layout is
> proper (it seems that that buck1 should be in RAMP2 register).
>
> Could you check in S2MPA01 datasheet the registers for ramp delay for
> buck1, buck3 and buck6?

I checked the datasheet available with me and according to it

buck 1 and 6 share the ramp register 0x11 (RAMP2) (bit 4 and 5) and buck 3 uses
bit 4 and 5 of register 0x10 (RAMP1).

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay
  2014-05-26  8:07     ` Sachin Kamat
@ 2014-05-26  8:34       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-05-26  8:34 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: Liam Girdwood, Mark Brown, LKML, stable, Sangbeom Kim

On pon, 2014-05-26 at 13:37 +0530, Sachin Kamat wrote:
> Hi Krzysztof
> 
> Apologies for the delay. I was on vacation during the early part of
> this month and
> got busy with some other stuff later and this mail fell through the cracks.
> 
> 
> On 23 May 2014 19:49, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> > Hi Sachin,
> >
> > The s2mpa01 regulator driver uses wrong registers for ramp delay (buck1
> > and buck3 in RAMP1, buck6 in RAMP2) but I am not sure which layout is
> > proper (it seems that that buck1 should be in RAMP2 register).
> >
> > Could you check in S2MPA01 datasheet the registers for ramp delay for
> > buck1, buck3 and buck6?
> 
> I checked the datasheet available with me and according to it
> 
> buck 1 and 6 share the ramp register 0x11 (RAMP2) (bit 4 and 5) and buck 3 uses
> bit 4 and 5 of register 0x10 (RAMP1).

Thanks! I'll send updated version of the patchset.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-26  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07  9:52 [RFT PATCH] regulator: s2mpa01: Use correct register for buck[36] ramp delay Krzysztof Kozlowski
2014-05-07 11:10 ` Krzysztof Kozlowski
2014-05-23 14:19   ` Krzysztof Kozlowski
2014-05-26  8:07     ` Sachin Kamat
2014-05-26  8:34       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).