hdmirx: add load22key handle
authoryicheng shen <yicheng.shen@amlogic.com>
Thu, 7 Jun 2018 03:07:02 +0000 (11:07 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 13 Jun 2018 08:00:20 +0000 (01:00 -0700)
PD#153894: hdmirx: optimize load22key sw sequence

Change-Id: I888cbc2911e0739ec078e03cb475069cc4e1a49c
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
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c

index a54535ec22f7239a251db86b4db5773d0f7ce5cc..ddb30d4f2f730add605be209d83cbdcb21c0711b 100644 (file)
@@ -41,7 +41,7 @@
  *
  *
  */
-#define RX_VER1 "ver.2018/05/30"
+#define RX_VER1 "ver.2018/06/07"
 
 
 
index db3f72209da3460596c726f043ba7ff2b2f5d7b2..b58f3bd9601d873afa46c367e9ce0a703072c730 100644 (file)
@@ -2134,6 +2134,42 @@ bool is_wr_only_reg(uint32_t addr)
 
 void rx_debug_load22key(void)
 {
+       int ret = 0;
+       int wait_kill_done_cnt = 0;
+
+       ret = rx_sec_set_duk();
+       rx_pr("22 = %d\n", ret);
+       if (ret == 1) {
+               rx_pr("load 2.2 key\n");
+               sm_pause = 1;
+               rx_set_hpd(0);
+               hdcp22_on = 1;
+               hdcp22_kill_esm = 1;
+               while (wait_kill_done_cnt++ < 10) {
+                       if (!hdcp22_kill_esm)
+                               break;
+                       msleep(20);
+               }
+               hdcp22_kill_esm = 0;
+               extcon_set_state_sync(rx.rx_excton_rx22,
+                       EXTCON_DISP_HDMI, 0);
+               hdmirx_wr_dwc(DWC_HDCP22_CONTROL, 0x0);
+               hdmirx_hdcp22_esm_rst();
+               mdelay(110);
+               rx_is_hdcp22_support();
+               hdmirx_wr_dwc(DWC_HDCP22_CONTROL,
+                                       0x1000);
+               rx_hdcp22_wr_top(TOP_SKP_CNTL_STAT, 0x1);
+               hdcp22_clk_en(1);
+               extcon_set_state_sync(rx.rx_excton_rx22,
+                       EXTCON_DISP_HDMI, 1);
+               mdelay(100);
+               hdmirx_hw_config();
+               hpd_to_esm = 1;
+               /* mdelay(900); */
+               rx_set_hpd(1);
+               sm_pause = 0;
+       }
 }
 
 void rx_debug_loadkey(void)
index 33cf22de9b9b86cacaa56b6d2c674c9531cfd767..43753257ee6c9443ba6a6e8d307ebc7ada4f472c 100644 (file)
@@ -1257,8 +1257,9 @@ bool is_unnormal_format(uint8_t wait_cnt)
                }
        }
        if ((ret == false) && (wait_cnt != sig_stable_max))
-               rx_pr("unnormal_format wait cnt = %d\n",
-                       wait_cnt-sig_stable_max);
+               if (log_level & VIDEO_LOG)
+                       rx_pr("unnormal_format wait cnt = %d\n",
+                               wait_cnt-sig_stable_max);
        #else
        if ((rx.pre.sw_vic == HDMI_UNSUPPORT) ||
                (rx.pre.sw_vic == HDMI_UNKNOWN)) {