int s3cfb_extdsp_init_fbinfo(struct s3cfb_extdsp_global *fbdev, int id) { struct fb_info *fb = fbdev->fb[id]; struct fb_fix_screeninfo *fix = &fb->fix; struct fb_var_screeninfo *var = &fb->var; struct s3cfb_extdsp_window *win = fb->par; struct s3cfb_extdsp_lcd *lcd = fbdev->lcd; memset(win, 0, sizeof(struct s3cfb_extdsp_window)); platform_set_drvdata(to_platform_device(fbdev->dev), fb); strcpy(fix->id, S3CFB_EXTDSP_NAME); /* extdsp specific */ s3cfb_extdsp_update_power_state(fbdev, 0, FB_BLANK_POWERDOWN); /* fbinfo */ fb->fbops = &s3cfb_extdsp_ops; fb->flags = FBINFO_FLAG_DEFAULT; fb->pseudo_palette = &win->pseudo_pal; #if (CONFIG_FB_S5P_EXTDSP_NR_BUFFERS != 1) fix->xpanstep = 2; fix->ypanstep = 1; #else fix->xpanstep = 0; fix->ypanstep = 0; #endif fix->type = FB_TYPE_PACKED_PIXELS; fix->accel = FB_ACCEL_NONE; fix->visual = FB_VISUAL_TRUECOLOR; var->xres = lcd->width; var->yres = lcd->height; var->xres_virtual = var->xres; var->yres_virtual = var->yres * CONFIG_FB_S5P_EXTDSP_NR_BUFFERS; var->bits_per_pixel = 16; var->xoffset = 0; var->yoffset = 0; var->width = 0; var->height = 0; var->transp.length = 0; fix->line_length = var->xres_virtual * var->bits_per_pixel / 8; fix->smem_len = fix->line_length * var->yres_virtual; var->nonstd = 0; var->activate = FB_ACTIVATE_NOW; var->vmode = FB_VMODE_NONINTERLACED; var->hsync_len = 0; var->vsync_len = 0; var->left_margin = 0; var->right_margin = 0; var->upper_margin = 0; var->lower_margin = 0; var->pixclock = 0; return 0; }
static int s3cfb_extdsp_probe(struct platform_device *pdev) { struct s3c_platform_fb *pdata = NULL; struct s3cfb_extdsp_global *fbdev[2]; int ret = -1; fbextdsp = kzalloc(sizeof(struct s3cfb_extdsp_extdsp_desc), GFP_KERNEL); if (!fbextdsp) goto err; /* global structure */ fbextdsp->fbdev[0] = kzalloc(sizeof(struct s3cfb_extdsp_global), GFP_KERNEL); fbdev[0] = fbextdsp->fbdev[0]; if (!fbdev[0]) { dev_err(fbdev[0]->dev, "failed to allocate for " "global fb structure extdsp[%d]!\n", 0); goto err1; } fbdev[0]->dev = &pdev->dev; /* platform_data*/ pdata = to_extdsp_plat(&pdev->dev); /* lcd setting */ fbdev[0]->lcd = (struct s3cfb_extdsp_lcd *)pdata->lcd; /* hw setting */ s3cfb_extdsp_init_global(fbdev[0]); fbdev[0]->system_state = POWER_ON; /* alloc fb_info */ if (s3cfb_extdsp_alloc_framebuffer(fbdev[0], 0)) { dev_err(fbdev[0]->dev, "alloc error extdsp[%d]\n", 0); goto err2; } /* register fb_info */ if (s3cfb_extdsp_register_framebuffer(fbdev[0])) { dev_err(fbdev[0]->dev, "register error extdsp[%d]\n", 0); goto err2; } /* disable display as default */ s3cfb_extdsp_disable_window(fbdev[0], 0); s3cfb_extdsp_update_power_state(fbdev[0], 0, FB_BLANK_POWERDOWN); #ifdef CONFIG_BUSFREQ_OPP /* To lock bus frequency in OPP mode */ fbdev[0]->bus_dev = dev_get("exynos-busfreq"); #endif #ifdef CONFIG_HAS_WAKELOCK #ifdef CONFIG_HAS_EARLYSUSPEND fbdev[0]->early_suspend.suspend = s3cfb_extdsp_early_suspend; fbdev[0]->early_suspend.resume = s3cfb_extdsp_late_resume; fbdev[0]->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 5; register_early_suspend(&fbdev[0]->early_suspend); #endif #endif dev_info(fbdev[0]->dev, "registered successfully\n"); return 0; err2: kfree(fbextdsp->fbdev[0]); err1: kfree(fbextdsp); err: return ret; }