static int hdmi_remove(struct platform_device *pdev) { __inf("hdmi_remove call\n"); Hdmi_exit(pdev); return 0; }
__s32 Hdmi_close(void) { __inf("[Hdmi_close]\n"); Hdmi_hal_video_enable(0); bopen = 0; return 0; }
__s32 OSAL_CCMU_MclkReset(__hdle hMclk, __s32 bReset) { struct clk *hModClk = (struct clk *)hMclk; __inf("OSAL_CCMU_MclkReset<%s,%d>\n", clk_name(hModClk), bReset); return clk_reset(hModClk, bReset); }
s32 disp_hdmi_get_vendor_id(struct disp_hdmi* hdmi, __u8 *id) { struct disp_hdmi_private_data *hdmip = disp_hdmi_get_priv(hdmi); __inf("disp_hdmi_get_vendor_id\n"); if((NULL == hdmi) || (NULL == hdmip)){ DE_WRN("hdmi set func null hdl!\n"); return DIS_FAIL; } if(hdmip->hdmi_func.hdmi_get_vendor_id == NULL){ __inf("hdmi_get_vendor_id NULL"); return -1; } return hdmip->hdmi_func.hdmi_get_vendor_id(id); }
int OSAL_Script_FetchParser_Data(char *main_name, char *sub_name, int value[], int count) { script_item_u val; script_item_value_type_e type; int ret = -1; if(count == 1) { type = script_get_item(main_name, sub_name, &val); if(SCIRPT_ITEM_VALUE_TYPE_INT == type) { ret = 0; *value = val.val; __inf("%s.%s=%d\n", main_name, sub_name, *value); } else { ret = -1; __inf("fetch script data %s.%s fail\n", main_name, sub_name); } } else if(count == sizeof(disp_gpio_set_t)/sizeof(int)) { type = script_get_item(main_name, sub_name, &val); if(SCIRPT_ITEM_VALUE_TYPE_PIO == type) { disp_gpio_set_t *gpio_info = (disp_gpio_set_t *)value; ret = 0; gpio_info->gpio = val.gpio.gpio; gpio_info->mul_sel = val.gpio.mul_sel; gpio_info->pull = val.gpio.pull; gpio_info->drv_level = val.gpio.drv_level; gpio_info->data = val.gpio.data; memcpy(gpio_info->gpio_name, sub_name, strlen(sub_name)+1); __inf("%s.%s gpio=%d,mul_sel=%d,data:%d\n",main_name, sub_name, gpio_info->gpio, gpio_info->mul_sel, gpio_info->data); } else { ret = -1; __inf("fetch script data %s.%s fail\n", main_name, sub_name); } } return ret; }
__s32 Hdmi_hal_set_display_mode(__u32 hdmi_mode) { __inf("Hdmi_hal_set_display_mode = %x\n",hdmi_mode); if(hdmi_mode != get_video_mode()) { video_config(hdmi_mode); } return 0; }
static int disp_remove(struct platform_device *pdev) { __inf("disp_remove call\n"); platform_set_drvdata(pdev, NULL); return 0; }
static void __exit hdmi_module_exit(void) { __inf("hdmi_module_exit\n"); platform_driver_unregister(&hdmi_driver); platform_device_unregister(&hdmi_device); class_destroy(hdmi_class); cdev_del(my_cdev); }
static int __init hdmi_probe(struct platform_device *pdev) { __inf("hdmi_probe call\n"); memset(&ghdmi, 0, sizeof(hdmi_info_t)); ghdmi.dev = &pdev->dev; Hdmi_init(); return 0; }
int ir_cut_sys_gpio_request(ir_cut_gpio_set_t *gpio_list, u32 group_count_max) { int ret = 0; struct gpio_config pin_cfg; char pin_name[32]; u32 config; if(gpio_list == NULL) return 0; pin_cfg.gpio = gpio_list->gpio; pin_cfg.mul_sel = gpio_list->mul_sel; pin_cfg.pull = gpio_list->pull; pin_cfg.drv_level = gpio_list->drv_level; pin_cfg.data = gpio_list->data; ret = gpio_request(pin_cfg.gpio, NULL); if(0 != ret) { __wrn("%s failed, gpio_name=%s, gpio=%d, ret=%d\n", __func__, gpio_list->gpio_name, gpio_list->gpio, ret); return ret; } else { __inf("%s, gpio_name=%s, gpio=%d, ret=%d\n", __func__, gpio_list->gpio_name, gpio_list->gpio, ret); } ret = pin_cfg.gpio; if (!IS_AXP_PIN(pin_cfg.gpio)) { /* valid pin of sunxi-pinctrl, * config pin attributes individually. */ sunxi_gpio_to_name(pin_cfg.gpio, pin_name); config = SUNXI_PINCFG_PACK(SUNXI_PINCFG_TYPE_FUNC, pin_cfg.mul_sel); pin_config_set(SUNXI_PINCTRL, pin_name, config); if (pin_cfg.pull != GPIO_PULL_DEFAULT) { config = SUNXI_PINCFG_PACK(SUNXI_PINCFG_TYPE_PUD, pin_cfg.pull); pin_config_set(SUNXI_PINCTRL, pin_name, config); } if (pin_cfg.drv_level != GPIO_DRVLVL_DEFAULT) { config = SUNXI_PINCFG_PACK(SUNXI_PINCFG_TYPE_DRV, pin_cfg.drv_level); pin_config_set(SUNXI_PINCTRL, pin_name, config); } if (pin_cfg.data != GPIO_DATA_DEFAULT) { config = SUNXI_PINCFG_PACK(SUNXI_PINCFG_TYPE_DAT, pin_cfg.data); pin_config_set(SUNXI_PINCTRL, pin_name, config); } } else if (IS_AXP_PIN(pin_cfg.gpio)) { /* valid pin of axp-pinctrl, * config pin attributes individually. */ sunxi_gpio_to_name(pin_cfg.gpio, pin_name); if (pin_cfg.data != GPIO_DATA_DEFAULT) { config = SUNXI_PINCFG_PACK(SUNXI_PINCFG_TYPE_DAT, pin_cfg.data); pin_config_set(AXP_PINCTRL, pin_name, config); } } else { pr_warn("invalid pin [%d] from sys-config\n", pin_cfg.gpio); } return ret; }
__s32 video_config(__u32 vic) { // cts_enable = 1; // isHDMI = 1; // YCbCr444_Support = 0; // hdcp_enable = 1; __inf("video_config, vic:%d,cts_enable:%d,isHDMI:%d,YCbCr444_Support:%d,hdcp_enable:%d\n", vic,cts_enable,isHDMI,YCbCr444_Support,hdcp_enable); video_info.vic = vic; if((cts_enable==1) && (isHDMI == 0)) { video_info.is_hdmi = 0; } else { video_info.is_hdmi = 1; } if(cts_enable &&(!YCbCr444_Support)) { video_info.is_yuv = 0; } else { video_info.is_yuv = 0; //fixme, 1 } if((video_enable == 1) && (hdcp_enable == 1)) { video_info.is_hdcp = 1; __inf("hdmi full function\n"); } else if(video_enable==1) { video_info.is_hdcp = 0; __inf("hdmi video + audio\n"); } sunxi_video_config(&video_info); return 0; }
__s32 GetFileListInfo(__hdle hConfig, const char *secName, char *type, char *SrcPath, char *DesPath) { __u32 ret; if ((NULL == hConfig) || (NULL == secName) || (NULL == type) || (NULL == SrcPath) || (NULL == DesPath)) { return EPDK_FAIL; } /* get filelist type information */ ret = GetKeyString((HCONFIG)hConfig, (s8 *)secName, (s8 *)FILE_LIST_TYPE_NAME, (s8 *)type); if (ret != OK) { __inf("GetKeyValue failed\n"); return EPDK_FAIL; } /* get filelist source path information */ ret = GetKeyString((HCONFIG)hConfig, (s8 *)secName, (s8 *)FILE_LIST_SRC_PATH_NAME, (s8 *)SrcPath); if (ret != OK) { __inf("GetKeyValue failed\n"); return EPDK_FAIL; } /* get filelist dest path information */ ret = GetKeyString((HCONFIG)hConfig, (s8 *)secName, (s8 *)FILE_LIST_DES_PATH_NAME, (s8 *)DesPath); if (ret != OK) { __inf("GetKeyValue failed\n"); return EPDK_FAIL; } return EPDK_OK; }
__s32 Parse_VideoData_Block(__u8 *pbuf,__u8 size) { int i=0; while(i<size) { Device_Support_VIC[pbuf[i] &0x7f] = 1; if(pbuf[i] &0x80) { __inf("Parse_VideoData_Block: VIC %d(native) support\n", pbuf[i]&0x7f); } else { __inf("Parse_VideoData_Block: VIC %d support\n", pbuf[i]); } i++; } return 0; }
int disp_al_smbl_apply(unsigned int disp, struct disp_smbl_info *info) { static u32 count = 0; if(count < 10) { count ++; __inf("disp %d\n", disp); } return de_smbl_apply(disp, info); }
__s32 Hdmi_hal_audio_enable(__u8 mode, __u8 channel) { __inf("Hdmi_hal_audio_enable = %x\n",channel); if(channel) set_audio_enable(1); else set_audio_enable(0); return 0; }
int disp_al_smbl_sync(unsigned int disp) { static u32 count = 0; if(count < 10) { count ++; __inf("disp %d\n", disp); } return de_smbl_sync(disp); }
static __s32 Hdmi_close(void) { __inf("[Hdmi_close]\n"); Hdmi_enable(0); ghdmi.bopen = 0; return 0; }
void DDC_Init() { __inf("DDC_Init\n"); HDMI_WUINT32(0x504,HDMI_RUINT32(0x504)| 0x00000010);//set intial sequence HDMI_WUINT32(0x500,HDMI_RUINT32(0x500)| 0x08000000);//start while(HDMI_RUINT32(0x500)& 0x08000000); HDMI_WUINT32(0x504,HDMI_RUINT32(0x504)& 0xffffffef);//clear intial sequence }
__s32 boot_ui_progressbar_upgrate(__hdle p, int rate) { progressbar_t *progress = (progressbar_t *)p; int base_color, progresscolor; int pixel; int x1, y1; int x2, y2; if((rate < 0) || (rate > 100)) { __inf("boot ui progressbar: invalid progressbar rate\n"); return -1; } if(!p) { __inf("boot ui progressbar: invalid progressbar pointer\n"); return -1; } pixel = (rate * (progress->width - progress->thick*2)/100); if(rate == progress->progress_ratio) { return 0; } else { x1 = progress->pr_x; x2 = progress->st_x + pixel; progresscolor = (rate > progress->progress_ratio)?(progress->progress_color):(UI_BOOT_GUI_BLACK); progress->pr_x = x2; progress->progress_ratio = rate; } base_color = boot_ui_get_color(); boot_ui_set_color(progresscolor); y1 = progress->y1 + progress->thick; y2 = progress->y2 - progress->thick; boot_ui_draw_solidrectangle(x1, y1, x2, y2); boot_ui_set_color(base_color); wlibc_FlushDCacheRegion(ui_source.screen_buf,ui_source.screen_width*ui_source.screen_height*4); return 0; }
void LCD_get_panel_funs_0(__lcd_panel_fun_t * fun) { __inf("LCD_get_panel_funs_0\n"); #ifdef LCD_PARA_USE_CONFIG fun->cfg_panel_info = LCD_cfg_panel_info;//delete this line if you want to use the lcd para define in sys_config1.fex #endif fun->cfg_open_flow = LCD_open_flow; fun->cfg_close_flow = LCD_close_flow; fun->lcd_user_defined_func = LCD_user_defined_func; }
/* ************************************************************************************************************ * * function * * 函数名称: * * 参数列表: * * 返回值 : * * 说明 : * * ************************************************************************************************************ */ void power_set_usbpc(void) { __inf("set pc\n"); if(usb_ac_enable_gpio_hd) { wBoot_GPIO_Write_One_PIN_Value(usb_ac_enable_gpio_hd, 0, "usb_ac_enable_gpio"); } wBoot_power_cur_limit(usbpc_cur); wBoot_power_vol_limit(usbpc_vol); }
static void __exit lcd_module_exit(void) { __inf("lcd_module_exit\n"); device_destroy(g_lcd_drv.lcd_class, g_lcd_drv.devid); class_destroy(g_lcd_drv.lcd_class); cdev_del(g_lcd_drv.lcd_cdev); }
__s32 video_enter_lp(void) { __inf("video enter lp\n"); hdmi_state = HDMI_State_Idle; bsp_hdmi_standby(); hdmi_para_reset(); return 0; }
__s32 set_video_enable(bool enable) { int ret = 0; mutex_lock(&hdmi_lock); __inf("set_video_enable = %x!\n",enable); __inf("video_on @ set_video_enable = %d!\n",video_on); if((hdmi_state == HDMI_State_HPD_Done) && enable && (0 == video_on)) { video_config(glb_video_para.vic); __inf("set_video_enable, vic:%d,is_hdmi:%d,is_yuv:%d,is_hcts:%d\n", glb_video_para.vic, glb_video_para.is_hdmi,glb_video_para.is_yuv, glb_video_para.is_hcts); if(bsp_hdmi_video(&glb_video_para)) { __wrn("set hdmi video error!\n"); ret = -1; goto video_en_end; } bsp_hdmi_set_video_en(enable); video_on = 1; if(((glb_audio_para.type != 1) && (true == audio_enable)) || ((glb_audio_para.type == 1) && (audio_cfged == true)) ) { if(audio_config_internal()) { __wrn("set audio_config_internal error!\n"); ret = -1; goto video_en_end; } } } else { video_on = 0; bsp_hdmi_set_video_en(enable); } video_enable = enable; video_en_end: mutex_unlock(&hdmi_lock); return ret; }
/* ************************************************************************************************************ * * function * * 函数名称: * * 参数列表: * * 返回值 : * * 说明 : * * ************************************************************************************************************ */ int power_set_init(void) { script_gpio_set_t gpio; int ret; __inf("set pc\n"); ret = wBoot_script_parser_fetch("usbc0", "usb_ac_enable_gpio", &gpio, 1); if(ret >= 0) { usb_ac_enable_gpio_hd = wBoot_GPIO_Request(&gpio, 1); } wBoot_script_parser_fetch("pmu_para", "pmu_usbvol", &usbdc_vol, 1); wBoot_script_parser_fetch("pmu_para", "pmu_usbcur", &usbdc_cur, 1); wBoot_script_parser_fetch("pmu_para", "pmu_usbvol_pc", &usbpc_vol, 1); wBoot_script_parser_fetch("pmu_para", "pmu_usbcur_pc", &usbpc_cur, 1); __inf("usbdc_vol = %d, usbdc_cur = %d\n", usbdc_vol, usbdc_cur); __inf("usbpc_vol = %d, usbpc_cur = %d\n", usbpc_vol, usbpc_cur); return 0; }
static void __exit lcd_module_exit(void) { __inf("lcd_module_exit\n"); device_destroy(lcd_class, devid); class_destroy(lcd_class); cdev_del(my_cdev); }
static void LCD_io_exit(__u32 sel) { __inf("------+++++++++++++lcd exit*************\n"); //release SCLB gpio LCD_GPIO_release(sel, 0); //release SDAB gpio LCD_GPIO_release(sel, 1); }
//hpd: 0 plugout; 1 plugin __s32 BSP_disp_set_hdmi_hpd(__u32 hpd) { if(hpd == 1) { gdisp.screen[0].hdmi_hpd = 1; gdisp.screen[0].hdmi_hpd = 1; if(gdisp.screen[0].status & HDMI_ON) { if(BSP_dsip_hdmi_get_input_csc(0) == 0) { __inf("BSP_disp_set_hdmi_hpd: hdmi output rgb\n"); gdisp.screen[0].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_RGB; BSP_disp_set_output_csc(0, gdisp.screen[0].output_csc_type); }else { __inf("BSP_disp_set_hdmi_hpd: hdmi output yuv\n");//default yuv gdisp.screen[0].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_YUV; BSP_disp_set_output_csc(0, gdisp.screen[0].output_csc_type); } } else if(gdisp.screen[1].status & HDMI_ON) { if(BSP_dsip_hdmi_get_input_csc(1) == 0) { __inf("BSP_disp_set_hdmi_hpd: hdmi output rgb\n"); gdisp.screen[1].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_RGB; BSP_disp_set_output_csc(1, gdisp.screen[1].output_csc_type); }else { __inf("BSP_disp_set_hdmi_hpd: hdmi output yuv\n"); gdisp.screen[1].output_csc_type = DISP_OUT_CSC_TYPE_HDMI_YUV;//default yuv BSP_disp_set_output_csc(1, gdisp.screen[1].output_csc_type); } } } else { gdisp.screen[0].hdmi_hpd = 0; gdisp.screen[0].hdmi_hpd = 0; } return 0; }
__s32 OSAL_CCMU_SetSrcFreq( __u32 nSclkNo, __u32 nFreq ) { struct clk* hSysClk = NULL; s32 retCode = -1; __disp_clk_t *disp_clk = NULL; disp_clk = (__disp_clk_t*)osal_ccmu_get_clk_by_name(nSclkNo); if(disp_clk == NULL) { __wrn("Fail to get clk name from clk id [%d].\n", nSclkNo); return -1; } else if(!strcmp(disp_clk->name, "none")) { __inf("OSAL_CCMU_SetSrcFreq, name of clk %d is none! \n", disp_clk->id); return -1; } __inf("OSAL_CCMU_SetSrcFreq, <%s,%d>\n", disp_clk->name, nFreq); hSysClk = clk_get(NULL, disp_clk->name); if(NULL == hSysClk || IS_ERR(hSysClk)) { __wrn("Fail to get handle for system clock %s.\n", disp_clk->name); return -1; } if(nFreq == clk_get_rate(hSysClk)) { __inf("Sys clk %s freq is alreay %d, not need to set.\n", disp_clk->name, nFreq); clk_put(hSysClk); return 0; } __inf("OSAL_CCMU_SetSrcFreq, clk hdl=0x%x\n", (int)hSysClk); retCode = clk_set_rate(hSysClk, nFreq); if(0 != retCode) { __wrn("Fail to set nFreq[%d] for sys clk[%d].\n", nFreq, nSclkNo); clk_put(hSysClk); return retCode; } clk_put(hSysClk); hSysClk = NULL; return retCode; }
int disp_al_capture_sync(u32 disp) { static u32 count = 0; if(count < 10) { count ++; __inf("disp %d\n", disp); } WB_EBIOS_Update_Regs(disp); WB_EBIOS_Writeback_Enable(disp, 1); return 0; }