Loading drivers/mfd/twl4030-power.c +40 −20 Original line number Original line Diff line number Diff line Loading @@ -492,6 +492,39 @@ int twl4030_remove_script(u8 flags) return err; return err; } } int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) { int err; int i; u8 address = twl4030_start_script_address; for (i = 0; i < pdata->num; i++) { err = load_twl4030_script(pdata->scripts[i], address); if (err) return err; address += pdata->scripts[i]->size; } return 0; } int twl4030_power_configure_resources(struct twl4030_power_data *pdata) { struct twl4030_resconfig *resconfig = pdata->resource_config; int err; if (resconfig) { while (resconfig->resource) { err = twl4030_configure_resource(resconfig); if (err) return err; resconfig++; } } return 0; } /* /* * In master mode, start the power off sequence. * In master mode, start the power off sequence. * After a successful execution, TWL shuts down the power to the SoC * After a successful execution, TWL shuts down the power to the SoC Loading @@ -511,9 +544,7 @@ int twl4030_power_probe(struct platform_device *pdev) { { struct twl4030_power_data *pdata = pdev->dev.platform_data; struct twl4030_power_data *pdata = pdev->dev.platform_data; int err = 0; int err = 0; int i; u8 val; struct twl4030_resconfig *resconfig; u8 val, address = twl4030_start_script_address; err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); TWL4030_PM_MASTER_PROTECT_KEY); Loading @@ -525,23 +556,12 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) if (err) goto unlock; goto unlock; for (i = 0; i < pdata->num; i++) { err = twl4030_power_configure_scripts(pdata); err = load_twl4030_script(pdata->scripts[i], address); if (err) if (err) goto load; goto load; address += pdata->scripts[i]->size; err = twl4030_power_configure_resources(pdata); } resconfig = pdata->resource_config; if (resconfig) { while (resconfig->resource) { err = twl4030_configure_resource(resconfig); if (err) if (err) goto resource; goto resource; resconfig++; } } /* Board has to be wired properly to use this feature */ /* Board has to be wired properly to use this feature */ if (pdata->use_poweroff && !pm_power_off) { if (pdata->use_poweroff && !pm_power_off) { Loading Loading
drivers/mfd/twl4030-power.c +40 −20 Original line number Original line Diff line number Diff line Loading @@ -492,6 +492,39 @@ int twl4030_remove_script(u8 flags) return err; return err; } } int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) { int err; int i; u8 address = twl4030_start_script_address; for (i = 0; i < pdata->num; i++) { err = load_twl4030_script(pdata->scripts[i], address); if (err) return err; address += pdata->scripts[i]->size; } return 0; } int twl4030_power_configure_resources(struct twl4030_power_data *pdata) { struct twl4030_resconfig *resconfig = pdata->resource_config; int err; if (resconfig) { while (resconfig->resource) { err = twl4030_configure_resource(resconfig); if (err) return err; resconfig++; } } return 0; } /* /* * In master mode, start the power off sequence. * In master mode, start the power off sequence. * After a successful execution, TWL shuts down the power to the SoC * After a successful execution, TWL shuts down the power to the SoC Loading @@ -511,9 +544,7 @@ int twl4030_power_probe(struct platform_device *pdev) { { struct twl4030_power_data *pdata = pdev->dev.platform_data; struct twl4030_power_data *pdata = pdev->dev.platform_data; int err = 0; int err = 0; int i; u8 val; struct twl4030_resconfig *resconfig; u8 val, address = twl4030_start_script_address; err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1, TWL4030_PM_MASTER_PROTECT_KEY); TWL4030_PM_MASTER_PROTECT_KEY); Loading @@ -525,23 +556,12 @@ int twl4030_power_probe(struct platform_device *pdev) if (err) if (err) goto unlock; goto unlock; for (i = 0; i < pdata->num; i++) { err = twl4030_power_configure_scripts(pdata); err = load_twl4030_script(pdata->scripts[i], address); if (err) if (err) goto load; goto load; address += pdata->scripts[i]->size; err = twl4030_power_configure_resources(pdata); } resconfig = pdata->resource_config; if (resconfig) { while (resconfig->resource) { err = twl4030_configure_resource(resconfig); if (err) if (err) goto resource; goto resource; resconfig++; } } /* Board has to be wired properly to use this feature */ /* Board has to be wired properly to use this feature */ if (pdata->use_poweroff && !pm_power_off) { if (pdata->use_poweroff && !pm_power_off) { Loading