diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-28 00:46:49 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-28 00:46:49 -0800 |
| commit | e30aabb3fcc207f0b4f84db0d0f19092110727f6 (patch) | |
| tree | 1846ba43753c7e77002ad1a8cfa3405e80266d58 | |
| parent | f11f069c5f83c22075edf843a3b785668627ac12 (diff) | |
| parent | 7b39a54287c1cef8db5634a471b5318520419155 (diff) | |
Merge "ARM: dts: msm: Add LAB-IBB/OLEDB support for PM660A"
| -rw-r--r-- | arch/arm/boot/dts/qcom/msm-pm660a.dtsi | 10 | ||||
| -rw-r--r-- | arch/arm/boot/dts/qcom/msm-pm660l.dtsi | 55 | ||||
| -rw-r--r-- | drivers/regulator/qpnp-labibb-regulator.c | 10 | ||||
| -rw-r--r-- | drivers/regulator/qpnp-oledb-regulator.c | 30 |
4 files changed, 89 insertions, 16 deletions
diff --git a/arch/arm/boot/dts/qcom/msm-pm660a.dtsi b/arch/arm/boot/dts/qcom/msm-pm660a.dtsi index c43aa5425aae..bfe1b5aa831b 100644 --- a/arch/arm/boot/dts/qcom/msm-pm660a.dtsi +++ b/arch/arm/boot/dts/qcom/msm-pm660a.dtsi @@ -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 @@ -19,3 +19,11 @@ &pm660l_lcdb { status = "disabled"; }; + +&pm660a_oledb { + status = "okay"; +}; + +&pm660a_labibb { + status = "okay"; +}; diff --git a/arch/arm/boot/dts/qcom/msm-pm660l.dtsi b/arch/arm/boot/dts/qcom/msm-pm660l.dtsi index 3ac4c851f5ba..cdb3662a1a56 100644 --- a/arch/arm/boot/dts/qcom/msm-pm660l.dtsi +++ b/arch/arm/boot/dts/qcom/msm-pm660l.dtsi @@ -404,5 +404,60 @@ regulator-max-microvolt = <6000000>; }; }; + + pm660a_oledb: qpnp-oledb@e000 { + compatible = "qcom,qpnp-oledb-regulator"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0xe000 0x100>; + + label = "oledb"; + regulator-name = "regulator-oledb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <8100000>; + + qcom,swire-control; + qcom,ext-pin-control; + status = "disabled"; + }; + + pm660a_labibb: qpnp-labibb-regulator { + compatible = "qcom,qpnp-labibb-regulator"; + #address-cells = <1>; + #size-cells = <1>; + qcom,pmic-revid = <&pm660l_revid>; + qcom,swire-control; + status = "disabled"; + + ibb_regulator: qcom,ibb@dc00 { + reg = <0xdc00 0x100>; + reg-names = "ibb_reg"; + regulator-name = "ibb_reg"; + + regulator-min-microvolt = <4000000>; + regulator-max-microvolt = <6300000>; + + qcom,qpnp-ibb-min-voltage = <1400000>; + qcom,qpnp-ibb-step-size = <100000>; + qcom,qpnp-ibb-slew-rate = <2000000>; + qcom,qpnp-ibb-init-voltage = <4000000>; + qcom,qpnp-ibb-init-amoled-voltage = <4000000>; + }; + + lab_regulator: qcom,lab@de00 { + reg = <0xde00 0x100>; + reg-names = "lab"; + regulator-name = "lab_reg"; + + regulator-min-microvolt = <4600000>; + regulator-max-microvolt = <6100000>; + + qcom,qpnp-lab-min-voltage = <4600000>; + qcom,qpnp-lab-step-size = <100000>; + qcom,qpnp-lab-slew-rate = <5000>; + qcom,qpnp-lab-init-voltage = <4600000>; + qcom,qpnp-lab-init-amoled-voltage = <4600000>; + }; + }; }; }; 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 == |
