PD#162660: hdmirx: enable hdcp22 related clk when resume
authoryicheng shen <yicheng.shen@amlogic.com>
Wed, 11 Apr 2018 09:21:52 +0000 (17:21 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 12 Apr 2018 02:55:02 +0000 (18:55 -0800)
fix the issue "black screen after resume".

Change-Id: I654a6dad8347d5bd04af0faeb46fc77be184514f
Signed-off-by: yicheng shen <yicheng.shen@amlogic.com>
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c

index 64de015..396b122 100644 (file)
@@ -34,7 +34,7 @@
 //#include "hdmi_rx_edid.h"
 
 
-#define RX_VER0 "ver.2018-04-05"
+#define RX_VER0 "ver.2018-04-11"
 /*
  *
  *
index 1a40f69..6e6dbcf 100644 (file)
@@ -1215,10 +1215,27 @@ void rx_esm_tmdsclk_en(bool en)
  */
 void hdcp22_clk_en(bool en)
 {
-       if (en)
+       if (en) {
+               wr_reg_hhi(HHI_HDCP22_CLK_CNTL,
+                       (rd_reg_hhi(HHI_HDCP22_CLK_CNTL) & 0xffff0000) |
+                        /* [10: 9] fclk_div7=2000/7=285.71 MHz */
+                       ((0 << 9)   |
+                        /* [    8] clk_en. Enable gated clock */
+                        (1 << 8)   |
+                        /* [ 6: 0] Divide by 1. = 285.71/1 = 285.71 MHz */
+                        (0 << 0)));
+
+                       wr_reg_hhi(HHI_HDCP22_CLK_CNTL,
+                       (rd_reg_hhi(HHI_HDCP22_CLK_CNTL) & 0x0000ffff) |
+                       /* [26:25] select cts_oscin_clk=24 MHz */
+                       ((0 << 25)  |
+                        (1 << 24)  |   /* [   24] Enable gated clock */
+                        (0 << 16)));
                hdmirx_wr_bits_top(TOP_CLK_CNTL, MSK(3, 3), 0x7);
-       else
+       } else {
                hdmirx_wr_bits_top(TOP_CLK_CNTL, MSK(3, 3), 0x0);
+               wr_reg_hhi(HHI_HDCP22_CLK_CNTL, 0);
+       }
 }
 
 /*
@@ -1269,7 +1286,6 @@ void hdmirx_hdcp22_hpd(bool value)
  */
 void hdcp22_suspend(void)
 {
-       wr_reg_hhi(HHI_HDCP22_CLK_CNTL, 0);
        hdcp22_clk_en(0);
        /* note: can't pull down hpd before enter suspend */
        /* it will stop cec wake up func if EE domain still working */