2021-08-21 08:54:34 +00:00
|
|
|
From 33e8e066af31c3af1d18d615f5e8ab5e528e0000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Dom Cobley <popcornmix@gmail.com>
|
|
|
|
Date: Wed, 21 Apr 2021 15:15:42 +0100
|
|
|
|
Subject: [PATCH] vc4/drm: hdmi: Handle case when bvb clock is null
|
|
|
|
|
|
|
|
Pi2/3 have no bvb clock but want the other clocks to remain enabled here
|
|
|
|
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/4299
|
|
|
|
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
|
|
|
---
|
|
|
|
drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ++++++---
|
|
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
2022-08-28 13:09:23 +00:00
|
|
|
@@ -610,7 +610,8 @@ static void vc4_hdmi_encoder_post_crtc_p
|
2021-08-21 08:54:34 +00:00
|
|
|
HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE);
|
|
|
|
|
|
|
|
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
|
|
|
|
- clk_request_done(vc4_hdmi->bvb_req);
|
|
|
|
+ if (vc4_hdmi->bvb_req)
|
|
|
|
+ clk_request_done(vc4_hdmi->bvb_req);
|
|
|
|
clk_disable_unprepare(vc4_hdmi->hsm_clock);
|
|
|
|
clk_request_done(vc4_hdmi->hsm_req);
|
|
|
|
clk_disable_unprepare(vc4_hdmi->pixel_clock);
|
2023-03-12 14:03:16 +00:00
|
|
|
@@ -935,7 +936,8 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
2021-08-21 08:54:34 +00:00
|
|
|
else
|
|
|
|
bvb_rate = 75000000;
|
|
|
|
|
|
|
|
- vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
|
|
|
|
+ if (vc4_hdmi->pixel_bvb_clock)
|
|
|
|
+ vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
|
|
|
|
if (IS_ERR(vc4_hdmi->bvb_req)) {
|
|
|
|
DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req));
|
|
|
|
clk_request_done(vc4_hdmi->hsm_req);
|
2023-03-12 14:03:16 +00:00
|
|
|
@@ -947,7 +949,8 @@ static void vc4_hdmi_encoder_pre_crtc_co
|
2021-08-21 08:54:34 +00:00
|
|
|
ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
|
|
|
|
if (ret) {
|
|
|
|
DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret);
|
|
|
|
- clk_request_done(vc4_hdmi->bvb_req);
|
|
|
|
+ if (vc4_hdmi->bvb_req)
|
|
|
|
+ clk_request_done(vc4_hdmi->bvb_req);
|
|
|
|
clk_request_done(vc4_hdmi->hsm_req);
|
|
|
|
clk_disable_unprepare(vc4_hdmi->hsm_clock);
|
|
|
|
clk_disable_unprepare(vc4_hdmi->pixel_clock);
|