[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251118-pixel-3-v3-6-317a2b400d8a@ixit.cz>
Date: Tue, 18 Nov 2025 12:30:41 +0100
From: David Heidelberg via B4 Relay <devnull+david.ixit.cz@...nel.org>
To: Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Sumit Semwal <sumit.semwal@...aro.org>,
Casey Connolly <casey.connolly@...aro.org>,
Neil Armstrong <neil.armstrong@...aro.org>,
Jessica Zhang <jesszhan0024@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>
Cc: phodina@...tonmail.com, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
phone-devel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
David Heidelberg <david@...t.cz>
Subject: [PATCH v3 6/8] drm/panel: sw43408: Switch to
devm_regulator_bulk_get_const
From: David Heidelberg <david@...t.cz>
Switch to devm_regulator_bulk_get_const() to stop setting the supplies
list in probe(), and move the regulator_bulk_data struct in static const.
Signed-off-by: David Heidelberg <david@...t.cz>
---
drivers/gpu/drm/panel/panel-lg-sw43408.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c
index d8481bdafd6dd..0a902470e03fa 100644
--- a/drivers/gpu/drm/panel/panel-lg-sw43408.c
+++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c
@@ -20,13 +20,18 @@
#include <drm/display/drm_dsc.h>
#include <drm/display/drm_dsc_helper.h>
-#define NUM_SUPPLIES 2
+static const struct regulator_bulk_data sw43408_supplies[] = {
+ { .supply = "vddi", /* 1.88V */
+ .init_load_uA = 62000 },
+ { .supply = "vpnl", /* 3.0 V */
+ .init_load_uA = 857000 },
+};
struct sw43408_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
- struct regulator_bulk_data supplies[NUM_SUPPLIES];
+ struct regulator_bulk_data *supplies;
struct gpio_desc *reset_gpio;
@@ -59,7 +64,7 @@ static int sw43408_unprepare(struct drm_panel *panel)
gpiod_set_value(sw43408->reset_gpio, 1);
- ret = regulator_bulk_disable(ARRAY_SIZE(sw43408->supplies), sw43408->supplies);
+ ret = regulator_bulk_disable(ARRAY_SIZE(sw43408_supplies), sw43408->supplies);
return ret;
}
@@ -152,7 +157,7 @@ static int sw43408_prepare(struct drm_panel *panel)
struct sw43408_panel *ctx = to_panel_info(panel);
int ret;
- ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+ ret = regulator_bulk_enable(ARRAY_SIZE(sw43408_supplies), ctx->supplies);
if (ret < 0)
return ret;
@@ -166,7 +171,7 @@ static int sw43408_prepare(struct drm_panel *panel)
poweroff:
gpiod_set_value(ctx->reset_gpio, 1);
- regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+ regulator_bulk_disable(ARRAY_SIZE(sw43408_supplies), ctx->supplies);
return ret;
}
@@ -249,13 +254,10 @@ static int sw43408_add(struct sw43408_panel *ctx)
struct device *dev = &ctx->link->dev;
int ret;
- ctx->supplies[0].supply = "vddi"; /* 1.88 V */
- ctx->supplies[0].init_load_uA = 62000;
- ctx->supplies[1].supply = "vpnl"; /* 3.0 V */
- ctx->supplies[1].init_load_uA = 857000;
-
- ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
- ctx->supplies);
+ ret = devm_regulator_bulk_get_const(dev,
+ ARRAY_SIZE(sw43408_supplies),
+ sw43408_supplies,
+ &ctx->supplies);
if (ret < 0)
return ret;
--
2.51.0
Powered by blists - more mailing lists