|
@@ -264,7 +264,9 @@ out:
|
|
|
return err;
|
|
return err;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int twl4030_config_wakeup12_sequence(u8 address)
|
|
|
|
|
|
|
+static int
|
|
|
|
|
+twl4030_config_wakeup12_sequence(const struct twl4030_power_data *pdata,
|
|
|
|
|
+ u8 address)
|
|
|
{
|
|
{
|
|
|
int err = 0;
|
|
int err = 0;
|
|
|
u8 data;
|
|
u8 data;
|
|
@@ -293,13 +295,14 @@ static int twl4030_config_wakeup12_sequence(u8 address)
|
|
|
if (err)
|
|
if (err)
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
- if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
|
|
|
|
|
|
|
+ if (pdata->ac_charger_quirk || machine_is_omap_3430sdp() ||
|
|
|
|
|
+ machine_is_omap_ldp()) {
|
|
|
/* Disabling AC charger effect on sleep-active transitions */
|
|
/* Disabling AC charger effect on sleep-active transitions */
|
|
|
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data,
|
|
err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data,
|
|
|
R_CFG_P1_TRANSITION);
|
|
R_CFG_P1_TRANSITION);
|
|
|
if (err)
|
|
if (err)
|
|
|
goto out;
|
|
goto out;
|
|
|
- data &= ~(1<<1);
|
|
|
|
|
|
|
+ data &= ~STARTON_CHG;
|
|
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data,
|
|
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data,
|
|
|
R_CFG_P1_TRANSITION);
|
|
R_CFG_P1_TRANSITION);
|
|
|
if (err)
|
|
if (err)
|
|
@@ -459,8 +462,9 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int load_twl4030_script(struct twl4030_script *tscript,
|
|
|
|
|
- u8 address)
|
|
|
|
|
|
|
+static int load_twl4030_script(const struct twl4030_power_data *pdata,
|
|
|
|
|
+ struct twl4030_script *tscript,
|
|
|
|
|
+ u8 address)
|
|
|
{
|
|
{
|
|
|
int err;
|
|
int err;
|
|
|
static int order;
|
|
static int order;
|
|
@@ -487,7 +491,7 @@ static int load_twl4030_script(struct twl4030_script *tscript,
|
|
|
if (err)
|
|
if (err)
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
- err = twl4030_config_wakeup12_sequence(address);
|
|
|
|
|
|
|
+ err = twl4030_config_wakeup12_sequence(pdata, address);
|
|
|
if (err)
|
|
if (err)
|
|
|
goto out;
|
|
goto out;
|
|
|
order = 1;
|
|
order = 1;
|
|
@@ -567,7 +571,7 @@ twl4030_power_configure_scripts(const struct twl4030_power_data *pdata)
|
|
|
u8 address = twl4030_start_script_address;
|
|
u8 address = twl4030_start_script_address;
|
|
|
|
|
|
|
|
for (i = 0; i < pdata->num; i++) {
|
|
for (i = 0; i < pdata->num; i++) {
|
|
|
- err = load_twl4030_script(pdata->scripts[i], address);
|
|
|
|
|
|
|
+ err = load_twl4030_script(pdata, pdata->scripts[i], address);
|
|
|
if (err)
|
|
if (err)
|
|
|
return err;
|
|
return err;
|
|
|
address += pdata->scripts[i]->size;
|
|
address += pdata->scripts[i]->size;
|
|
@@ -829,6 +833,21 @@ static struct twl4030_power_data osc_off_idle = {
|
|
|
.board_config = osc_off_rconfig,
|
|
.board_config = osc_off_rconfig,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+static struct twl4030_power_data omap3_idle_ac_quirk = {
|
|
|
|
|
+ .scripts = omap3_idle_scripts,
|
|
|
|
|
+ .num = ARRAY_SIZE(omap3_idle_scripts),
|
|
|
|
|
+ .resource_config = omap3_idle_rconfig,
|
|
|
|
|
+ .ac_charger_quirk = true,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static struct twl4030_power_data omap3_idle_ac_quirk_osc_off = {
|
|
|
|
|
+ .scripts = omap3_idle_scripts,
|
|
|
|
|
+ .num = ARRAY_SIZE(omap3_idle_scripts),
|
|
|
|
|
+ .resource_config = omap3_idle_rconfig,
|
|
|
|
|
+ .board_config = osc_off_rconfig,
|
|
|
|
|
+ .ac_charger_quirk = true,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
static const struct of_device_id twl4030_power_of_match[] = {
|
|
static const struct of_device_id twl4030_power_of_match[] = {
|
|
|
{
|
|
{
|
|
|
.compatible = "ti,twl4030-power",
|
|
.compatible = "ti,twl4030-power",
|
|
@@ -845,6 +864,18 @@ static const struct of_device_id twl4030_power_of_match[] = {
|
|
|
.compatible = "ti,twl4030-power-idle-osc-off",
|
|
.compatible = "ti,twl4030-power-idle-osc-off",
|
|
|
.data = &osc_off_idle,
|
|
.data = &osc_off_idle,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ .compatible = "ti,twl4030-power-omap3-sdp",
|
|
|
|
|
+ .data = &omap3_idle_ac_quirk,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .compatible = "ti,twl4030-power-omap3-ldp",
|
|
|
|
|
+ .data = &omap3_idle_ac_quirk_osc_off,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .compatible = "ti,twl4030-power-omap3-evm",
|
|
|
|
|
+ .data = &omap3_idle_ac_quirk,
|
|
|
|
|
+ },
|
|
|
{ },
|
|
{ },
|
|
|
};
|
|
};
|
|
|
MODULE_DEVICE_TABLE(of, twl4030_power_of_match);
|
|
MODULE_DEVICE_TABLE(of, twl4030_power_of_match);
|