__s32 DRV_DISP_Init(void) { __disp_bsp_init_para para; __u32 i = 0; para.base_image0 = (__u32)g_fbi.io[DISP_IO_IMAGE0]; para.base_image1 = (__u32)g_fbi.io[DISP_IO_IMAGE1]; para.base_scaler0 = (__u32)g_fbi.io[DISP_IO_SCALER0]; para.base_scaler1 = (__u32)g_fbi.io[DISP_IO_SCALER1]; para.base_lcdc0 = (__u32)g_fbi.io[DISP_IO_LCDC0]; para.base_lcdc1 = (__u32)g_fbi.io[DISP_IO_LCDC1]; para.base_tvec = (__u32)g_fbi.io[DISP_IO_TVEC]; para.base_ccmu = (__u32)g_fbi.base_ccmu; para.base_sdram = (__u32)g_fbi.base_sdram; para.base_pioc = (__u32)g_fbi.base_pio; para.scaler_begin = DRV_scaler_begin; para.scaler_finish = DRV_scaler_finish; para.tve_interrup = DRV_tve_interrup; para.hdmi_set_mode = DRV_hdmi_set_mode; para.Hdmi_open = DRV_Hdmi_open; para.Hdmi_close = DRV_Hdmi_close; para.hdmi_mode_support = DRV_hdmi_mode_support; para.hdmi_get_HPD_status = DRV_hdmi_get_HPD_status; para.disp_int_process = disp_int_process; memset(&g_disp_drv, 0, sizeof(__disp_drv_t)); g_disp_drv.scaler_finished_sem[0] = kmalloc(sizeof(struct semaphore),GFP_KERNEL | __GFP_ZERO); if(!g_disp_drv.scaler_finished_sem[0]) { __wrn("create scaler_finished_sem[0] fail!\n"); return -1; } sema_init(g_disp_drv.scaler_finished_sem[0],0); g_disp_drv.scaler_finished_sem[1] = kmalloc(sizeof(struct semaphore),GFP_KERNEL | __GFP_ZERO); if(!g_disp_drv.scaler_finished_sem[1]) { __wrn("create scaler_finished_sem[1] fail!\n"); return -1; } sema_init(g_disp_drv.scaler_finished_sem[1],0); for(i = 0; i<MAX_EVENT_SEM; i++) { g_disp_drv.event_sem[0][i] = NULL; g_disp_drv.event_sem[1][i] = NULL; } BSP_disp_init(¶); BSP_disp_open(); Fb_Init(); return 0; }
static int __init hdmi_probe(struct platform_device *pdev) { struct resource *res; int size; int ret = 0; __inf("hdmi_probe call\n"); memset(&ghdmi, 0, sizeof(hdmi_info_t)); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { __wrn("platform_get_resource fail\n"); ret = -ENXIO; goto hdmi_error; } size = (res->end - res->start) + 1; ghdmi.mem = request_mem_region(res->start, size, pdev->name); if (ghdmi.mem == NULL) { __wrn("request_mem_region fail\n"); ret = -ENOENT; goto hdmi_error; } ghdmi.io = ioremap(res->start, size); if (ghdmi.io == NULL) { __wrn("ioremap() fail\n"); ret = -ENXIO; goto release_mem0; } __inf("HDMI base 0x%08x\n", (__u32)ghdmi.io); Hdmi_init(); Fb_Init(1); return 0; release_mem0: release_resource(ghdmi.mem); kfree(ghdmi.mem); hdmi_error: return ret; }
static int __devinit hdmi_probe(struct platform_device *pdev) { __inf("hdmi_probe call\n"); memset(&ghdmi, 0, sizeof(hdmi_info_t)); ghdmi.base_hdmi = 0xf1c16000; Hdmi_init(); Fb_Init(1); return 0; }
static int lcd_init(void) { static __lcd_panel_fun_t lcd0_cfg; static __lcd_panel_fun_t lcd1_cfg; LCD_get_panel_funs_generic(&lcd0_cfg); LCD_get_panel_funs_generic(&lcd1_cfg); LCD_get_panel_funs_0(&lcd0_cfg); LCD_get_panel_funs_1(&lcd1_cfg); LCD_set_panel_funs(&lcd0_cfg, &lcd1_cfg); Fb_Init(SUNXI_LCD); return 0; }
int lcd_init(void) { static __lcd_panel_fun_t lcd0_cfg; static __lcd_panel_fun_t lcd1_cfg; memset(&lcd0_cfg, 0, sizeof(__lcd_panel_fun_t)); memset(&lcd1_cfg, 0, sizeof(__lcd_panel_fun_t)); LCD_get_panel_funs_0(&lcd0_cfg); LCD_get_panel_funs_1(&lcd1_cfg); LCD_set_panel_funs(&lcd0_cfg, &lcd1_cfg); DRV_DISP_Init(); Fb_Init(0); return 0; }
int Cad_AppInit(Tcl_Interp *interp) { /* Locate the BRL-CAD-specific Tcl scripts, set the auto_path */ tclcad_auto_path(interp); /* Initialize [incr Tcl] */ /* NOTE: Calling "package require Itcl" here is apparently * insufficient without other changes elsewhere. The Combination * Editor in mged fails with an iwidgets class already loaded * error if we don't perform Itcl_Init() here. */ if (Itcl_Init(interp) == TCL_ERROR) { bu_log("Itcl_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #ifdef BWISH /* Initialize [incr Tk] */ if (Itk_Init(interp) == TCL_ERROR) { bu_log("Itk_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #endif #ifdef IMPORT_ITCL /* Import [incr Tcl] commands into the global namespace. */ if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), "::itcl::*", /* allowOverwrite */ 1) != TCL_OK) { bu_log("Tcl_Import ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #endif /* IMPORT_ITCL */ #ifdef BWISH # ifdef IMPORT_ITK /* Import [incr Tk] commands into the global namespace */ if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), "::itk::*", /* allowOverwrite */ 1) != TCL_OK) { bu_log("Tcl_Import ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # endif /* IMPORT_ITK */ /* Initialize the Iwidgets package */ if (Tcl_Eval(interp, "package require Iwidgets") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # ifdef IMPORT_IWIDGETS /* Import iwidgets into the global namespace */ if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp), "::iwidgets::*", /* allowOverwrite */ 1) != TCL_OK) { bu_log("Tcl_Import ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # endif /* IMPORT_IWIDGETS */ #endif /* BWISH */ # ifdef IMPORT_ITCL if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itcl::* }") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # endif #ifdef BWISH # ifdef IMPORT_ITCL if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::tk::* }") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # endif # ifdef IMPORT_ITK if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itk::* }") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } # endif /* Initialize libdm */ if (Dm_Init(interp) == TCL_ERROR) { bu_log("Dm_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libfb */ if (Fb_Init(interp) == TCL_ERROR) { bu_log("Fb_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #endif /* Initialize libbu */ if (Bu_Init(interp) == TCL_ERROR) { bu_log("Bu_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libbn */ if (Bn_Init(interp) == TCL_ERROR) { bu_log("Bn_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize librt */ if (Rt_Init(interp) == TCL_ERROR) { bu_log("Rt_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libtclcad's GED Object */ if (Go_Init(interp) == TCL_ERROR) { bu_log("Go_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize command history object */ Cho_Init(interp); return TCL_OK; }
int Tclcad_Init(Tcl_Interp *interp) { if (library_initialized(0)) return TCL_OK; if (Tcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #ifdef HAVE_TK if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } #endif /* Locate the BRL-CAD-specific Tcl scripts, set the auto_path */ tclcad_auto_path(interp); /* Initialize [incr Tcl] */ if (Tcl_Eval(interp, "package require Itcl") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #ifdef HAVE_TK /* Initialize [incr Tk] */ if (Tcl_Eval(interp, "package require Itk") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } #endif /* Initialize the Iwidgets package */ if (Tcl_Eval(interp, "package require Iwidgets") != TCL_OK) { bu_log("Tcl_Eval ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libdm */ if (Dm_Init(interp) == TCL_ERROR) { bu_log("Dm_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libfb */ if (Fb_Init(interp) == TCL_ERROR) { bu_log("Fb_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libbu */ if (Bu_Init(interp) == TCL_ERROR) { bu_log("Bu_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize libbn */ if (Bn_Init(interp) == TCL_ERROR) { bu_log("Bn_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize librt */ if (Rt_Init(interp) == TCL_ERROR) { bu_log("Rt_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* Initialize the GED object */ if (Go_Init(interp) == TCL_ERROR) { bu_log("Go_Init ERROR:\n%s\n", Tcl_GetStringResult(interp)); return TCL_ERROR; } /* initialize command history objects */ Cho_Init(interp); Tcl_PkgProvide(interp, "Tclcad", brlcad_version()); (void)library_initialized(1); return TCL_OK; }