static void tcc8800_brightness_set(struct led_classdev *led_cdev, enum led_brightness value) { struct lcd_panel *lcd_panel = tccfb_get_panel(); if (lcd_panel->set_backlight_level) lcd_panel->set_backlight_level(lcd_panel, value); }
int display_booting_logo(void) { struct fbcon_config *fb_con; struct lcd_panel *panel_info; fb_con = &fb_cfg; panel_info = tccfb_get_panel(); lcdc_set_logo(panel_info->dev.lcdc_num, panel_info->xres, panel_info->yres, fb_con); }
unsigned *target_atag_panel(unsigned *ptr) { unsigned panel_id; struct lcd_panel *panel; panel = tccfb_get_panel(); panel_id = panel->id; *ptr++ = 3; *ptr++ = ATAG_TCC_PANEL; *ptr++ = panel_id; return ptr; }
static struct lcd_panel * lcdc_io_init(unsigned char lcdc_num) { struct lcd_panel *panel; unsigned int lclk; #if 0 // reset VIOD BITSET(pDDICfg->SWRESET, Hw3); BITSET(pDDICfg->SWRESET, Hw2); BITCLR(pDDICfg->SWRESET, Hw3); BITCLR(pDDICfg->SWRESET, Hw2); #endif// panel = tccfb_get_panel(); panel->dev.power_on = GPIO_LCD_ON; panel->dev.display_on = GPIO_LCD_DISPLAY; panel->dev.bl_on = GPIO_LCD_BL; panel->dev.reset = GPIO_LCD_RESET; panel->dev.lcdc_num = lcdc_num; panel->init(panel); if(lcdc_num) { tca_ckc_setperi(PERI_LCD1,ENABLE, panel->clk_freq * panel->clk_div); lclk = tca_ckc_getperi(PERI_LCD1); } else { tca_ckc_setperi(PERI_LCD0,ENABLE, panel->clk_freq * panel->clk_div); lclk = tca_ckc_getperi(PERI_LCD0); } printf("telechips tcc88xx %s lcdc:%d clk:%d set clk:%d \n", __func__, lcdc_num, panel->clk_freq, lclk); panel->set_power(panel, 1); printf("%s end\n", __func__); return panel; }
struct fbcon_config *lcdc_init(void) { #if defined(_M805_8923_) || defined(_M805_8925_) || (HW_REV == 0x1006) || (HW_REV == 0x1008) #define LCDC_NUM 0 #else #define LCDC_NUM 1 #endif struct lcd_panel *panel_info; struct fbcon_config *fbcon_cfg; struct tcc_lcdc_image_update Image_info; unsigned int lclk; #if 0 // reset VIOD BITSET(pDDICfg->SWRESET, Hw3); BITSET(pDDICfg->SWRESET, Hw2); BITCLR(pDDICfg->SWRESET, Hw3); BITCLR(pDDICfg->SWRESET, Hw2); #endif// panel_info = tccfb_get_panel(); panel_info->dev.power_on = GPIO_LCD_ON; panel_info->dev.display_on = GPIO_LCD_DISPLAY; panel_info->dev.bl_on = GPIO_LCD_BL; panel_info->dev.reset = GPIO_LCD_RESET; panel_info->dev.lcdc_num = LCDC_NUM; panel_info->init(panel_info); if(panel_info->dev.lcdc_num) { tca_ckc_setperi(PERI_LCD1,ENABLE, panel_info->clk_freq * panel_info->clk_div); lclk = tca_ckc_getperi(PERI_LCD1); } else { tca_ckc_setperi(PERI_LCD0,ENABLE, panel_info->clk_freq * panel_info->clk_div); lclk = tca_ckc_getperi(PERI_LCD0); } printf("telechips tcc88xx %s lcdc:%d clk:%d set clk:%d \n", __func__, LCDC_NUM, panel_info->clk_freq, lclk); dprintf(INFO, "lcdc: panel is %d x %d %dbpp\n", panel_info->xres, panel_info->yres, fb_cfg.bpp); #ifdef DISPLAY_SPLASH_SCREEN_DIRECT fb_cfg.stride = fb_cfg.width; #else fb_cfg.width = panel_info->xres; fb_cfg.height = panel_info->yres; fb_cfg.stride = fb_cfg.width; fb_cfg.bpp = LCDC_FB_BPP; fb_cfg.format = FB_FORMAT_RGB565; fb_cfg.base = dma_alloc(4096, fb_cfg.width * fb_cfg.height * (fb_cfg.bpp/8)); if (fb_cfg.base == NULL) dprintf(INFO, "lcdc: framebuffer alloc failed!\n"); #endif// dprintf(INFO, "fb_cfg base:0x%x xres:%d yres:%d bpp:%d \n",fb_cfg.base, fb_cfg.width, fb_cfg.height, fb_cfg.bpp); Image_info.addr0 = (unsigned int)fb_cfg.base; Image_info.Lcdc_layer = 0; Image_info.enable = 1; Image_info.Frame_width = Image_info.Image_width = fb_cfg.width; Image_info.Frame_height = Image_info.Image_height = fb_cfg.height; printf(INFO, "Frame_width:%d Image_width:%d width:%d \n",Image_info.Frame_width, Image_info.Image_width, fb_cfg.width); printf(INFO, "Frame_height:%d Image_height:%d width:%d \n",Image_info.Frame_height, Image_info.Image_height, fb_cfg.height); if(Image_info.Image_width > panel_info->xres) Image_info.Image_width = panel_info->xres; if(panel_info->xres > Image_info.Frame_width) Image_info.offset_x = (panel_info->xres - Image_info.Frame_width)/2; else Image_info.offset_x = 0; if(panel_info->yres > Image_info.Frame_height) Image_info.offset_y = (panel_info->yres - Image_info.Frame_height)/2; else Image_info.offset_y = 0; #ifdef _LCD_32BPP_ Image_info.fmt = TCC_LCDC_IMG_FMT_RGB888; #else Image_info.fmt = TCC_LCDC_IMG_FMT_RGB565; #endif tcclcd_image_ch_set(panel_info->dev.lcdc_num, &Image_info); panel_info->set_power(panel_info, 1); mdelay(1); panel_info->set_backlight_level(panel_info, DEFAULT_BACKLIGTH); fbcon_cfg = &fb_cfg; return fbcon_cfg; }