diff options
| author | Tony Truong <truong@codeaurora.org> | 2015-07-27 11:18:02 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:09:25 -0700 |
| commit | 2fffc929255c31ba5ca50fa7ec0000997168bbef (patch) | |
| tree | 65138cfcf0a25db33f442e71ea10730e7bdc214e | |
| parent | c7d584360606b93af50869c2488a4dfcf70200a1 (diff) | |
msm: pcie: remove PCIe CX rail vote when releasing resources
Current PMIC API call to disable CX rail does not remove
PCIe power vote. Add another API call to successfully
remove vote when releasing this resource.
Change-Id: I5203203e10e8e690745768c241e92d298b87cc4b
Signed-off-by: Tony Truong <truong@codeaurora.org>
| -rw-r--r-- | drivers/pci/host/pci-msm.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/pci/host/pci-msm.c b/drivers/pci/host/pci-msm.c index 816d8249920b..e4e2a805445c 100644 --- a/drivers/pci/host/pci-msm.c +++ b/drivers/pci/host/pci-msm.c @@ -26,6 +26,7 @@ #include <linux/pci.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> +#include <linux/regulator/rpm-smd-regulator.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/of_gpio.h> @@ -2718,8 +2719,19 @@ int msm_pcie_vreg_init(struct msm_pcie_dev_t *dev) if (rc) while (i--) { struct regulator *hdl = dev->vreg[i].hdl; - if (hdl) + if (hdl) { regulator_disable(hdl); + if (!strcmp(dev->vreg[i].name, "vreg-cx")) { + PCIE_DBG(dev, + "RC%d: Removing %s vote.\n", + dev->rc_idx, + dev->vreg[i].name); + regulator_set_voltage(hdl, + RPM_REGULATOR_CORNER_NONE, + INT_MAX); + } + } + } PCIE_DBG(dev, "RC%d: exit\n", dev->rc_idx); @@ -2738,6 +2750,16 @@ static void msm_pcie_vreg_deinit(struct msm_pcie_dev_t *dev) PCIE_DBG(dev, "Vreg %s is being disabled\n", dev->vreg[i].name); regulator_disable(dev->vreg[i].hdl); + + if (!strcmp(dev->vreg[i].name, "vreg-cx")) { + PCIE_DBG(dev, + "RC%d: Removing %s vote.\n", + dev->rc_idx, + dev->vreg[i].name); + regulator_set_voltage(dev->vreg[i].hdl, + RPM_REGULATOR_CORNER_NONE, + INT_MAX); + } } } |
