return flag;
}
+bool is_ddc_idle(unsigned char port_id)
+{
+ unsigned int sts;
+ unsigned int ddc_sts;
+ unsigned int ddc_offset;
+
+ switch (port_id) {
+ case 0:
+ sts = hdmirx_rd_top(TOP_EDID_GEN_STAT);
+ break;
+ case 1:
+ sts = hdmirx_rd_top(TOP_EDID_GEN_STAT_B);
+ break;
+ case 2:
+ sts = hdmirx_rd_top(TOP_EDID_GEN_STAT_C);
+ break;
+ case 3:
+ sts = hdmirx_rd_top(TOP_EDID_GEN_STAT_D);
+ break;
+ default:
+ sts = 0;
+ break;
+ }
+
+ ddc_sts = (sts >> 20) & 0x1f;
+ ddc_offset = sts & 0xff;
+
+ if ((ddc_sts == 0) &&
+ ((ddc_offset == 0xff) ||
+ (ddc_offset == 0)))
+ return true;
+
+ if (log_level & ERR_LOG)
+ rx_pr("ddc busy\n");
+
+ return false;
+}
+
void rx_edid_fill_to_register(
u_char *pedid,
u_int brepeat,
static int hpd_wait_cnt;
/* increase time of hpd low, to avoid some source like */
-/* MTK box i2c communicate error */
-static int hpd_wait_max = 20;
+/* MTK box/KaiboerH9 i2c communicate error */
+static int hpd_wait_max = 40;
static int sig_unstable_cnt;
static int sig_unstable_max = 80;
static bool hdcp22_esm_reset2_enable;
int sm_pause;
int pre_port = 0xff;
-/*uint32_t irq_flag;*/
-/*for some device pll unlock too long,send a hpd reset*/
-bool hdmi5v_lost_flag;
static int hdcp_none_wait_max = 100;
/* for no signal after esd test issue, phy
* does't work, cable clock or PLL can't
esm_set_stable(false);
}
hdmirx_hw_config();
+ hdmi_rx_top_edid_update();
set_scdc_cfg(1, 0);
vic_check_en = true;
dvi_check_en = true;
rx_pr("rx.skip = %d", rx.skip);
}
+void wait_ddc_idle(void)
+{
+ unsigned char i;
+ /* add delays to avoid the edid communication fail */
+ for (i = 0; i <= 10; i++) {
+ if (!is_ddc_idle(rx.port))
+ msleep(20);
+ }
+}
+
/***********************
* hdmirx_open_port
***********************/
rx_set_cur_hpd(0);
/* need reset the whole module when switch port */
hdmirx_hw_config();
+ wait_ddc_idle();
+ hdmi_rx_top_edid_update();
} else {
if (rx.state >= FSM_SIG_STABLE)
rx.state = FSM_SIG_STABLE;
case FSM_HPD_HIGH:
hpd_wait_cnt++;
if (rx_get_cur_hpd_sts() == 0) {
- if (edid_update_flag) {
- if (hpd_wait_cnt <= hpd_wait_max*10)
- break;
- } else {
- if (hpd_wait_cnt <= hpd_wait_max)
- break;
- }
+ if (hpd_wait_cnt <= hpd_wait_max)
+ break;
}
hpd_wait_cnt = 0;
clk_unstable_cnt = 0;
if (fmt_vic_abnormal() &&
(vic_check_en == true)) {
hdmirx_hw_config();
+ hdmi_rx_top_edid_update();
rx.state = FSM_HPD_LOW;
vic_check_en = false;
break;
if (fmt_vic_abnormal() &&
(vic_check_en == true)) {
hdmirx_hw_config();
+ hdmi_rx_top_edid_update();
rx.state = FSM_HPD_LOW;
vic_check_en = false;
break;
if (tmpbuf[5] == '0') {
rx_pr(" hdmirx hw config\n");
hdmirx_hw_config();
+ hdmi_rx_top_edid_update();
} else if (tmpbuf[5] == '1') {
rx_pr(" hdmirx phy init 8bit\n");
hdmirx_phy_init();