public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps
@ 2012-06-07  9:08 Axel Lin
  2012-06-07 10:58 ` Graeme Gregory
  2012-06-07 23:29 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-07  9:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Graeme Gregory, Mark Brown, Liam Girdwood

Current code actually clears more bits than PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
Hi Graeme,

I'm wandering if we need to clear the status bits.
Current code actually clears bit[7:4] and bit[1:0] and set bit[7:6] to bit[3:2].
Looks like we only need to clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bit[1:0] bits here.
and this change makes the intent more clear.

I don't have this hardware,
I'd appreciate if you can test this patch if you think this change ok.

Regards,
Axel
 drivers/regulator/palmas-regulator.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 92f475c..ae0951a 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -257,8 +257,7 @@ static int palmas_set_mode_smps(struct regulator_dev *dev, unsigned int mode)
 	unsigned int reg;
 
 	palmas_smps_read(pmic->palmas, palmas_regs_info[id].ctrl_addr, &reg);
-	reg &= ~PALMAS_SMPS12_CTRL_STATUS_MASK;
-	reg >>= PALMAS_SMPS12_CTRL_STATUS_SHIFT;
+	reg &= ~PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
 
 	switch (mode) {
 	case REGULATOR_MODE_NORMAL:
-- 
1.7.9.5




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

* Re: [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps
  2012-06-07  9:08 [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps Axel Lin
@ 2012-06-07 10:58 ` Graeme Gregory
  2012-06-07 23:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Graeme Gregory @ 2012-06-07 10:58 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Mark Brown, Liam Girdwood

That looks like a C&P error on my part.

Thanks for noticing.

Acked-by: Graeme Gregory <gg@slimlogic.co.uk>

On 07/06/12 10:08, Axel Lin wrote:
> Current code actually clears more bits than PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> Hi Graeme,
>
> I'm wandering if we need to clear the status bits.
> Current code actually clears bit[7:4] and bit[1:0] and set bit[7:6] to bit[3:2].
> Looks like we only need to clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bit[1:0] bits here.
> and this change makes the intent more clear.
>
> I don't have this hardware,
> I'd appreciate if you can test this patch if you think this change ok.
>
> Regards,
> Axel
>  drivers/regulator/palmas-regulator.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
> index 92f475c..ae0951a 100644
> --- a/drivers/regulator/palmas-regulator.c
> +++ b/drivers/regulator/palmas-regulator.c
> @@ -257,8 +257,7 @@ static int palmas_set_mode_smps(struct regulator_dev *dev, unsigned int mode)
>  	unsigned int reg;
>  
>  	palmas_smps_read(pmic->palmas, palmas_regs_info[id].ctrl_addr, &reg);
> -	reg &= ~PALMAS_SMPS12_CTRL_STATUS_MASK;
> -	reg >>= PALMAS_SMPS12_CTRL_STATUS_SHIFT;
> +	reg &= ~PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
>  
>  	switch (mode) {
>  	case REGULATOR_MODE_NORMAL:


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

* Re: [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps
  2012-06-07  9:08 [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps Axel Lin
  2012-06-07 10:58 ` Graeme Gregory
@ 2012-06-07 23:29 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-06-07 23:29 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Graeme Gregory, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 172 bytes --]

On Thu, Jun 07, 2012 at 05:08:21PM +0800, Axel Lin wrote:
> Current code actually clears more bits than PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits.
> 

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-06-08  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07  9:08 [PATCH RFC/RFT] regulator: palmas: Clear PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK bits in palmas_set_mode_smps Axel Lin
2012-06-07 10:58 ` Graeme Gregory
2012-06-07 23:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox