Skip to content

Commit 48e42b8

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 103d12e commit 48e42b8

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
@@ -969,7 +969,8 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
969969
vc4_hdmi->variant->phy_disable(vc4_hdmi);
970970

971971
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
972-
clk_request_done(vc4_hdmi->bvb_req);
972+
if (vc4_hdmi->bvb_req)
973+
clk_request_done(vc4_hdmi->bvb_req);
973974
clk_request_done(vc4_hdmi->hsm_req);
974975
clk_disable_unprepare(vc4_hdmi->pixel_clock);
975976

@@ -1275,7 +1276,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
12751276
else
12761277
bvb_rate = 75000000;
12771278

1278-
vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
1279+
if (vc4_hdmi->pixel_bvb_clock)
1280+
vc4_hdmi->bvb_req = clk_request_start(vc4_hdmi->pixel_bvb_clock, bvb_rate);
12791281
if (IS_ERR(vc4_hdmi->bvb_req)) {
12801282
DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req));
12811283
clk_request_done(vc4_hdmi->hsm_req);
@@ -1287,7 +1289,8 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
12871289
ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
12881290
if (ret) {
12891291
DRM_ERROR("Failed to turn on pixel bvb clock: %d\n", ret);
1290-
clk_request_done(vc4_hdmi->bvb_req);
1292+
if (vc4_hdmi->bvb_req)
1293+
clk_request_done(vc4_hdmi->bvb_req);
12911294
clk_request_done(vc4_hdmi->hsm_req);
12921295
clk_disable_unprepare(vc4_hdmi->hsm_clock);
12931296
clk_disable_unprepare(vc4_hdmi->pixel_clock);

0 commit comments

Comments
 (0)