Commit 15cde7ea authored by Douglas Anderson's avatar Douglas Anderson Committed by Rob Clark

drm/msm/dsi: Use the new regulator bulk feature to specify the load

As of commit 6eabfc01 ("regulator: core: Allow specifying an
initial load w/ the bulk API") we can now specify the initial load in
the bulk data rather than having to manually call regulator_set_load()
on each regulator. Let's use it.
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/496319/
Link: https://lore.kernel.org/r/20220804073608.v4.4.I7b3c72949883846badb073cfeae985c55239da1d@changeidSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 0587e9aa
...@@ -262,8 +262,10 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host) ...@@ -262,8 +262,10 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
int num = msm_host->cfg_hnd->cfg->reg_cfg.num; int num = msm_host->cfg_hnd->cfg->reg_cfg.num;
int i, ret; int i, ret;
for (i = 0; i < num; i++) for (i = 0; i < num; i++) {
s[i].supply = regs[i].name; s[i].supply = regs[i].name;
s[i].init_load_uA = regs[i].enable_load;
}
ret = devm_regulator_bulk_get(&msm_host->pdev->dev, num, s); ret = devm_regulator_bulk_get(&msm_host->pdev->dev, num, s);
if (ret < 0) { if (ret < 0) {
...@@ -272,15 +274,6 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host) ...@@ -272,15 +274,6 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
return ret; return ret;
} }
for (i = 0; i < num; i++) {
if (regs[i].enable_load >= 0) {
ret = regulator_set_load(s[i].consumer,
regs[i].enable_load);
if (ret < 0)
return ret;
}
}
return 0; return 0;
} }
......
...@@ -515,8 +515,10 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy) ...@@ -515,8 +515,10 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy)
int num = phy->cfg->reg_cfg.num; int num = phy->cfg->reg_cfg.num;
int i, ret; int i, ret;
for (i = 0; i < num; i++) for (i = 0; i < num; i++) {
s[i].supply = regs[i].name; s[i].supply = regs[i].name;
s[i].init_load_uA = regs[i].enable_load;
}
ret = devm_regulator_bulk_get(dev, num, s); ret = devm_regulator_bulk_get(dev, num, s);
if (ret < 0) { if (ret < 0) {
...@@ -529,15 +531,6 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy) ...@@ -529,15 +531,6 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy)
return ret; return ret;
} }
for (i = 0; i < num; i++) {
if (regs[i].enable_load >= 0) {
ret = regulator_set_load(s[i].consumer,
regs[i].enable_load);
if (ret < 0)
return ret;
}
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment