From: David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Sam Ravnborg <sam@ravnborg.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Casey Connolly <casey.connolly@linaro.org>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
phone-devel@vger.kernel.org, David Heidelberg <david@ixit.cz>
Subject: [PATCH v2 04/12] drm/panel: sofef00: Handle all regulators
Date: Thu, 13 Nov 2025 18:57:38 +0100 [thread overview]
Message-ID: <20251113-sofef00-rebuild-v2-4-e175053061ec@ixit.cz> (raw)
In-Reply-To: <20251113-sofef00-rebuild-v2-0-e175053061ec@ixit.cz>
From: David Heidelberg <david@ixit.cz>
Recently we documented, there is more than vddio regulator, adapt the
driver to work with VCI and POC regulator.
Signed-off-by: David Heidelberg <david@ixit.cz>
---
drivers/gpu/drm/panel/panel-samsung-sofef00.c | 28 ++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
index c88574ea66e1c..3097040e6bfa0 100644
--- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
+++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
@@ -20,10 +20,16 @@
struct sofef00_panel {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
- struct regulator *supply;
+ struct regulator_bulk_data *supplies;
struct gpio_desc *reset_gpio;
};
+static const struct regulator_bulk_data sofef00_supplies[] = {
+ { .supply = "vddio" },
+ { .supply = "vci" },
+ { .supply = "poc" },
+};
+
static inline
struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel)
{
@@ -86,20 +92,18 @@ static int sofef00_panel_off(struct sofef00_panel *ctx)
static int sofef00_panel_prepare(struct drm_panel *panel)
{
struct sofef00_panel *ctx = to_sofef00_panel(panel);
- struct device *dev = &ctx->dsi->dev;
int ret;
- ret = regulator_enable(ctx->supply);
- if (ret < 0) {
- dev_err(dev, "Failed to enable regulator: %d\n", ret);
+ ret = regulator_bulk_enable(ARRAY_SIZE(sofef00_supplies), ctx->supplies);
+ if (ret < 0)
return ret;
- }
sofef00_panel_reset(ctx);
ret = sofef00_panel_on(ctx);
if (ret < 0) {
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_bulk_disable(ARRAY_SIZE(sofef00_supplies), ctx->supplies);
return ret;
}
@@ -111,7 +115,7 @@ static int sofef00_panel_unprepare(struct drm_panel *panel)
struct sofef00_panel *ctx = to_sofef00_panel(panel);
sofef00_panel_off(ctx);
- regulator_disable(ctx->supply);
+ regulator_bulk_disable(ARRAY_SIZE(sofef00_supplies), ctx->supplies);
return 0;
}
@@ -197,10 +201,12 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
if (IS_ERR(ctx))
return PTR_ERR(ctx);
- ctx->supply = devm_regulator_get(dev, "vddio");
- if (IS_ERR(ctx->supply))
- return dev_err_probe(dev, PTR_ERR(ctx->supply),
- "Failed to get vddio regulator\n");
+ ret = devm_regulator_bulk_get_const(dev,
+ ARRAY_SIZE(sofef00_supplies),
+ sofef00_supplies,
+ &ctx->supplies);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get regulators\n");
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio))
--
2.51.0
next prev parent reply other threads:[~2025-11-13 17:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 17:57 [PATCH v2 00/12] Make Samsung SOFEF00 DDIC and panel work David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 01/12] dt-bindings: panel: Convert Samsung SOFEF00 DDIC into standalone yaml David Heidelberg via B4 Relay
2025-11-14 8:13 ` Krzysztof Kozlowski
2025-11-16 13:55 ` Casey Connolly
2025-11-16 14:42 ` David Heidelberg
2025-11-16 17:46 ` David Heidelberg
2025-11-13 17:57 ` [PATCH v2 02/12] arch: arm64: qcom: sdm845-enchilada: Specify panel name within the compatible David Heidelberg via B4 Relay
2025-11-13 20:28 ` Bjorn Andersson
2025-11-13 17:57 ` [PATCH v2 03/12] drm/panel: sofef00: Clean up panel description after s6e3fc2x01 removal David Heidelberg via B4 Relay
2025-11-13 17:57 ` David Heidelberg via B4 Relay [this message]
2025-11-13 17:57 ` [PATCH v2 05/12] drm/panel: sofef00: Split sending commands to the enable/disable functions David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 06/12] drm/panel: sofef00: Introduce page macro David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 07/12] drm/panel: sofef00: Add prepare_prev_first flag to drm_panel David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 08/12] drm/panel: sofef00: Initialise at 50% brightness David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 09/12] drm/panel: sofef00: Introduce compatible which includes the panel name David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 10/12] drm/panel: sofef00: Simplify get_modes David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 11/12] drm/panel: sofef00: Mark the LPM mode always-on David Heidelberg via B4 Relay
2025-11-13 17:57 ` [PATCH v2 12/12] drm/panel: sofef00: Non-continuous mode and video burst are supported David Heidelberg via B4 Relay
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=20251113-sofef00-rebuild-v2-4-e175053061ec@ixit.cz \
--to=devnull+david.ixit.cz@kernel.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=casey.connolly@linaro.org \
--cc=conor+dt@kernel.org \
--cc=david@ixit.cz \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jessica.zhang@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=phone-devel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sam@ravnborg.org \
--cc=simona@ffwll.ch \
--cc=thierry.reding@gmail.com \
--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