void tl2796_late_resume(struct early_suspend *h) { struct s5p_lcd *lcd = container_of(h, struct s5p_lcd, early_suspend); tl2796_ldi_enable(lcd); return; }
void s3cfb_late_resume(struct early_suspend *h) { struct s3cfb_global *info = container_of(h,struct s3cfb_global,early_suspend); struct s3c_platform_fb *pdata = to_fb_plat(info->dev); struct fb_info *fb; struct s3cfb_window *win; int i, j; struct platform_device *pdev = to_platform_device(info->dev); printk("s3cfb_late_resume is called\n"); //urbetter if (pdata->backlight_off) pdata->backlight_off(pdev); #ifdef ENABLE_SMDKV210_REGULATOR //urbetter /* ldo6 regulator on */ regulator_enable(lcd_regulator); #endif dev_dbg(info->dev, "wake up from suspend\n"); if (pdata->cfg_gpio) pdata->cfg_gpio(pdev); #if defined(CONFIG_FB_S3C_DUMMYLCD) max8698_ldo_enable_direct(MAX8698_LDO4); #endif #if defined (CONFIG_FB_S3C_LTE480WV) || defined(CONFIG_FB_S3C_UT10GM) || defined(CONFIG_FB_S3C_UT7GM) || defined(CONFIG_FB_URBETTER_SERIAL) || defined(CONFIG_FB_S3C_UTAUO104) if (info->lcd->init_ldi) fbdev->lcd->init_ldi(); else printk("no init_ldi\n"); #endif if (pdata->clk_on) pdata->clk_on(pdev, &fbdev->clock); s3cfb_init_global(); s3cfb_set_clock(info); s3cfb_display_on(info); for (i = pdata->default_win; i < pdata->nr_wins + pdata->default_win; i++) { j = i % pdata->nr_wins; fb = info->fb[j]; win = fb->par; if ((win->path == DATA_PATH_DMA) && (win->enabled)) { s3cfb_set_par(fb); s3cfb_enable_window(win->id); } } #if 1 // enable VSYNC s3cfb_set_vsync_interrupt(fbdev, 1); s3cfb_set_global_interrupt(fbdev, 1); #endif /* Reset the LDI chip */ if (pdata->lcd_on) pdata->lcd_on(pdev); #if defined(CONFIG_FB_S3C_TL2796) tl2796_ldi_init(); tl2796_ldi_enable(); #elif defined (CONFIG_FB_S3C_LTE480WV) || defined(CONFIG_FB_S3C_UT10GM) || defined(CONFIG_FB_S3C_UT7GM) || defined(CONFIG_FB_URBETTER_SERIAL) || defined(CONFIG_FB_S3C_UTAUO104) if (info->lcd->init_ldi) fbdev->lcd->init_ldi(); else printk("no init_ldi\n"); #endif if (pdata->backlight_on) pdata->backlight_on(pdev); return ; }
static int __devinit tl2796_probe(struct spi_device *spi) { struct s5p_lcd *lcd; int ret; lcd = kzalloc(sizeof(struct s5p_lcd), GFP_KERNEL); if (!lcd) { pr_err("failed to allocate for lcd\n"); ret = -ENOMEM; goto err_alloc; } mutex_init(&lcd->lock); spi->bits_per_word = 9; if (spi_setup(spi)) { pr_err("failed to setup spi\n"); ret = -EINVAL; goto err_setup; } lcd->g_spi = spi; lcd->dev = &spi->dev; lcd->bl = 255; if (!spi->dev.platform_data) { dev_err(lcd->dev, "failed to get platform data\n"); ret = -EINVAL; goto err_setup; } lcd->data = (struct s5p_panel_data *)spi->dev.platform_data; if (!lcd->data->gamma_table || !lcd->data->seq_display_set || !lcd->data->seq_etc_set || !lcd->data->standby_on || !lcd->data->standby_off) { dev_err(lcd->dev, "Invalid platform data\n"); ret = -EINVAL; goto err_setup; } lcd->gamma_adj_points = lcd->data->gamma_adj_points ?: &default_gamma_adj_points; lcd->bl_dev = backlight_device_register("s5p_bl", &spi->dev, lcd, &s5p_bl_ops, NULL); if (!lcd->bl_dev) { dev_err(lcd->dev, "failed to register backlight\n"); ret = -EINVAL; goto err_setup; } lcd->bl_dev->props.max_brightness = 255; spi_set_drvdata(spi, lcd); tl2796_ldi_enable(lcd); #ifdef CONFIG_HAS_EARLYSUSPEND lcd->early_suspend.suspend = tl2796_early_suspend; lcd->early_suspend.resume = tl2796_late_resume; lcd->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 1; register_early_suspend(&lcd->early_suspend); #endif pr_info("tl2796_probe successfully proved\n"); return 0; err_setup: mutex_destroy(&lcd->lock); kfree(lcd); err_alloc: return ret; }
static int __devinit tl2796_probe(struct spi_device *spi) { struct s5p_lcd *lcd; int ret; lcd = kzalloc(sizeof(*lcd), GFP_KERNEL); if (!lcd) { pr_err("failed to allocate for lcd\n"); ret = -ENOMEM; goto err_alloc; } mutex_init(&lcd->lock); spi->bits_per_word = 8; if (spi_setup(spi)) { pr_err("failed to setup spi\n"); ret = -EINVAL; goto err_setup; } lcd->g_spi = spi; lcd->dev = &spi->dev; lcd->bl = 255; if (!spi->dev.platform_data) { dev_err(lcd->dev, "failed to get platform data\n"); ret = -EINVAL; goto err_setup; } // lcd->data = (struct s5p_panel_data *)spi->dev.platform_data; //determinate of LCD type lcd->lcd_type = get_lcdtype(); ret = gpio_request(GPIO_LCD_BL_PWM, "lcd_bl_pwm"); if (ret < 0) { dev_err(lcd->dev, "unable to request gpio for backlight\n"); return ret; } s3c_gpio_cfgpin(GPIO_LCD_BL_PWM, (0x2 << 0)); lcd->backlight_pwm_dev = pwm_request(0, "backlight-pwm"); if (IS_ERR(lcd->backlight_pwm_dev)) { dev_err(lcd->dev, "unable to request PWM for backlight\n"); } else dev_err(lcd->dev, "got pwm for backlight\n"); pwm_config(lcd->backlight_pwm_dev, (bl_freq_count*70)/100, bl_freq_count); pwm_enable(lcd->backlight_pwm_dev); lcd->bl_dev = backlight_device_register("s5p_bl", &spi->dev, lcd, &s5p_bl_ops, NULL); if (!lcd->bl_dev) { dev_err(lcd->dev, "failed to register backlight\n"); ret = -EINVAL; goto err_setup; } lcd->bl_dev->props.max_brightness = 255; lcd->lcd_dev = lcd_device_register("s5p_lcd", &spi->dev, lcd, &s5p_lcd_ops); if (!lcd->lcd_dev) { dev_err(lcd->dev, "failed to register lcd\n"); ret = -EINVAL; goto err_setup_lcd; } // Class and device file creation printk(KERN_ERR "ldi_class create\n"); lcd->ldi_class = class_create(THIS_MODULE, "ldi_class"); if (IS_ERR(lcd->ldi_class)) pr_err("Failed to create class(ldi_class)!\n"); lcd->ldi_dev = device_create(lcd->ldi_class, &spi->dev, 0, lcd, "ldi_dev"); if (IS_ERR(lcd->ldi_dev)) pr_err("Failed to create device(ldi_dev)!\n"); if (!lcd->ldi_dev) { dev_err(lcd->dev, "failed to register device(ldi_dev)\n"); ret = -EINVAL; goto err_setup_ldi; } if (device_create_file(lcd->ldi_dev, &dev_attr_update_brightness_cmd) < 0) pr_err("Failed to create device file(%s)!\n", dev_attr_update_brightness_cmd.attr.name); spi_set_drvdata(spi, lcd); tl2796_ldi_enable(lcd); #ifdef CONFIG_FB_S3C_MDNIE init_mdnie_class(); //set mDNIe UI mode, Outdoormode #endif #ifdef CONFIG_HAS_EARLYSUSPEND lcd->early_suspend.suspend = tl2796_early_suspend; lcd->early_suspend.resume = tl2796_late_resume; lcd->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 1; register_early_suspend(&lcd->early_suspend); #endif gprintk("tl2796_probe successfully probed\n", __func__); return 0; err_setup_ldi: lcd_device_unregister(lcd->lcd_dev); err_setup_lcd: backlight_device_unregister(lcd->bl_dev); err_setup: mutex_destroy(&lcd->lock); kfree(lcd); err_alloc: return ret; }