drm: msm: dsi: Don't attempt changing voltage of switches
authorBjorn Andersson <bjorn.andersson@sonymobile.com>
Tue, 18 Aug 2015 17:34:32 +0000 (10:34 -0700)
committerRob Clark <robdclark@gmail.com>
Thu, 22 Oct 2015 19:39:53 +0000 (15:39 -0400)
In some configurations the supplies are voltage switches and not LDOs,
making the set voltage call to fail. Check with the regulator framework
if the supply can change voltage before attempting.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/dsi/dsi_host.c
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c

index 8d82973fe9db72479fe1219abd0b1c8dd0a40f6d..4c49868efcda211ad2ed8397ef4ce1d2043ea63b 100644 (file)
@@ -278,7 +278,7 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
        }
 
        for (i = 0; i < num; i++) {
-               if ((regs[i].min_voltage >= 0) && (regs[i].max_voltage >= 0)) {
+               if (regulator_can_change_voltage(s[i].consumer)) {
                        ret = regulator_set_voltage(s[i].consumer,
                                regs[i].min_voltage, regs[i].max_voltage);
                        if (ret < 0) {
index 401ff58d6893e704b943a7c53f033b93e53abd4c..f1f955f571fa1fa277da91ffc830726edebe32e8 100644 (file)
@@ -178,7 +178,7 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy)
        }
 
        for (i = 0; i < num; i++) {
-               if ((regs[i].min_voltage >= 0) && (regs[i].max_voltage >= 0)) {
+               if (regulator_can_change_voltage(s[i].consumer)) {
                        ret = regulator_set_voltage(s[i].consumer,
                                regs[i].min_voltage, regs[i].max_voltage);
                        if (ret < 0) {