summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-28 00:46:49 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-28 00:46:49 -0800
commite30aabb3fcc207f0b4f84db0d0f19092110727f6 (patch)
tree1846ba43753c7e77002ad1a8cfa3405e80266d58 /drivers/regulator
parentf11f069c5f83c22075edf843a3b785668627ac12 (diff)
parent7b39a54287c1cef8db5634a471b5318520419155 (diff)
Merge "ARM: dts: msm: Add LAB-IBB/OLEDB support for PM660A"
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/qpnp-labibb-regulator.c10
-rw-r--r--drivers/regulator/qpnp-oledb-regulator.c30
2 files changed, 25 insertions, 15 deletions
diff --git a/drivers/regulator/qpnp-labibb-regulator.c b/drivers/regulator/qpnp-labibb-regulator.c
index 67b97256da1f..9a8a3b18d03a 100644
--- a/drivers/regulator/qpnp-labibb-regulator.c
+++ b/drivers/regulator/qpnp-labibb-regulator.c
@@ -2643,7 +2643,8 @@ static int register_qpnp_lab_regulator(struct qpnp_labibb *labibb,
return rc;
}
- if (labibb->mode == QPNP_LABIBB_AMOLED_MODE) {
+ if (labibb->mode == QPNP_LABIBB_AMOLED_MODE &&
+ labibb->pmic_rev_id->pmic_subtype != PM660L_SUBTYPE) {
/*
* default to 1.5 times current gain if
* user doesn't specify the current-sense
@@ -2684,7 +2685,7 @@ static int register_qpnp_lab_regulator(struct qpnp_labibb *labibb,
val = (labibb->standalone) ? 0 : LAB_IBB_EN_RDY_EN;
rc = qpnp_labibb_sec_write(labibb, labibb->lab_base,
- REG_LAB_IBB_EN_RDY, val);
+ REG_LAB_IBB_EN_RDY, val);
if (rc < 0) {
pr_err("qpnp_lab_sec_write register %x failed rc = %d\n",
@@ -3829,9 +3830,10 @@ static int qpnp_labibb_regulator_probe(struct platform_device *pdev)
}
}
dev_set_drvdata(&pdev->dev, labibb);
- pr_info("LAB/IBB registered successfully, lab_vreg enable=%d ibb_vreg enable=%d\n",
+ pr_info("LAB/IBB registered successfully, lab_vreg enable=%d ibb_vreg enable=%d swire_control=%d\n",
labibb->lab_vreg.vreg_enabled,
- labibb->ibb_vreg.vreg_enabled);
+ labibb->ibb_vreg.vreg_enabled,
+ labibb->swire_control);
return 0;
diff --git a/drivers/regulator/qpnp-oledb-regulator.c b/drivers/regulator/qpnp-oledb-regulator.c
index dd52b74b11b6..587538cca474 100644
--- a/drivers/regulator/qpnp-oledb-regulator.c
+++ b/drivers/regulator/qpnp-oledb-regulator.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2017, 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
@@ -152,6 +152,8 @@ struct qpnp_oledb {
struct qpnp_oledb_fast_precharge_ctl fast_prechg_ctl;
u32 base;
+ u8 mod_enable;
+ u8 ext_pinctl_state;
int current_voltage;
int default_voltage;
int vout_mv;
@@ -162,10 +164,8 @@ struct qpnp_oledb {
int nlimit_enable;
int sc_en;
int sc_dbnc_time;
- bool mod_enable;
bool swire_control;
bool ext_pin_control;
- bool ext_pinctl_state;
bool dynamic_ext_pinctl_config;
bool pbs_control;
};
@@ -292,12 +292,15 @@ static int qpnp_oledb_regulator_disable(struct regulator_dev *rdev)
* Disable ext-pin-ctl after display-supply is turned off. This is to
* avoid glitches on the external pin.
*/
- if (oledb->ext_pin_control && oledb->dynamic_ext_pinctl_config) {
- rc = qpnp_oledb_masked_write(oledb, oledb->base +
+ if (oledb->ext_pin_control) {
+ if (oledb->dynamic_ext_pinctl_config) {
+ rc = qpnp_oledb_masked_write(oledb, oledb->base +
OLEDB_EXT_PIN_CTL, OLEDB_EXT_PIN_CTL_BIT, 0);
- if (rc < 0) {
- pr_err("Failed to write EXT_PIN_CTL rc=%d\n", rc);
- return rc;
+ if (rc < 0) {
+ pr_err("Failed to write EXT_PIN_CTL rc=%d\n",
+ rc);
+ return rc;
+ }
}
pr_debug("ext-pin-ctrl mode disabled\n");
} else {
@@ -635,14 +638,14 @@ static int qpnp_oledb_hw_init(struct qpnp_oledb *oledb)
}
rc = qpnp_oledb_read(oledb, oledb->base + OLEDB_MODULE_ENABLE,
- (u8 *)&oledb->mod_enable, 1);
+ &oledb->mod_enable, 1);
if (rc < 0) {
pr_err("Failed to read MODULE_ENABLE rc=%d\n", rc);
return rc;
}
rc = qpnp_oledb_read(oledb, oledb->base + OLEDB_EXT_PIN_CTL,
- (u8 *)&oledb->ext_pinctl_state, 1);
+ &oledb->ext_pinctl_state, 1);
if (rc < 0) {
pr_err("Failed to read EXT_PIN_CTL rc=%d\n", rc);
return rc;
@@ -652,7 +655,12 @@ static int qpnp_oledb_hw_init(struct qpnp_oledb *oledb)
if (rc < 0)
return rc;
- if (!((val & OLEDB_EXT_PIN_CTL_BIT) || oledb->mod_enable)) {
+ /*
+ * Go through if the module is not enabled either through
+ * external pin control or SPMI interface.
+ */
+ if (!((oledb->ext_pinctl_state & OLEDB_EXT_PIN_CTL_BIT)
+ || oledb->mod_enable)) {
if (oledb->warmup_delay != -EINVAL) {
for (i = 0; i < ARRAY_SIZE(oledb_warmup_dly_ns); i++) {
if (oledb->warmup_delay ==