diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2013-10-01 15:38:43 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2013-10-01 15:38:43 -0700 |
| commit | 95761b25ea31a34b740aaa1affd2d449e929c8de (patch) | |
| tree | 71b9b4db140ff4e2ff34ca9c209e8271578dc43e | |
| parent | 2672bfaf0fffa79daed99fe4e46a16cc12714ea9 (diff) | |
| parent | 6075b5443653b436c3367f9892c0247ceca55513 (diff) | |
Merge "msm: spm-regulator: add support for specifying CPU mapping"
| -rw-r--r-- | Documentation/devicetree/bindings/arm/msm/spm-regulator.txt | 2 | ||||
| -rw-r--r-- | arch/arm/mach-msm/spm-regulator.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/arm/msm/spm-regulator.txt b/Documentation/devicetree/bindings/arm/msm/spm-regulator.txt index 3c42ac44812..90fae4802c4 100644 --- a/Documentation/devicetree/bindings/arm/msm/spm-regulator.txt +++ b/Documentation/devicetree/bindings/arm/msm/spm-regulator.txt @@ -18,6 +18,8 @@ Optional properties: robust, but draws more current than auto mode. If this property is not specified, then the regulator will remain in whatever mode hardware or bootloaders set it to. +- qcom,cpu-num: Specifies which CPU this regulator powers. This property is + not need when the SPM regulator is shared between all CPUs. All properties specified within the core regulator framework can also be used. These bindings can be found in regulator.txt. diff --git a/arch/arm/mach-msm/spm-regulator.c b/arch/arm/mach-msm/spm-regulator.c index 018b9ae9fbb..0b03ef2a1be 100644 --- a/arch/arm/mach-msm/spm-regulator.c +++ b/arch/arm/mach-msm/spm-regulator.c @@ -90,6 +90,7 @@ struct spm_vreg { u16 spmi_base_addr; u8 init_mode; int step_rate; + u32 cpu_num; }; static int qpnp_fts2_set_mode(struct spm_vreg *vreg, u8 mode) @@ -121,7 +122,7 @@ static int _spm_regulator_set_voltage(struct regulator_dev *rdev) return rc; } - rc = msm_spm_set_vdd(0, vreg->vlevel); /* value of CPU is don't care */ + rc = msm_spm_set_vdd(vreg->cpu_num, vreg->vlevel); if (rc) { pr_err("%s: msm_spm_set_vdd failed %d\n", vreg->rdesc.name, rc); return rc; @@ -415,6 +416,11 @@ static int spm_regulator_probe(struct spmi_device *spmi) if (rc) return rc; + /* Specify CPU 0 as default in order to handle shared regulator case. */ + vreg->cpu_num = 0; + of_property_read_u32(vreg->spmi_dev->dev.of_node, "qcom,cpu-num", + &vreg->cpu_num); + /* * The FTS2 regulator must be initialized to range 0 or range 1 during * PMIC power on sequence. Once it is set, it cannot be changed |
