regulator: lcdb: Add WA for vph_pwr_2p5_ok signal being invalid

The LCDB module does not sample the vph_pwr_2p5_ok signal if it drops
low when the module is off. It will continue with the last known
state of vph_pwr_2p5_ok which could cause a problem if vph_pwr_2p5_ok
is indeed low. Fix this by re-enabling of the module to activate
the vph_pwr_2p5_ok signal sampling.

CRs-Fixed: 1053543
Change-Id: If0950140cae12c92bb6be428b22400b492f823e4
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This commit is contained in:
Anirudh Ghayal 2017-02-23 14:31:29 +05:30
parent d72462d943
commit 2c4d8b12b2
2 changed files with 30 additions and 1 deletions

View file

@ -26,6 +26,13 @@ First Level Node - LCDB module
Value type: <prop-encoded-array>
Definition: Base address of the LCDB SPMI peripheral.
- qcom,force-module-reenable
Usage: required if using SW mode for module enable
Value type: <bool>
Definition: This enables the workaround to force enable
the vph_pwr_2p5_ok signal required for
turning on the LCDB module.
Touch-to-wake (TTW) properties:
TTW supports 2 modes of operation - HW and SW. In the HW mode the enable/disable
@ -59,7 +66,6 @@ main node.
Definition: ON time (in mS) for the VDISP/VDISN signals.
Possible values are 4, 8, 16, 32.
========================================
Second Level Nodes - LDO/NCP/BOOST block
========================================

View file

@ -190,6 +190,9 @@ struct qpnp_lcdb {
bool ttw_enable;
bool ttw_mode_sw;
/* top level DT params */
bool force_module_reenable;
/* status parameters */
bool lcdb_enabled;
bool settings_saved;
@ -588,6 +591,23 @@ static int qpnp_lcdb_enable(struct qpnp_lcdb *lcdb)
goto fail_enable;
}
if (lcdb->force_module_reenable) {
val = 0;
rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_ENABLE_CTL1_REG,
&val, 1);
if (rc < 0) {
pr_err("Failed to enable lcdb rc= %d\n", rc);
goto fail_enable;
}
val = MODULE_EN_BIT;
rc = qpnp_lcdb_write(lcdb, lcdb->base + LCDB_ENABLE_CTL1_REG,
&val, 1);
if (rc < 0) {
pr_err("Failed to disable lcdb rc= %d\n", rc);
goto fail_enable;
}
}
/* poll for vreg_ok */
timeout = 10;
delay = lcdb->bst.soft_start_us + lcdb->ldo.soft_start_us +
@ -1590,6 +1610,9 @@ static int qpnp_lcdb_parse_dt(struct qpnp_lcdb *lcdb)
}
}
lcdb->force_module_reenable = of_property_read_bool(node,
"qcom,force-module-reenable");
if (of_property_read_bool(node, "qcom,ttw-enable")) {
rc = qpnp_lcdb_parse_ttw(lcdb);
if (rc < 0) {