linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	 Jessica Zhang <quic_jesszhan@quicinc.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	 Matthias Kaehlcke <mka@chromium.org>,
	 Harigovindan P <harigovi@codeaurora.org>,
	 Ritesh Kumar <quic_riteshk@quicinc.com>,
	 Sumit Semwal <sumit.semwal@linaro.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: [PATCH 4/6] drm/panel: novatek-nt36672e: stop calling regulator_set_load manually
Date: Thu, 04 Apr 2024 13:08:02 +0300	[thread overview]
Message-ID: <20240404-drop-panel-unregister-v1-4-9f56953c5fb9@linaro.org> (raw)
In-Reply-To: <20240404-drop-panel-unregister-v1-0-9f56953c5fb9@linaro.org>

Use .init_load_uA part of the bulk regulator API instead of calling
register_set_load() manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
index 9a870b9b6765..20b7bfe4aa12 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36672e.c
@@ -343,17 +343,7 @@ static int nt36672e_1080x2408_60hz_init(struct mipi_dsi_device *dsi)
 static int nt36672e_power_on(struct nt36672e_panel *ctx)
 {
 	struct mipi_dsi_device *dsi = ctx->dsi;
-	int ret, i;
-
-	for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) {
-		ret = regulator_set_load(ctx->supplies[i].consumer,
-				regulator_enable_loads[i]);
-		if (ret) {
-			dev_err(&dsi->dev, "regulator set load failed for supply %s: %d\n",
-				ctx->supplies[i].supply, ret);
-			return ret;
-		}
-	}
+	int ret;
 
 	ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
 	if (ret < 0) {
@@ -550,8 +540,10 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)
 		return -ENODEV;
 	}
 
-	for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++)
+	for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) {
 		ctx->supplies[i].supply = regulator_names[i];
+		ctx->supplies[i].init_load_uA = regulator_enable_loads[i];
+	}
 
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
 			ctx->supplies);

-- 
2.39.2


  parent reply	other threads:[~2024-04-04 10:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 10:07 [PATCH 0/6] drm/panel: small fixes for visionox and novatek panel drivers Dmitry Baryshkov
2024-04-04 10:07 ` [PATCH 1/6] drm/panel: visionox-rm69299: don't unregister DSI device Dmitry Baryshkov
2024-04-05 21:42   ` Jessica Zhang
2024-04-04 10:08 ` [PATCH 2/6] drm/panel: novatek-nt36682e: " Dmitry Baryshkov
2024-04-05 21:43   ` Jessica Zhang
2024-04-04 10:08 ` [PATCH 3/6] drm/panel: novatek-nt36672e: stop setting register load before disable Dmitry Baryshkov
2024-04-24  6:52   ` Neil Armstrong
2024-04-04 10:08 ` Dmitry Baryshkov [this message]
2024-04-17 21:20   ` [PATCH 4/6] drm/panel: novatek-nt36672e: stop calling regulator_set_load manually Jessica Zhang
2024-04-18  0:04     ` Dmitry Baryshkov
2024-04-04 10:08 ` [PATCH 5/6] drm/panel: novatek-nt36672a: " Dmitry Baryshkov
2024-04-24  6:53   ` Neil Armstrong
2024-05-03 17:03   ` Doug Anderson
2024-05-03 20:53     ` Dmitry Baryshkov
2024-04-04 10:08 ` [PATCH 6/6] drm/panel: visionox-rm69299: " Dmitry Baryshkov
2024-04-24  6:53   ` Neil Armstrong
2024-04-16 20:20 ` (subset) [PATCH 0/6] drm/panel: small fixes for visionox and novatek panel drivers Dmitry Baryshkov
2024-04-24  6:59 ` Neil Armstrong

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=20240404-drop-panel-unregister-v1-4-9f56953c5fb9@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harigovi@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mka@chromium.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_riteshk@quicinc.com \
    --cc=sam@ravnborg.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /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).