From: Douglas Anderson <dianders@chromium.org>
To: Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Mark Brown <broonie@kernel.org>
Cc: Sean Paul <sean@poorly.run>, Jonathan Marek <jonathan@marek.ca>,
David Airlie <airlied@linux.ie>,
linux-arm-msm@vger.kernel.org,
Vladimir Lypak <vladimir.lypak@gmail.com>,
Douglas Anderson <dianders@chromium.org>,
dri-devel@lists.freedesktop.org,
Stephen Boyd <swboyd@chromium.org>, Vinod Koul <vkoul@kernel.org>,
Rajeev Nandan <quic_rajeevny@quicinc.com>,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/7] drm/msm/dsi: Use the new regulator bulk feature to specify the load
Date: Tue, 26 Jul 2022 10:38:22 -0700 [thread overview]
Message-ID: <20220726103631.v2.5.I7b3c72949883846badb073cfeae985c55239da1d@changeid> (raw)
In-Reply-To: <20220726173824.1166873-1-dianders@chromium.org>
As of the patch ("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: Douglas Anderson <dianders@chromium.org>
---
Changes in v2:
- ("Use the new regulator bulk feature to specify the load") new for v2.
drivers/gpu/drm/msm/dsi/dsi_host.c | 13 +++----------
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 13 +++----------
2 files changed, 6 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 04265ad2fbef..dec7a94cf819 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -279,8 +279,10 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
int num = msm_host->cfg_hnd->cfg->reg_cfg.num;
int i, ret;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++) {
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);
if (ret < 0) {
@@ -289,15 +291,6 @@ static int dsi_regulator_init(struct msm_dsi_host *msm_host)
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;
}
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 330c0c4e7f9d..f42ff57861da 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -515,8 +515,10 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy)
int num = phy->cfg->reg_cfg.num;
int i, ret;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++) {
s[i].supply = regs[i].name;
+ s[i].init_load_uA = regs[i].enable_load;
+ }
ret = devm_regulator_bulk_get(dev, num, s);
if (ret < 0) {
@@ -529,15 +531,6 @@ static int dsi_phy_regulator_init(struct msm_dsi_phy *phy)
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;
}
--
2.37.1.359.gd136c6c3e2-goog
next prev parent reply other threads:[~2022-07-26 17:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 17:38 [PATCH v2 0/7] drm/msm/dsi regulator improvements Douglas Anderson
2022-07-26 17:38 ` [PATCH v2 1/7] drm/msm/dsi: Fix number of regulators for msm8996_dsi_cfg Douglas Anderson
2022-07-26 17:38 ` [PATCH v2 2/7] drm/msm/dsi: Fix number of regulators for SDM660 Douglas Anderson
2022-07-26 17:38 ` [PATCH v2 3/7] drm/msm/dsi: Don't set a load before disabling a regulator Douglas Anderson
2022-07-26 17:38 ` [PATCH v2 4/7] regulator: core: Allow specifying an initial load w/ the bulk API Douglas Anderson
2022-08-16 12:58 ` Yongqin Liu
2022-08-17 14:25 ` Doug Anderson
2022-08-17 16:52 ` Yongqin Liu
2022-08-23 6:22 ` Yongqin Liu
2022-08-23 14:50 ` Doug Anderson
2022-08-23 18:24 ` Yongqin Liu
2022-07-26 17:38 ` Douglas Anderson [this message]
2022-07-26 17:38 ` [PATCH v2 6/7] regulator: core: Allow drivers to define their init data as const Douglas Anderson
2022-07-26 17:38 ` [PATCH v2 7/7] drm/msm/dsi: Take advantage of devm_regulator_bulk_get_const() Douglas Anderson
2022-07-27 23:02 ` (subset) [PATCH v2 0/7] drm/msm/dsi regulator improvements Mark Brown
2022-07-28 0:20 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220726103631.v2.5.I7b3c72949883846badb073cfeae985c55239da1d@changeid \
--to=dianders@chromium.org \
--cc=airlied@linux.ie \
--cc=broonie@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jonathan@marek.ca \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_rajeevny@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
--cc=vkoul@kernel.org \
--cc=vladimir.lypak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).