mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "regulator: qpnp-lcdb: Add support for NCP symmetry with LDO"
This commit is contained in:
commit
d6880ae4e7
1 changed files with 16 additions and 1 deletions
|
|
@ -182,6 +182,7 @@
|
|||
|
||||
/* NCP */
|
||||
#define LCDB_NCP_OUTPUT_VOLTAGE_REG 0x81
|
||||
#define EN_NCP_VOUT_SYMMETRY_BIT BIT(7)
|
||||
|
||||
#define LCDB_NCP_VREG_OK_CTL_REG 0x85
|
||||
|
||||
|
|
@ -282,6 +283,7 @@ struct qpnp_lcdb {
|
|||
int min_voltage_mv;
|
||||
int max_voltage_mv;
|
||||
int pwrup_config;
|
||||
bool ncp_symmetry;
|
||||
|
||||
/* TTW params */
|
||||
bool ttw_enable;
|
||||
|
|
@ -1525,7 +1527,8 @@ static int qpnp_lcdb_get_voltage(struct qpnp_lcdb *lcdb,
|
|||
if (type == BST)
|
||||
return qpnp_lcdb_get_bst_voltage(lcdb, voltage_mv);
|
||||
|
||||
if (type == NCP)
|
||||
/* When symmetry is enabled, NCP voltage directly follows LDO voltage */
|
||||
if (type == NCP && !lcdb->ncp_symmetry)
|
||||
offset = LCDB_NCP_OUTPUT_VOLTAGE_REG;
|
||||
|
||||
rc = qpnp_lcdb_read(lcdb, lcdb->base + offset, &val, 1);
|
||||
|
|
@ -2465,6 +2468,15 @@ static int qpnp_lcdb_hw_init(struct qpnp_lcdb *lcdb)
|
|||
return rc;
|
||||
}
|
||||
|
||||
if (lcdb->ncp_symmetry) {
|
||||
rc = qpnp_lcdb_masked_write(lcdb, lcdb->base +
|
||||
LCDB_NCP_OUTPUT_VOLTAGE_REG,
|
||||
EN_NCP_VOUT_SYMMETRY_BIT,
|
||||
EN_NCP_VOUT_SYMMETRY_BIT);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = qpnp_lcdb_init_bst(lcdb);
|
||||
if (rc < 0) {
|
||||
pr_err("Failed to initialize BOOST rc=%d\n", rc);
|
||||
|
|
@ -2588,6 +2600,9 @@ static int qpnp_lcdb_parse_dt(struct qpnp_lcdb *lcdb)
|
|||
lcdb->voltage_step_ramp =
|
||||
of_property_read_bool(node, "qcom,voltage-step-ramp");
|
||||
|
||||
lcdb->ncp_symmetry =
|
||||
of_property_read_bool(node, "qcom,ncp-symmetry");
|
||||
|
||||
lcdb->pwrdn_delay_ms = -EINVAL;
|
||||
lcdb->pwrup_delay_ms = -EINVAL;
|
||||
lcdb->pwrup_config = -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue