s32 disp_tv_enable( struct disp_device* ptv) { struct disp_manager *mgr = NULL; unsigned long flags; struct disp_device_private_data *ptvp = disp_tv_get_priv(ptv); printf("disp_tv_enable\n"); if (!ptv || !ptvp) { DE_WRN("tv init null hdl!\n"); return DIS_FAIL; } if ((NULL == ptv) || (NULL == ptvp)) { DE_WRN("tv set func null hdl!\n"); return DIS_FAIL; } mgr = ptv->manager; if (!mgr) { DE_WRN("tv%d's mgr is NULL\n", ptv->disp); return DIS_FAIL; } if(ptvp->enabled == 1) { DE_WRN("tv%d is already open\n", ptv->disp); return DIS_FAIL; } if (ptvp->tv_func.tv_get_video_timing_info == NULL) { DE_WRN("tv_get_video_timing_info func is null\n"); return DIS_FAIL; } ptvp->tv_func.tv_get_video_timing_info(ptv->disp, &(ptvp->video_info)); if (ptvp->video_info == NULL) { DE_WRN("video info is null\n"); return DIS_FAIL; } memcpy(&ptv->timings, ptvp->video_info, sizeof(disp_video_timings)); if (mgr->enable) mgr->enable(mgr); #if defined(CONFIG_ARCH_SUN8IW6) tv_clk_config(ptv); //no need tcon clk for 1680 tv_clk_enable(ptv); #endif if(NULL == ptvp->tv_func.tv_enable) { DE_WRN("tv_enable is NULL\n"); return -1; } DE_INF("tv enable before %d\n", ptv->disp); ptvp->tv_func.tv_enable(ptv->disp); tv_clk_enable(ptv); disp_al_tv_cfg(ptv->disp, ptvp->video_info); disp_al_tv_enable(ptv->disp); disp_sys_register_irq(ptvp->irq_no,0,disp_tv_event_proc,(void*)ptv->disp,0,0); disp_sys_enable_irq(ptvp->irq_no); disp_sys_irqlock((void*)&g_tv_data_lock, &flags); ptvp->enabled = 1; disp_sys_irqunlock((void*)&g_tv_data_lock, &flags); return 0; }
static s32 disp_vdevice_sw_enable(struct disp_device* vdevice) { struct disp_vdevice_private_data *vdevicep = disp_vdevice_get_priv(vdevice); struct disp_manager *mgr = NULL; if((NULL == vdevice) || (NULL == vdevicep)) { DE_WRN("null hdl!\n"); return DIS_FAIL; } mgr = vdevice->manager; if(!mgr) { DE_WRN("%s%d's mgr is NULL\n", vdevice->name, vdevice->disp); return DIS_FAIL; } if(vdevicep->enabled == 1) { DE_WRN("%s%d is already enabled\n", vdevice->name, vdevice->disp); return DIS_FAIL; } if(vdevicep->func.get_video_timing_info == NULL) { DE_WRN("vdevice_get_video_timing_info func is null\n"); return DIS_FAIL; } vdevicep->func.get_video_timing_info(&(vdevicep->video_info)); if(vdevicep->video_info == NULL) { DE_WRN("video info is null\n"); return DIS_FAIL; } if(vdevicep->func.get_interface_para == NULL) { DE_WRN("get_interface_para func is null\n"); return DIS_FAIL; } vdevicep->func.get_interface_para((void*)&(vdevicep->intf)); disp_sys_lock((void*)&vdevicep->mlock); memcpy(&vdevice->timings, vdevicep->video_info, sizeof(disp_video_timings)); if(mgr->sw_enable) mgr->sw_enable(mgr); disp_sys_register_irq(vdevicep->irq_no,0,disp_vdevice_event_proc,(void*)vdevice,0,0); disp_sys_enable_irq(vdevicep->irq_no); vdevicep->enabled = 1; disp_sys_unlock((void*)&vdevicep->mlock); return 0; }
s32 disp_hdmi_enable(struct disp_device* hdmi) { unsigned long flags; struct disp_device_private_data *hdmip = disp_hdmi_get_priv(hdmi); struct disp_manager *mgr = NULL; if((NULL == hdmi) || (NULL == hdmip)) { DE_WRN("hdmi set func null hdl!\n"); return DIS_FAIL; } mgr = hdmi->manager; if(!mgr) { DE_WRN("hdmi%d's mgr is NULL\n", hdmi->disp); return DIS_FAIL; } if(hdmip->hdmi_func.hdmi_get_video_timing_info == NULL) { DE_WRN("hdmi_get_video_timing_info func is null\n"); return DIS_FAIL; } hdmip->hdmi_func.hdmi_get_video_timing_info(&(hdmip->video_info)); if(hdmip->video_info == NULL) { DE_WRN("video info is null\n"); return DIS_FAIL; } memcpy(&hdmi->timings, hdmip->video_info, sizeof(disp_video_timings)); if(mgr->enable) mgr->enable(mgr); disp_sys_register_irq(hdmip->irq_no,0,disp_hdmi_event_proc,(void*)hdmi->disp,0,0); disp_sys_enable_irq(hdmip->irq_no); hdmi_clk_enable(hdmi); disp_al_hdmi_cfg(hdmi->disp, hdmip->video_info); disp_al_hdmi_enable(hdmi->disp); if(NULL != hdmip->hdmi_func.hdmi_open) hdmip->hdmi_func.hdmi_open(); else DE_WRN("hdmi_open is NULL\n"); disp_sys_irqlock((void*)&hdmi_data_lock, &flags); hdmip->enabled = 1; disp_sys_irqunlock((void*)&hdmi_data_lock, &flags); return 0; }