static __s32 main_Hpd_Check(void) { __s32 i,times; times = 0; for(i=0;i<3;i++) { if( sunxi_get_hpd()) { times++; } else { //hdmi_state = HDMI_State_Idle; return 0; } if((cts_enable==1) && (hdcp_enable==1)) hdmi_delay_ms(20); //200 else hdmi_delay_ms(200); //200 } if(times == 3) return 1; return 0; }
static int Hdmi_run_thread(void *parg) { while (1) { hdmi_main_task_loop(); if (kthread_should_stop()) break; if (hdmi_state == HDMI_State_Wait_Hpd || hdmi_state == HDMI_State_Playback) hdmi_delay_ms(250); else hdmi_delay_ms(1); } return 0; }
int Hdmi_run_thread(void *parg) { while (1) { Hdmi_hal_main_task(); hdmi_delay_ms(2000); } return 0; }
__s32 Hdmi_hal_mode_support(__u32 mode) { if(Hpd_Check() == 0) return 0; else { while(hdmi_state < HDMI_State_Wait_Video_config) hdmi_delay_ms(10); return Device_Support_VIC[mode]; } }
int Hdmi_run_thread(void *parg) { while (1) { if(kthread_should_stop()) { __inf("Hdmi_run_thread, hdmi suspend\n"); break; } if(!b_hdmi_suspend) { Hdmi_hal_main_task(); } if(ghdmi.bopen) { hdmi_delay_ms(200); } else { hdmi_delay_ms(200); } } return 0; }
static __s32 Hdmi_mode_support(__disp_tv_mode_t mode) { __u32 hdmi_mode = Hdmi_tv_mode_to_hdmi_mode(mode); if (hdmi_mode == 0 || Hpd_Check() == 0) return 0; while (hdmi_state < HDMI_State_Wait_Video_config) hdmi_delay_ms(1); return Device_Support_VIC[hdmi_mode]; }
static __s32 main_Hpd_Check(void) { __s32 i,times; times = 0; for(i=0;i<3;i++) { if(hdmi_hpd_mask & 0x10) times += (hdmi_hpd_mask & 0x1);//for debug else if( bsp_hdmi_get_hpd()) { times++; } if((cts_enable==1) && (hdcp_enable==1)) hdmi_delay_ms(20); //200 else hdmi_delay_ms(200); //200 } if(times >= 3) return 1; else return 0; }
int Hdmi_run_thread(void *parg) { while (1) { //if(ghdmi.bopen == 0) //{ // down(run_sem); //} Hdmi_hal_main_task(); if(ghdmi.bopen) { hdmi_delay_ms(200); } else { hdmi_delay_ms(200); } } return 0; }
__s32 main_Hpd_Check(void) { __s32 i,times; times = 0; for(i=0;i<3;i++) { hdmi_delay_ms(200); if( HDMI_RUINT32(0x00c)&0x01) times++; } if(times == 3) return 1; else return 0; }
static __s32 hdmi_wait_edid(void) { unsigned long start = jiffies; while (time_before(jiffies, start + 10 * HZ)) { /* Wait max 10 sec */ if (hdmi_state > HDMI_State_EDID_Parse) { pr_info("waited %ld ms for EDID info\n", (jiffies - start) * 1000 / HZ); if (!Device_Support_VIC[HDMI_EDID]) { pr_warn("No valid EDID mode found\n"); return -1; } return 0; } hdmi_delay_ms(1); } pr_warn("Timeout waiting for EDID info\n"); return -1; }
__s32 hdmi_core_initial(void) { hdmi_state = HDMI_State_Idle; video_mode = HDMI720P_50; memset(&audio_info,0,sizeof(HDMI_AUDIO_INFO)); memset(Device_Support_VIC,0,sizeof(Device_Support_VIC)); HDMI_WUINT32(0x004,0x80000000); //start hdmi controller HDMI_WUINT32(0x208,((__u32)1<<31)+ (0<<30)+ (1<<29)+ (3<<27)+ (0<<26)+ (1<<25)+ (0<<24)+ (0<<23)+ (4<<20)+ (4<<17)+ (10<<12)+ (3<<8)+ ((4-1)<<4)+(8<<0) ); // tx driver setting HDMI_WUINT32(0x200,0x60000000); //bias en hdmi_delay_ms(1); HDMI_WUINT32(0x200,0x7e80000f); HDMI_WUINT32(0x204,0x01ded070); return 0; }
static __s32 main_Hpd_Check(void) { __s32 i,times_0 = 0,times_1 = 0; for(i=0;i<3;i++) { hdmi_delay_ms(200); if( HDMI_RUINT32(0x00c)&0x01) { times_1++; } else { times_0++; } } if(times_1 == 3) return 1; if(times_0 == 3) return 0; return HPD; }
__s32 Hdmi_hal_video_enable_sync(__bool enable) { __u32 loop_count; if((video_enable != enable) && (hdmi_state >= HDMI_State_Video_config) ) { hdmi_state = HDMI_State_Video_config; } video_enable = enable; loop_count = 3; while(loop_count--) { hdmi_main_task_loop(); if(hdmi_state == HDMI_State_Playback) { return 0; } hdmi_delay_ms(1); } return -1; }