static int lcdc_fake_panel_probe(struct platform_device *pdev) { int ret = 0; struct hisi_panel_info *pinfo = NULL; struct device_node *np = NULL; if (hisi_fb_device_probe_defer(PANEL_NO)) { goto err_probe_defer; } HISI_FB_DEBUG("+.\n"); np = of_find_compatible_node(NULL, NULL, DTS_COMP_LCDC_FAKE_PANEL); if (!np) { HISI_FB_ERR("NOT FOUND device node %s!\n", DTS_COMP_LCDC_FAKE_PANEL); goto err_return; } pdev->id = 1; /* init lcd info */ pinfo = fake_panel_data.panel_info; memset(pinfo, 0, sizeof(struct hisi_panel_info)); pinfo->xres = 1080; pinfo->yres = 1920; pinfo->width = 61; pinfo->height = 109; pinfo->type = PANEL_NO; pinfo->orientation = LCD_PORTRAIT; pinfo->bpp = LCD_RGB888; pinfo->bgr_fmt = LCD_RGB; pinfo->bl_min = 1; pinfo->bl_max = 255; pinfo->bl_set_type = BL_SET_BY_PWM; pinfo->ifbc_type = IFBC_TYPE_NON; pinfo->vsync_ctrl_type = 0; pinfo->frc_enable = 0; pinfo->esd_enable = 0; pinfo->dirty_region_updt_support = 0; pinfo->sbl_support = 0; pinfo->smart_bl.strength_limit = 128; pinfo->smart_bl.calibration_a = 60; pinfo->smart_bl.calibration_b = 95; pinfo->smart_bl.calibration_c = 5; pinfo->smart_bl.calibration_d = 1; pinfo->smart_bl.t_filter_control = 5; pinfo->smart_bl.backlight_min = 480; pinfo->smart_bl.backlight_max = 4096; pinfo->smart_bl.backlight_scale = 0xff; pinfo->smart_bl.ambient_light_min = 14; pinfo->smart_bl.filter_a = 1738; pinfo->smart_bl.filter_b = 6; pinfo->smart_bl.logo_left = 0; pinfo->smart_bl.logo_top = 0; pinfo->ldi.h_back_porch = 11; pinfo->ldi.h_front_porch = 4; pinfo->ldi.h_pulse_width = 4; pinfo->ldi.v_back_porch = 10; pinfo->ldi.v_front_porch = 4; pinfo->ldi.v_pulse_width = 4; pinfo->mipi.lane_nums = DSI_4_LANES; pinfo->mipi.color_mode = DSI_24BITS_1; pinfo->mipi.vc = 0; pinfo->mipi.dsi_bit_clk = 480; pinfo->pxl_clk_rate = 150*1000000; /* alloc panel device data */ ret = platform_device_add_data(pdev, &fake_panel_data, sizeof(struct hisi_fb_panel_data)); if (ret) { HISI_FB_ERR("platform_device_add_data failed!\n"); goto err_device_put; } hisi_fb_add_device(pdev); HISI_FB_DEBUG("-.\n"); return 0; err_device_put: platform_device_put(pdev); err_return: return ret; err_probe_defer: return -EPROBE_DEFER; }
static int hisi_offlinecompser_probe(struct platform_device *pdev) { int ret = 0; struct hisi_panel_info *pinfo = NULL; struct hisi_fb_data_type *hisifd = NULL; struct platform_device *reg_dev = NULL; int i = 0; if (hisi_fb_device_probe_defer(PANEL_OFFLINECOMPOSER)) { goto err_probe_defer; } HISI_FB_DEBUG("+.\n"); BUG_ON(pdev == NULL); pdev->id = 1; pinfo = hisi_offlinecomposer_panel_data.panel_info; memset(pinfo, 0, sizeof(struct hisi_panel_info)); pinfo->xres = g_primary_lcd_xres; pinfo->yres = g_primary_lcd_yres; pinfo->type = PANEL_OFFLINECOMPOSER; /* alloc panel device data */ ret = platform_device_add_data(pdev, &hisi_offlinecomposer_panel_data, sizeof(struct hisi_fb_panel_data)); if (ret) { HISI_FB_ERR("platform_device_add_data failed!\n"); goto err_device_put; } reg_dev = hisi_fb_add_device(pdev); if (!reg_dev) { HISI_FB_ERR("hisi_fb_add_device failed!\n"); goto err_device_put; } hisifd = platform_get_drvdata(reg_dev); BUG_ON(hisifd == NULL); for (i = 0; i < HISI_DSS_OFFLINE_MAX_NUM; i++) { INIT_LIST_HEAD(&hisifd->offline_cmdlist_head[i]); hisifd->offline_wb_status[i] = e_status_idle; init_waitqueue_head(&hisifd->offline_writeback_wq[i]); } for (i = 0; i < HISI_DSS_OFFLINE_MAX_BLOCK; i++) { hisifd->block_rects[i] = (dss_rect_t *)kmalloc(sizeof(dss_rect_t), GFP_ATOMIC); if (!hisifd->block_rects[i]) { HISI_FB_ERR("block_rects[%d] failed to alloc!", i); goto err_device_put; } } hisifd->block_overlay = (dss_overlay_t *)kmalloc(sizeof(dss_overlay_t), GFP_ATOMIC); if (!hisifd->block_overlay) { HISI_FB_ERR("hisifd->block_overlay no mem.\n"); goto err_device_put; } memset(hisifd->block_overlay, 0, sizeof(dss_overlay_t)); for(i = 0; i < HISI_DSS_OFFLINE_MAX_LIST; i++){ ret = cmdlist_alloc_one_list(&hisifd->cmdlist_node[i], hisifd->ion_client); if(ret < 0){ HISI_FB_ERR("cmdlist_alloc_one_list no mem.\n"); goto err_device_put; } } hisi_dss_offline_module_default(hisifd); hisifd->dss_module_resource_initialized = true; HISI_FB_DEBUG("-.\n"); return 0; err_device_put: platform_device_put(pdev); return ret; err_probe_defer: return -EPROBE_DEFER; }