From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
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>,
Douglas Anderson <dianders@chromium.org>,
Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Jessica Zhang <quic_jesszhan@quicinc.com>
Cc: Marek Vasut <marex@denx.de>,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [RFC PATCH 06/10] drm/bridge: tc358762: add support for manual DSI power control
Date: Mon, 16 Oct 2023 19:53:51 +0300 [thread overview]
Message-ID: <20231016165355.1327217-7-dmitry.baryshkov@linaro.org> (raw)
In-Reply-To: <20231016165355.1327217-1-dmitry.baryshkov@linaro.org>
Start migrating tc358762 bridge to new manual DSI power control API. If
the tight power control is not available, default to the existing
pre_enable_prev_first flag.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/bridge/tc358762.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
index 7b9f05f95fd1..efb1da4487c9 100644
--- a/drivers/gpu/drm/bridge/tc358762.c
+++ b/drivers/gpu/drm/bridge/tc358762.c
@@ -72,6 +72,7 @@ struct tc358762 {
struct device *dev;
struct drm_bridge bridge;
struct regulator *regulator;
+ struct mipi_dsi_host *dsi_host;
struct drm_bridge *panel_bridge;
struct gpio_desc *reset_gpio;
struct drm_display_mode mode;
@@ -163,6 +164,8 @@ static void tc358762_post_disable(struct drm_bridge *bridge, struct drm_bridge_s
ctx->pre_enabled = false;
+ mipi_dsi_host_power_down(ctx->dsi_host);
+
if (ctx->reset_gpio)
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
@@ -185,6 +188,10 @@ static void tc358762_pre_enable(struct drm_bridge *bridge, struct drm_bridge_sta
usleep_range(5000, 10000);
}
+ ret = mipi_dsi_host_power_up(ctx->dsi_host);
+ if (ret < 0)
+ dev_err(ctx->dev, "error powering up the DSI host (%d)\n", ret);
+
ret = tc358762_init(ctx);
if (ret < 0)
dev_err(ctx->dev, "error initializing bridge (%d)\n", ret);
@@ -277,10 +284,16 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
if (ret < 0)
return ret;
+ ctx->dsi_host = dsi->host;
+
ctx->bridge.funcs = &tc358762_bridge_funcs;
ctx->bridge.type = DRM_MODE_CONNECTOR_DPI;
ctx->bridge.of_node = dev->of_node;
- ctx->bridge.pre_enable_prev_first = true;
+
+ if (mipi_dsi_host_power_control_available(dsi->host))
+ dsi->mode_flags |= MIPI_DSI_MANUAL_POWERUP;
+ else
+ ctx->bridge.pre_enable_prev_first = true;
drm_bridge_add(&ctx->bridge);
--
2.42.0
next prev parent reply other threads:[~2023-10-16 16:54 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 16:53 [RFC PATCH 00/10] drm/mipi-dsi: another attempt at sorting out DSI link powerup Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 01/10] Revert "drm/bridge: tc358762: Split register programming from pre-enable to enable" Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 02/10] drm/mipi-dsi: document DSI hosts limitations Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state Dmitry Baryshkov
2023-10-19 9:26 ` Maxime Ripard
2023-10-19 11:19 ` Dmitry Baryshkov
2023-10-19 11:42 ` Alexander Stein
2023-10-22 10:49 ` Dmitry Baryshkov
2023-10-23 6:52 ` Alexander Stein
2023-10-23 7:34 ` Dmitry Baryshkov
2023-10-23 8:14 ` Alexander Stein
2023-10-23 8:40 ` Dmitry Baryshkov
2023-10-25 12:44 ` Maxime Ripard
2023-10-25 15:16 ` Dmitry Baryshkov
2023-10-26 8:04 ` Maxime Ripard
2023-10-26 8:41 ` Dmitry Baryshkov
2023-11-07 10:57 ` Maxime Ripard
2023-11-07 11:22 ` Greg Kroah-Hartman
2023-11-07 12:18 ` Maxime Ripard
2023-11-07 15:26 ` Greg Kroah-Hartman
2023-11-08 15:34 ` Maxime Ripard
2023-11-08 15:58 ` Laurent Pinchart
2023-11-29 8:57 ` Neil Armstrong
2023-11-27 16:06 ` Michael Walle
2023-11-28 16:49 ` Dmitry Baryshkov
2023-11-28 16:55 ` Michael Walle
2023-11-28 17:12 ` Dmitry Baryshkov
2023-11-28 19:50 ` Michael Walle
2023-11-28 20:23 ` Dmitry Baryshkov
2023-11-28 22:17 ` Michael Walle
2023-11-28 22:20 ` Michael Walle
2023-11-28 22:21 ` Dmitry Baryshkov
2023-11-28 22:44 ` Michael Walle
2023-10-23 7:35 ` Neil Armstrong
2023-10-23 7:40 ` Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 04/10] drm/msm/dsi: use dsi_mgr_bridge_power_off in dsi_mgr_bridge_post_disable Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 05/10] drm/msm/dsi: implement manual power control Dmitry Baryshkov
2023-10-16 16:53 ` Dmitry Baryshkov [this message]
2023-10-16 16:53 ` [RFC PATCH 07/10] drm/bridge: ps8640: require manual DSI " Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 08/10] drm/bridge: lt9611: mark for automatic " Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 09/10] drm/bridge: lt9611uxc: implement " Dmitry Baryshkov
2023-10-16 16:53 ` [RFC PATCH 10/10] drm/msm/dsi: drop (again) the ps8640 workaround Dmitry Baryshkov
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=20231016165355.1327217-7-dmitry.baryshkov@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dave.stevenson@raspberrypi.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marex@denx.de \
--cc=marijn.suijten@somainline.org \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_jesszhan@quicinc.com \
--cc=rfoss@kernel.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--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).