__s32 DRV_lcd_close(__u32 sel) { __u32 i = 0; __lcd_flow_t *flow; if (g_disp_drv.b_lcd_open[sel] == 1) { BSP_disp_lcd_close_befor(sel); flow = BSP_disp_lcd_get_close_flow(sel); for (i = 0; i < flow->func_num; i++) { __u32 timeout = flow->func[i].delay * HZ / 1000; flow->func[i].func(sel); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(timeout); } BSP_disp_lcd_close_after(sel); g_disp_drv.b_lcd_open[sel] = 0; } return 0; }
// [before][step_0][delay_0][step_1][delay_1]......[step_n-2][delay_n-2][step_n-1][delay_n-1][after] void DRV_lcd_close_callback(void *parg) { __lcd_flow_t *flow; __u32 sel = (__u32)parg; __s32 i = lcd_flow_cnt[sel]++; flow = BSP_disp_lcd_get_close_flow(sel); if(i < flow->func_num) { flow->func[i].func(sel); if(flow->func[i].delay == 0) { DRV_lcd_close_callback((void*)sel); } else { wBoot_timer_start(lcd_timer[sel], flow->func[i].delay, 0); } } else if(i == flow->func_num) { BSP_disp_lcd_close_after(sel); lcd_op_finished[sel] = 1; } }
//run lcd close flow __s32 disp_lcd_close_late(__u32 sel) { __u32 i = 0; __lcd_flow_t *close_flow; __lcd_flow_t *open_flow; if(g_disp_drv.b_lcd_open[sel] == 0) { open_flow = BSP_disp_lcd_get_open_flow(sel); if(open_flow->cur_step != (open_flow->func_num-1)) //if there is task in timer list,cancel it { del_timer(&g_disp_drv.disp_timer[sel]); } BSP_disp_lcd_close_befor(sel); close_flow = BSP_disp_lcd_get_close_flow(sel); for(i=0; i<close_flow->func_num; i++) { __u32 timeout = close_flow->func[i].delay*HZ/1000; close_flow->func[i].func(sel); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(timeout); } BSP_disp_lcd_close_after(sel); g_disp_drv.b_lcd_open[sel] = 0; } return 0; }
__s32 DRV_lcd_close(__u32 sel) { __u32 i = 0; __lcd_flow_t *flow; BSP_disp_lcd_close_befor(sel); flow = BSP_disp_lcd_get_close_flow(sel); for(i=0; i<flow->func_num; i++) { flow->func[i].func(sel); esKRNL_TimeDly(flow->func[i].delay / 10); } BSP_disp_lcd_close_after(sel); return EPDK_OK; }