drm/amd/display: check if audio clk enable is applicable
authorRoman Li <Roman.Li@amd.com>
Thu, 17 May 2018 22:08:54 +0000 (18:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 29 May 2018 18:24:13 +0000 (13:24 -0500)
Fixing warning on dce10 with HDMI display.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c

index c063175..c0e813c 100644 (file)
@@ -720,7 +720,8 @@ static void dce110_stream_encoder_update_hdmi_info_packets(
                        const uint32_t *content =
                                (const uint32_t *) &info_frame->avi.sb[0];
                        /*we need turn on clock before programming AFMT block*/
-                       REG_UPDATE(AFMT_CNTL, AFMT_AUDIO_CLOCK_EN, 1);
+                       if (REG(AFMT_CNTL))
+                               REG_UPDATE(AFMT_CNTL, AFMT_AUDIO_CLOCK_EN, 1);
 
                        REG_WRITE(AFMT_AVI_INFO0, content[0]);