mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
mfd: twl4030-power: Fix some defines for SW_EVENTS
We have these bits partially defined in two different places, so let's fix them up and add defines for the missing bits. These bits are the same for P1_SW_EVENTS, P2_SW_EVENTS and P3_SW_EVENTS. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
fc7d76e4c0
commit
320572813d
1 changed files with 15 additions and 12 deletions
|
@ -34,8 +34,15 @@
|
||||||
|
|
||||||
static u8 twl4030_start_script_address = 0x2b;
|
static u8 twl4030_start_script_address = 0x2b;
|
||||||
|
|
||||||
#define PWR_P1_SW_EVENTS 0x10
|
/* Register bits for P1, P2 and P3_SW_EVENTS */
|
||||||
#define PWR_DEVOFF (1 << 0)
|
#define PWR_STOPON_PRWON BIT(6)
|
||||||
|
#define PWR_STOPON_SYSEN BIT(5)
|
||||||
|
#define PWR_ENABLE_WARMRESET BIT(4)
|
||||||
|
#define PWR_LVL_WAKEUP BIT(3)
|
||||||
|
#define PWR_DEVACT BIT(2)
|
||||||
|
#define PWR_DEVSLP BIT(1)
|
||||||
|
#define PWR_DEVOFF BIT(0)
|
||||||
|
|
||||||
#define SEQ_OFFSYNC (1 << 0)
|
#define SEQ_OFFSYNC (1 << 0)
|
||||||
|
|
||||||
#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36)
|
#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36)
|
||||||
|
@ -52,10 +59,6 @@ static u8 twl4030_start_script_address = 0x2b;
|
||||||
#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37)
|
#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37)
|
||||||
#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38)
|
#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38)
|
||||||
|
|
||||||
#define LVL_WAKEUP 0x08
|
|
||||||
|
|
||||||
#define ENABLE_WARMRESET (1<<4)
|
|
||||||
|
|
||||||
#define END_OF_SCRIPT 0x3f
|
#define END_OF_SCRIPT 0x3f
|
||||||
|
|
||||||
#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55)
|
#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55)
|
||||||
|
@ -196,7 +199,7 @@ static int twl4030_config_wakeup3_sequence(u8 address)
|
||||||
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS);
|
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
data |= LVL_WAKEUP;
|
data |= PWR_LVL_WAKEUP;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS);
|
||||||
out:
|
out:
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -219,7 +222,7 @@ static int twl4030_config_wakeup12_sequence(u8 address)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
data |= LVL_WAKEUP;
|
data |= PWR_LVL_WAKEUP;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -228,7 +231,7 @@ static int twl4030_config_wakeup12_sequence(u8 address)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
data |= LVL_WAKEUP;
|
data |= PWR_LVL_WAKEUP;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -281,7 +284,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rd_data |= ENABLE_WARMRESET;
|
rd_data |= PWR_ENABLE_WARMRESET;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -290,7 +293,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rd_data |= ENABLE_WARMRESET;
|
rd_data |= PWR_ENABLE_WARMRESET;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -299,7 +302,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rd_data |= ENABLE_WARMRESET;
|
rd_data |= PWR_ENABLE_WARMRESET;
|
||||||
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS);
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS);
|
||||||
out:
|
out:
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in a new issue