mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: anx7625: Use common macros for DP power sequencing commands
@ 2023-01-16  7:24 Chen-Yu Tsai
  2023-02-16 22:32 ` Nícolas F. R. A. Prado
  0 siblings, 1 reply; 2+ messages in thread
From: Chen-Yu Tsai @ 2023-01-16  7:24 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter
  Cc: Chen-Yu Tsai, Xin Ji, dri-devel, linux-kernel

The DRM DP code has macros for the DP power sequencing commands. Use
them in the anx7625 driver instead of raw numbers.

Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream")
Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
This is a minor cleanup. No functional changes.

 drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 808dbf79d209..7e1fb93a6ce4 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -935,8 +935,8 @@ static void anx7625_dp_start(struct anx7625_data *ctx)
 
 	dev_dbg(dev, "set downstream sink into normal\n");
 	/* Downstream sink enter into normal mode */
-	data = 1;
-	ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
+	data = DP_SET_POWER_D0;
+	ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data);
 	if (ret < 0)
 		dev_err(dev, "IO error : set sink into normal mode fail\n");
 
@@ -975,8 +975,8 @@ static void anx7625_dp_stop(struct anx7625_data *ctx)
 
 	dev_dbg(dev, "notify downstream enter into standby\n");
 	/* Downstream monitor enter into standby mode */
-	data = 2;
-	ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, 0x000600, 1, &data);
+	data = DP_SET_POWER_D3;
+	ret |= anx7625_aux_trans(ctx, DP_AUX_NATIVE_WRITE, DP_SET_POWER, 1, &data);
 	if (ret < 0)
 		DRM_DEV_ERROR(dev, "IO error : mute video fail\n");
 
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/bridge: anx7625: Use common macros for DP power sequencing commands
  2023-01-16  7:24 [PATCH] drm/bridge: anx7625: Use common macros for DP power sequencing commands Chen-Yu Tsai
@ 2023-02-16 22:32 ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 2+ messages in thread
From: Nícolas F. R. A. Prado @ 2023-02-16 22:32 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, dri-devel, linux-kernel

On Mon, Jan 16, 2023 at 03:24:06PM +0800, Chen-Yu Tsai wrote:
> The DRM DP code has macros for the DP power sequencing commands. Use
> them in the anx7625 driver instead of raw numbers.
> 
> Fixes: 548b512e144f ("drm/bridge: anx7625: send DPCD command to downstream")
> Fixes: 27f26359de9b ("drm/bridge: anx7625: Set downstream sink into normal status")
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

In the same way, 0x68028 should be switched for DP_AUX_HDCP_BCAPS and 0x01 for
DP_BCAPS_HDCP_CAPABLE, though those aren't part of power sequencing, so are
actually better off in a separate commit.

Thanks,
Nícolas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-16 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16  7:24 [PATCH] drm/bridge: anx7625: Use common macros for DP power sequencing commands Chen-Yu Tsai
2023-02-16 22:32 ` Nícolas F. R. A. Prado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®