Skip to content

Commit a1b64f4

Browse files
committed
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: #4299 Signed-off-by: Dom Cobley <[email protected]>
1 parent 607a338 commit a1b64f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
657657
vc4_hdmi->variant->phy_disable(vc4_hdmi);
658658

659659
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
660-
clk_request_done(vc4_hdmi->bvb_req);
660+
if (vc4_hdmi->bvb_req)
661+
clk_request_done(vc4_hdmi->bvb_req);
661662
clk_request_done(vc4_hdmi->hsm_req);
662663
clk_disable_unprepare(vc4_hdmi->pixel_clock);
663664

@@ -965,7 +966,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
965966
else
966967
bvb_rate = 75000000;
967968

968-
vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
969+
if (vc4_hdmi->pixel_bvb_clock)
970+
vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
969971
if (IS_ERR(vc4_hdmi->bvb_req)) {
970972
DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req));
971973
goto err_remove_hsm_req;
@@ -991,7 +993,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
991993
return;
992994

993995
err_remove_bvb_req:
994-
clk_request_done(vc4_hdmi->bvb_req);
996+
if (vc4_hdmi->bvb_req)
997+
clk_request_done(vc4_hdmi->bvb_req);
995998
err_remove_hsm_req:
996999
clk_request_done(vc4_hdmi->hsm_req);
9971000
err_disable_pixel_clock:

0 commit comments

Comments
 (0)