diff --git a/drivers/regulator/qpnp-lcdb-regulator.c b/drivers/regulator/qpnp-lcdb-regulator.c index 79be62e302ff..b85a5d619e1b 100644 --- a/drivers/regulator/qpnp-lcdb-regulator.c +++ b/drivers/regulator/qpnp-lcdb-regulator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -545,20 +545,18 @@ static int qpnp_lcdb_ttw_enter(struct qpnp_lcdb *lcdb) lcdb->settings_saved = true; } - val = HWEN_RDY_BIT; - rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_ENABLE_CTL1_REG, - &val, 1); - if (rc < 0) { - pr_err("Failed to hw_enable lcdb rc= %d\n", rc); - return rc; - } - val = (BST_SS_TIME_OVERRIDE_1MS << BST_SS_TIME_OVERRIDE_SHIFT) | (DIS_BST_PRECHG_SHORT_ALARM << BST_PRECHG_SHORT_ALARM_SHIFT); rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_BST_SS_CTL_REG, &val, 1); if (rc < 0) return rc; + val = 0; + rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_NCP_SOFT_START_CTL_REG, + &val, 1); + if (rc < 0) + return rc; + val = 0; rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_LDO_SOFT_START_CTL_REG, &val, 1); @@ -566,37 +564,37 @@ static int qpnp_lcdb_ttw_enter(struct qpnp_lcdb *lcdb) return rc; val = 0; - rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_NCP_SOFT_START_CTL_REG, + rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_PWRUP_PWRDN_CTL_REG, + &val, 1); + if (rc < 0) + return rc; + + val = 0; + rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_BST_VREG_OK_CTL_REG, &val, 1); if (rc < 0) return rc; - val = BOOST_DIS_PULLDOWN_BIT | BOOST_PD_STRENGTH_BIT; + val = BOOST_DIS_PULLDOWN_BIT; rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_BST_PD_CTL_REG, &val, 1); if (rc < 0) return rc; - val = LDO_DIS_PULLDOWN_BIT | LDO_PD_STRENGTH_BIT; + val = LDO_DIS_PULLDOWN_BIT; rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_LDO_PD_CTL_REG, &val, 1); if (rc < 0) return rc; - val = NCP_DIS_PULLDOWN_BIT | NCP_PD_STRENGTH_BIT; + val = NCP_DIS_PULLDOWN_BIT; rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_NCP_PD_CTL_REG, &val, 1); if (rc < 0) return rc; - val = 0; - rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_PWRUP_PWRDN_CTL_REG, - &val, 1); - if (rc < 0) - return rc; - - val = 0; - rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_BST_VREG_OK_CTL_REG, + val = HWEN_RDY_BIT; + rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_ENABLE_CTL1_REG, &val, 1); return rc;