提交 b9e26bc8 编写于 作者: A Axel Lin 提交者: Liam Girdwood

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.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: NLesly Arackal Manuel <leslyam@ti.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 3aa713e7
......@@ -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);
}
/*----------------------------------------------------------------------*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册