__s32 BSP_disp_hdmi_open(__u32 sel) { if(!(gdisp.screen[sel].status & HDMI_ON)) { __disp_tv_mode_t tv_mod; __u32 scaler_index; tv_mod = gdisp.screen[sel].hdmi_mode; hdmi_clk_on(); lcdc_clk_on(sel); image_clk_on(sel); Image_open(sel);//set image normal channel start bit , because every de_clk_off( )will reset this bit disp_clk_cfg(sel,DISP_OUTPUT_TYPE_HDMI, tv_mod); BSP_disp_set_output_csc(sel, DISP_OUTPUT_TYPE_HDMI); DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod)); DE_BE_Output_Select(sel, sel); DE_BE_Set_Outitl_enable(sel, Disp_get_screen_scan_mode(tv_mod)); for(scaler_index=0; scaler_index<2; scaler_index++) { if((gdisp.scaler[scaler_index].status & SCALER_USED) && (gdisp.scaler[scaler_index].screen_index == sel)) { if(Disp_get_screen_scan_mode(tv_mod) == 1)//interlace output { Scaler_Set_Outitl(scaler_index, TRUE); } else { Scaler_Set_Outitl(scaler_index, FALSE); } } } TCON1_set_hdmi_mode(sel,tv_mod); TCON1_open(sel); if(gdisp.init_para.Hdmi_open) { gdisp.init_para.Hdmi_open(); } else { DE_WRN("Hdmi_open is NULL\n"); return -1; } Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_HDMI, tv_mod); gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod); gdisp.screen[sel].status |= HDMI_ON; gdisp.screen[sel].lcdc_status |= LCDC_TCON1_USED; gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_HDMI; #ifdef __LINUX_OSAL__ Display_set_fb_timming(sel); #endif } return DIS_SUCCESS; }
__s32 BSP_disp_tv_open(__u32 sel) { if((!(gdisp.screen[sel].status & TV_ON))) { __disp_tv_mode_t tv_mod; __panel_para_t para; memset(¶, 0, sizeof(__panel_para_t)); tv_mod = gdisp.screen[sel].tv_mode; lcdc_clk_on(sel, 0, 0); disp_clk_cfg(sel, DISP_OUTPUT_TYPE_TV, tv_mod); lcdc_clk_on(sel, 0, 1); drc_clk_open(sel,0); tcon_init(sel); image_clk_on(sel, 1); Image_open(sel);//set image normal channel start bit , because every de_clk_off( )will reset this bit BSP_disp_set_output_csc(sel, DISP_OUT_CSC_TYPE_LCD, BSP_disp_drc_get_input_csc(sel)); //LCD -->GM7121, rgb fmt DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod)); DE_BE_Output_Select(sel, sel); disp_tv_get_timing(¶, tv_mod); tcon0_cfg(sel,(__panel_para_t*)¶); tcon0_src_select(sel,4); if(gdisp.screen[sel].tv_ops.tv_power_on) { gdisp.screen[sel].tv_ops.tv_power_on(1); msleep(500); } disp_tv_pin_cfg(1); tcon0_open(sel,(__panel_para_t*)¶); if(gdisp.screen[sel].tv_ops.tv_open) { gdisp.screen[sel].tv_ops.tv_open(); } Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_TV, tv_mod); gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod); gdisp.screen[sel].status = TV_ON; gdisp.screen[sel].lcdc_status |= LCDC_TCON0_USED; gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_TV; gdisp.screen[sel].output_csc_type = DISP_OUT_CSC_TYPE_LCD;//LCD -->GM7121, rgb fmt if(BSP_disp_cmu_get_enable(sel) ==1) { IEP_CMU_Set_Imgsize(sel, BSP_disp_get_screen_width(sel), BSP_disp_get_screen_height(sel)); } Disp_set_out_interlace(sel); #ifdef __LINUX_OSAL__ Display_set_fb_timming(sel); #endif tcon0_src_select(sel,0); } return DIS_SUCCESS; }
__s32 BSP_disp_tv_open(__u32 sel) { if(!(gdisp.screen[sel].status & TV_ON)) { __disp_tv_mode_t tv_mod; tv_mod = gdisp.screen[sel].tv_mode; image_clk_on(sel); Image_open(sel);//set image normal channel start bit , because every de_clk_off( )will reset this bit disp_clk_cfg(sel,DISP_OUTPUT_TYPE_TV, tv_mod); tve_clk_on(sel); lcdc_clk_on(sel); BSP_disp_set_output_csc(sel, DISP_OUTPUT_TYPE_TV); DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod)); DE_BE_Output_Select(sel, sel); TCON1_set_tv_mode(sel,tv_mod); TVE_set_tv_mode(sel, tv_mod); Disp_TVEC_DacCfg(sel, tv_mod); TCON1_open(sel); Disp_TVEC_Open(sel); Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_TV, tv_mod); #ifdef __LINUX_OSAL__ { user_gpio_set_t gpio_info[1]; __hdle gpio_pa_shutdown; __s32 ret; memset(gpio_info, 0, sizeof(user_gpio_set_t)); ret = OSAL_Script_FetchParser_Data("audio_para","audio_pa_ctrl", (int *)gpio_info, sizeof(user_gpio_set_t)/sizeof(int)); if(ret < 0) { DE_WRN("fetch script data audio_para.audio_pa_ctrl fail\n"); } else { gpio_pa_shutdown = OSAL_GPIO_Request(gpio_info, 1); if(!gpio_pa_shutdown) { DE_WRN("audio codec_wakeup request gpio fail!\n"); } else { OSAL_GPIO_DevWRITE_ONEPIN_DATA(gpio_pa_shutdown, 0, "audio_pa_ctrl"); } } } #endif gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod); gdisp.screen[sel].status |= TV_ON; gdisp.screen[sel].lcdc_status |= LCDC_TCON1_USED; gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_TV; Disp_set_out_interlace(sel); #ifdef __LINUX_OSAL__ Display_set_fb_timming(sel); #endif } return DIS_SUCCESS; }
__s32 BSP_disp_tv_open(__u32 sel) { if (!(gdisp.screen[sel].status & TV_ON)) { __disp_tv_mode_t tv_mod; tv_mod = gdisp.screen[sel].tv_mode; image_clk_on(sel); /* * set image normal channel start bit , because every * de_clk_off( )will reset this bit */ Image_open(sel); disp_clk_cfg(sel, DISP_OUTPUT_TYPE_TV, tv_mod); tve_clk_on(sel); lcdc_clk_on(sel); BSP_disp_set_output_csc(sel, DISP_OUTPUT_TYPE_TV, gdisp.screen[sel]. iep_status & DRC_USED); DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod)); DE_BE_Output_Select(sel, sel); if (sunxi_is_sun5i()) { int scaler_index; DE_BE_Set_Outitl_enable(sel, Disp_get_screen_scan_mode(tv_mod)); for (scaler_index = 0; scaler_index < 2; scaler_index++) if ((gdisp.scaler[scaler_index]. status & SCALER_USED) && (gdisp.scaler[scaler_index]. screen_index == sel)) { /* interlace output */ if (Disp_get_screen_scan_mode(tv_mod) == 1) Scaler_Set_Outitl(scaler_index, TRUE); else Scaler_Set_Outitl(scaler_index, FALSE); } } TCON1_set_tv_mode(sel, tv_mod); TVE_set_tv_mode(sel, tv_mod); Disp_TVEC_DacCfg(sel, tv_mod); TCON1_open(sel); Disp_TVEC_Open(sel); Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_TV, tv_mod); Disp_de_flicker_enable(sel, TRUE); { user_gpio_set_t gpio_info[1]; __hdle gpio_pa_shutdown; __s32 ret; memset(gpio_info, 0, sizeof(user_gpio_set_t)); ret = script_parser_fetch("audio_para", "audio_pa_ctrl", (int *)gpio_info, sizeof(user_gpio_set_t) / sizeof(int)); if (ret < 0) { DE_WRN("fetch script data " "audio_para.audio_pa_ctrl fail\n"); } else { gpio_pa_shutdown = OSAL_GPIO_Request(gpio_info, 1); if (!gpio_pa_shutdown) { DE_WRN("audio codec_wakeup request " "gpio fail!\n"); } else { OSAL_GPIO_DevWRITE_ONEPIN_DATA (gpio_pa_shutdown, 0, "audio_pa_ctrl"); } } } gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod); gdisp.screen[sel].status |= TV_ON; gdisp.screen[sel].lcdc_status |= LCDC_TCON1_USED; gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_TV; Disp_set_out_interlace(sel); Display_set_fb_timing(sel); } return DIS_SUCCESS; }
__s32 BSP_disp_hdmi_open(__u32 sel) { if(!(gdisp.screen[sel].status & HDMI_ON)) { __disp_tv_mode_t tv_mod; tv_mod = gdisp.screen[sel].hdmi_mode; BSP_disp_hdmi_get_hdcp_enable(); hdmi_clk_on(); if(gdisp.screen[sel].hdmi_hdcp_en) hdcp_clk_init(tv_mod); lcdc_clk_on(sel, 1, 0); lcdc_clk_on(sel, 1, 1); Disp_lcdc_reg_isr(sel); LCDC_init(sel); image_clk_on(sel, 0); image_clk_on(sel, 1); Image_open(sel);//set image normal channel start bit , because every de_clk_off( )will reset this bit DE_BE_EnableINT(sel, DE_IMG_REG_LOAD_FINISH); disp_clk_cfg(sel,DISP_OUTPUT_TYPE_HDMI, tv_mod); if(gdisp.init_para.hdmi_cts_compatibility == 0) { DE_INF("BSP_disp_hdmi_open: disable dvi mode\n"); BSP_disp_hdmi_dvi_enable(sel, 0); } else if(gdisp.init_para.hdmi_cts_compatibility == 1) { DE_INF("BSP_disp_hdmi_open: enable dvi mode\n"); BSP_disp_hdmi_dvi_enable(sel, 1); } else { BSP_disp_hdmi_dvi_enable(sel, BSP_disp_hdmi_dvi_support(sel)); } if(BSP_dsip_hdmi_get_input_csc(sel) == 0) { __inf("BSP_disp_hdmi_open: hdmi output rgb\n"); gdisp.screen[sel].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_RGB; BSP_disp_set_output_csc(sel, gdisp.screen[sel].output_csc_type); }else { __inf("BSP_disp_hdmi_open: hdmi output yuv\n"); gdisp.screen[sel].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_YUV;//default yuv BSP_disp_set_output_csc(sel, gdisp.screen[sel].output_csc_type); } DE_BE_set_display_size(sel, tv_mode_to_width(tv_mod), tv_mode_to_height(tv_mod)); DE_BE_Output_Select(sel, sel); tcon1_set_hdmi_mode(sel,tv_mod); tcon1_open(sel); if(gdisp.init_para.hdmi_open) { gdisp.init_para.hdmi_open(); } else { DE_WRN("hdmi_open is NULL\n"); return -1; } Disp_Switch_Dram_Mode(DISP_OUTPUT_TYPE_HDMI, tv_mod); gdisp.screen[sel].b_out_interlace = Disp_get_screen_scan_mode(tv_mod); gdisp.screen[sel].status |= HDMI_ON; gdisp.screen[sel].lcdc_status |= LCDC_TCON1_USED; gdisp.screen[sel].output_type = DISP_OUTPUT_TYPE_HDMI; Disp_set_out_interlace(sel); #ifdef __LINUX_OSAL__ Display_set_fb_timming(sel); #endif } return DIS_SUCCESS; }