regulator: twl-regulator - fix twlreg_set_mode
Subsystems (2)
PATCH 1/1 regulator: twl-regulator - fix twlreg_set_mode
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]
Current implementation return immedially after sucessfuly write MSB part. To properly set mode, we need to write the complete message ( MSB and LSB ).
In twl.h, now we have defines for PM Master module register offsets, use it instead of hard coded 0x15/0x16.
Use "message & 0xff" to ensure we send correct value for LSB.
---
I don't have this hardware handy, I appreciate if someone who has the hardware can test this patch.
Regards,
Axel
drivers/regulator/twl-regulator.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/twl-regulator.c +3 -3
@@ -219,12 +219,12 @@ static int twlreg_set_mode(struct regulator_dev *rdev, unsigned mode)return -EACCES ; status =twl_i2c_write_u8 (TWL_MODULE_PM_MASTER , - message >>8 ,0x15 /* PB_WORD_MSB */ ); -if (status >=0 ) + message >>8 ,TWL4030_PM_MASTER_PB_WORD_MSB ); +if (status <0 )return status;return twl_i2c_write_u8 (TWL_MODULE_PM_MASTER , - message,0x16 /* PB_WORD_LSB */ ); + message &0xff ,TWL4030_PM_MASTER_PB_WORD_LSB ); }/*----------------------------------------------------------------------*/
Signature · 1 line
1.7.2
Quoted 6 lines · Axel Lin
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write MSB part. To properly set mode, we need to write the complete message ( MSB and LSB ).
Quoted 6 lines
In
twl.h, now we have defines for PM Master module register offsets, use it instead of hard coded 0x15/0x16.Use "message &
0xff" to ensure we send correct value for LSB.Signed-off-by Axel Lin <[email protected]>
Quoted 2 lines
I don't have this hardware handy, I appreciate if someone who has the hardware can test this patch.
I beleive Liam has appropriate hardware.
Quoted 12 lines · Mark Brown
Quoted 11 lines · Axel Lin
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write MSB part. To properly set mode, we need to write the complete message ( MSB and LSB ).
In
twl.h, now we have defines for PM Master module register offsets, use it instead of hard coded 0x15/0x16.Use "message &
0xff" to ensure we send correct value for LSB.
Quoted 8 lines
Quoted 1 line
Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>Quoted 2 lines
I don't have this hardware handy, I appreciate if someone who has the hardware can test this patch.
I beleive Liam has appropriate hardware.
Rejendra, care to test this ?
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Quoted 24 lines
-----Original Message-----
From: Liam Girdwood [mailto:[email protected]]
Sent: Saturday, October 23, 2010 7:17 PM
To: Nayak, Rajendra
Cc: Axel Lin; linux-kernel; Juha Keski-Saari; Mark Brown
Subject: Re: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeQuoted 14 lines · Mark Brown
Quoted 12 lines · Axel Lin
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write MSB part. To properly set mode, we need to write the complete message ( MSB and LSB ).
In
twl.h, now we have defines for PM Master module register offsets, use it instead of hard coded 0x15/0x16.Use "message &
0xff" to ensure we send correct value for LSB.Signed-off-by Axel Lin <[email protected]>
Quoted 8 lines
Quoted 6 lines
Acked-by Mark Brown <[email protected]>Quoted 2 lines
I don't have this hardware handy, I appreciate if someone who has the hardware can test this patch.
I beleive Liam has appropriate hardware.
Rejendra, care to test this ?
Sure, either me or Lesly will test this on one of the twl4030 based platforms and update.
Quoted 8 lines
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
I have tested it with MMC card inserted on OMAP3630SDP board (using OMAP3 integration tree).
The changes seem to be valid.
The i2c_transfer() returns '1' on success and the twl_i2c_write() which calls i2c_transfer returns '0' if success and err value if it fails.
After writing the MSB if it returns with check:
if (status >= 0)
return status;
It is not writing the LSB.
So it should be:
if (status < 0)
return status;
Regards,
Lesly AM
Quoted 56 lines
-----Original Message-----
From: Nayak, Rajendra [mailto:[email protected]]
Sent: Tuesday, October 26, 2010 3:40 PM
To: Liam Girdwood
Cc: Axel Lin; linux-kernel; Juha Keski-Saari; Mark Brown; Manuel, Lesly Arackal
Subject: RE: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeQuoted 7 lines
-----Original Message-----
From: Liam Girdwood [mailto:[email protected]]
Sent: Saturday, October 23, 2010 7:17 PM
To: Nayak, Rajendra
Cc: Axel Lin; linux-kernel; Juha Keski-Saari; Mark Brown
Subject: Re: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeQuoted 6 lines
Quoted 5 lines · Mark Brown
Quoted 4 lines · Axel Lin
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write MSB
part.
Quoted 1 line
Quoted 1 line
Quoted 1 line
To properly set mode, we need to write the complete message ( MSB
and LSB ).
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
In
twl.h, now we have defines for PM Master module register offsets, use it instead of hard coded 0x15/0x16.Use "message &
0xff" to ensure we send correct value for LSB.Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>Quoted 1 line
I don't have this hardware handy, I appreciate if someone who has
the
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
hardware can test this patch.
I beleive Liam has appropriate hardware.
Rejendra, care to test this ?
Sure, either me or Lesly will test this on one of the twl4030 based platforms
and update.Quoted 8 lines
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
Forgot to mention-
Only omap hsmmc driver is using regulator_set_mode() which will call twlreg_set_mode().
Quoted 86 lines
-----Original Message-----
From: Lesly Arackal Manuel [mailto:[email protected]]
Sent: Thursday, November 04, 2010 3:01 PM
To: 'Nayak, Rajendra'; 'Liam Girdwood'
Cc: 'Axel Lin'; 'linux-kernel'; 'Juha Keski-Saari'; 'Mark Brown'
Subject: RE: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeI have tested it with MMC card inserted on OMAP3630SDP board (using OMAP3 integration tree).
The changes seem to be valid.
The
i2c_transfer()returns '1' on success and thetwl_i2c_write()which callsi2c_transferreturns '0' if success and err value if it fails.After writing the MSB if it returns with check:
if (status >= 0)return status;It is not writing the LSB.
So it should be:
if (status < 0)return status;Regards,
Lesly AMQuoted 23 lines
-----Original Message-----
From: Nayak, Rajendra [mailto:[email protected]]
Sent: Tuesday, October 26, 2010 3:40 PM
To: Liam Girdwood
Cc: Axel Lin; linux-kernel; Juha Keski-Saari; Mark Brown; Manuel, Lesly Arackal
Subject: RE: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeQuoted 13 lines
-----Original Message-----
From: Liam Girdwood [mailto:[email protected]]
Sent: Saturday, October 23, 2010 7:17 PM
To: Nayak, Rajendra
Cc: Axel Lin; linux-kernel; Juha Keski-Saari; Mark Brown
Subject: Re: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeQuoted 5 lines · Mark Brown
Quoted 4 lines · Axel Lin
The Singular Message is 16 bits:
DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0]Current implementation return immedially after sucessfuly write
MSB
Quoted 5 lines
part.
Quoted 1 line
Quoted 1 line
Quoted 1 line
To properly set mode, we need to write the complete message ( MSB
and LSB ).
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
In
twl.h, now we have defines for PM Master module registeroffsets,
Quoted 28 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
use it instead of hard coded 0x15/0x16.
Use "message &
0xff" to ensure we send correct value for LSB.Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>Quoted 1 line
I don't have this hardware handy, I appreciate if someone who has
the
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
hardware can test this patch.
I beleive Liam has appropriate hardware.
Rejendra, care to test this ?
Sure, either me or Lesly will test this on one of the twl4030 based platforms
and update.Quoted 8 lines
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
Liam Girdwood
AppliedQuoted 33 lines · Lesly Arackal Manuel
Forgot to mention-
Only omap hsmmc driver is using
regulator_set_mode()which will calltwlreg_set_mode().Quoted 28 lines
-----Original Message-----
From: Lesly Arackal Manuel [mailto:[email protected]]
Sent: Thursday, November 04, 2010 3:01 PM
To: 'Nayak, Rajendra'; 'Liam Girdwood'
Cc: 'Axel Lin'; 'linux-kernel'; 'Juha Keski-Saari'; 'Mark Brown'
Subject: RE: [PATCH] regulator: twl-regulator - fixtwlreg_set_modeI have tested it with MMC card inserted on OMAP3630SDP board (using OMAP3 integration tree).
The changes seem to be valid.
The
i2c_transfer()returns '1' on success and thetwl_i2c_write()which callsi2c_transferreturns '0' if success and err value if it fails.After writing the MSB if it returns with check:
if (status >= 0)return status;It is not writing the LSB.
So it should be:
if (status < 0)return status;Regards,
Lesly AM
Applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk