#include <mach/gpio.h>
#include <mach/iomux.h>
#include <linux/mpu.h>
+#include <linux/fb.h>
+#if defined(CONFIG_HDMI_RK30)
+ #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
+#endif
#include <linux/regulator/fixed.h>
#include <linux/mfd/wm8994/pdata.h>
}
-static struct rk29fb_info rk_fb_info = {
+#if defined(CONFIG_LCDC0_RK30)
+struct rk29fb_info lcdc0_screen_info = {
.fb_id = FB_ID,
+ .prop = PRMRY,
.mcu_fmk_pin = FB_MCU_FMK_PIN,
.lcd_info = &rk29_lcd_info,
.io_init = rk_fb_io_init,
.io_disable = rk_fb_io_disable,
.io_enable = rk_fb_io_enable,
+ .set_screen_info = set_lcd_info,
+};
+#endif
+#if defined(CONFIG_LCDC1_RK30)
+struct rk29fb_info lcdc1_screen_info = {
+ #if defined(CONFIG_HDMI_RK30)
+ .prop = EXTEND,
+ .lcd_info = NULL,
+ .set_screen_info = hdmi_set_info,
+ #endif
};
+#endif
static struct resource resource_fb[] = {
[0] = {
.id = -1,
.num_resources = ARRAY_SIZE(resource_fb),
.resource = resource_fb,
- .dev = {
- .platform_data = &rk_fb_info,
- }
};
#endif
#include <mach/io.h>
#include <mach/gpio.h>
#include <mach/iomux.h>
+#include <linux/fb.h>
+#if defined(CONFIG_HDMI_RK30)
+ #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
+#endif
#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
return 0;
}
-
-static struct rk29fb_info rk_fb_info = {
+#if defined(CONFIG_LCDC0_RK30)
+struct rk29fb_info lcdc0_screen_info = {
+ .prop = PRMRY, //primary display device
.io_init = rk_fb_io_init,
.io_disable = rk_fb_io_disable,
.io_enable = rk_fb_io_enable,
+ .set_screen_info = set_lcd_info,
+};
+#endif
+
+#if defined(CONFIG_LCDC1_RK30)
+struct rk29fb_info lcdc1_screen_info = {
+ #if defined(CONFIG_HDMI_RK30)
+ .prop = EXTEND, //extend display device
+ .lcd_info = NULL,
+ .set_screen_info = hdmi_set_info,
+ #endif
};
+#endif
static struct resource resource_fb[] = {
[0] = {
.id = -1,
.num_resources = ARRAY_SIZE(resource_fb),
.resource = resource_fb,
- .dev = {
- .platform_data = &rk_fb_info,
- }
};
#endif
#endif
#ifdef CONFIG_LCDC0_RK30
+extern struct rk29fb_info lcdc0_screen_info;
static struct resource resource_lcdc0[] = {
[0] = {
.name = "lcdc0 reg",
.id = 0,
.num_resources = ARRAY_SIZE(resource_lcdc0),
.resource = resource_lcdc0,
+ .dev = {
+ .platform_data = &lcdc0_screen_info,
+ },
};
#endif
#ifdef CONFIG_LCDC1_RK30
+extern struct rk29fb_info lcdc1_screen_info;
static struct resource resource_lcdc1[] = {
[0] = {
.name = "lcdc1 reg",
.id = 1,
.num_resources = ARRAY_SIZE(resource_lcdc1),
.resource = resource_lcdc1,
+ .dev = {
+ .platform_data = &lcdc1_screen_info,
+ },
};
#endif
#include <linux/types.h>
#include <linux/init.h>
#include <linux/device.h>
+#include <linux/rk_screen.h>
struct spi_cs_gpio {
const char *name;
int (*io_init)(void);
};
-struct rk29lcd_info {
- u32 lcd_id;
- u32 txd_pin;
- u32 clk_pin;
- u32 cs_pin;
- int (*io_init)(void);
- int (*io_deinit)(void);
-};
+
struct rk29_fb_setting_info {
u8 data_num;
struct rk29fb_info {
u32 fb_id;
+ enum rk_disp_prop prop; //display device property,like PRMRY,EXTEND
u32 mcu_fmk_pin;
struct rk29lcd_info *lcd_info;
int (*io_init)(struct rk29_fb_setting_info *fb_setting);
int (*io_deinit)(void);
int (*io_enable)(void);
int (*io_disable)(void);
+ void (*set_screen_info)(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info );
};
struct rk29_sdmmc_platform_data {
{
struct rk30_lcdc_device *lcdc_dev=NULL;
rk_screen *screen;
+ struct rk29fb_info *screen_ctr_info;
struct resource *res = NULL;
struct resource *mem;
int ret = 0;
}
platform_set_drvdata(pdev, lcdc_dev);
lcdc_dev->id = pdev->id;
+ screen_ctr_info = (struct rk29fb_info * )pdev->dev.platform_data;
screen = kzalloc(sizeof(rk_screen), GFP_KERNEL);
if(!screen)
{
printk("lcdc%d:reg_phy_base = 0x%08x,reg_vir_base:0x%p\n",pdev->id,lcdc_dev->reg_phy_base, lcdc_dev->preg);
lcdc_dev->driver.dev=&pdev->dev;
lcdc_dev->driver.screen = screen;
+ lcdc_dev->driver.screen_ctr_info = screen_ctr_info;
spin_lock_init(&lcdc_dev->reg_lock);
lcdc_dev->irq = platform_get_irq(pdev, 0);
if(lcdc_dev->irq < 0)
ret = rk_fb_register(&(lcdc_dev->driver),&lcdc_driver,lcdc_dev->id);
if(ret < 0)
{
- printk(KERN_ERR "registe fb for lcdc0 failed!\n");
+ printk(KERN_ERR "register fb for lcdc%d failed!\n",lcdc_dev->id);
goto err4;
}
printk("rk30 lcdc%d probe ok!\n",lcdc_dev->id);
return 0;
err4:
- free_irq(lcdc_dev->irq, pdev);
+ free_irq(lcdc_dev->irq,lcdc_dev);
err3:
iounmap(lcdc_dev->reg_vir_base);
err2:
#include <linux/earlysuspend.h>
#endif
-#include "../../display/screen/screen.h"
+//#include "../../display/screen/screen.h"
+#include<linux/rk_screen.h>
#include <linux/rk_fb.h>
#include "rk_hdmi.h"
{
info = inf->fb[2] ;
}
- pmy_var = &inf->fb[0]->var;
- pmy_fix = &inf->fb[0]->fix;
+
hdmi_var = &info->var;
hdmi_fix = &info->fix;
- hdmi_var->xres = pmy_var->xres;
- hdmi_var->yres = pmy_var->yres;
- hdmi_var->nonstd = pmy_var->nonstd;
+ #if defined(CONFIG_DUAL_DISP_IN_KERNEL)
+ pmy_var = &inf->fb[0]->var;
+ pmy_fix = &inf->fb[0]->fix;
+ hdmi_var->xres = pmy_var->xres;
+ hdmi_var->yres = pmy_var->yres;
+ hdmi_var->xres_virtual = pmy_var->xres_virtual;
+ hdmi_var->yres_virtual = pmy_var->yres_virtual;
+ hdmi_var->nonstd = pmy_var->nonstd;
+ #endif
//hdmi_fix->smem_start = pmy_fix->smem_start;
dev_drv = (struct rk_lcdc_device_driver * )info->par;
ret = dev_drv->load_screen(dev_drv,1);
}
lcdc_id = i;
init_lcdc_device_driver(dev_drv, def_drv,id);
- if(id == 0) //default use lcdc0 as primary dispaly controller
+ if(dev_drv->screen_ctr_info->set_screen_info)
{
- set_lcd_info(dev_drv->screen, fb_inf->mach_info->lcd_info);
+ dev_drv->screen_ctr_info->set_screen_info(dev_drv->screen,
+ dev_drv->screen_ctr_info->lcd_info);
+ if(dev_drv->screen_ctr_info->io_init)
+ dev_drv->screen_ctr_info->io_init(NULL);
}
- else if(id == 1)
+ else
{
- memcpy(dev_drv->screen,fb_inf->lcdc_dev_drv[0]->screen,sizeof(rk_screen));
- dev_drv->screen->init = NULL;
- dev_drv->screen->standby = NULL;
+ printk(KERN_WARNING "no display device on lcdc%d!?\n",dev_drv->id);
+ return -ENODEV;
}
dev_drv->init_lcdc(dev_drv);
early_suspend);
struct rk_fb_inf *inf = info->inf;
int i;
- inf->mach_info->io_disable();
for(i = 0; i < inf->num_lcdc; i++)
{
atomic_set(&inf->lcdc_dev_drv[i]->in_suspend,1);
+ if(inf->lcdc_dev_drv[i]->screen_ctr_info->io_disable)
+ inf->lcdc_dev_drv[i]->screen_ctr_info->io_disable();
if(inf->lcdc_dev_drv[i]->screen->standby)
inf->lcdc_dev_drv[i]->screen->standby(1);
early_suspend);
struct rk_fb_inf *inf = info->inf;
int i;
- inf->mach_info->io_enable();
for(i = 0; i < inf->num_lcdc; i++)
{
+ if(inf->lcdc_dev_drv[i]->screen_ctr_info->io_enable)
+ inf->lcdc_dev_drv[i]->screen_ctr_info->io_enable();
if(inf->lcdc_dev_drv[i]->screen->standby)
inf->lcdc_dev_drv[i]->screen->standby(0);
ret = -ENOMEM;
}
platform_set_drvdata(pdev,fb_inf);
- mach_info = pdev->dev.platform_data;
- fb_inf->mach_info = mach_info;
- if(mach_info->io_init)
- mach_info->io_init(NULL);
#if defined(CONFIG_HDMI_RK30)
#if defined(CONFIG_DUAL_DISP_IN_KERNEL)
fb_inf->workqueue = create_singlethread_workqueue("hdmi_post");
#include <linux/kernel.h>
#include <linux/mm.h>
#include <asm/div64.h>
-#include "../display/screen/screen.h"
+#include <linux/rk_screen.h>
#include <linux/rk_fb.h>
#include<linux/spinlock.h>
#include<asm/atomic.h>
#include <mach/board.h>
-#include<linux/rk_screen.h>
#define RK30_MAX_LCDC_SUPPORT 4
atomic_t in_suspend; //when enter suspend write or read lcdc register are forbidden
+ struct rk29fb_info *screen_ctr_info;
int (*open)(struct rk_lcdc_device_driver *dev_drv,int layer_id,bool open);
int (*init_lcdc)(struct rk_lcdc_device_driver *dev_drv);
int (*ioctl)(struct rk_lcdc_device_driver *dev_drv, unsigned int cmd,unsigned long arg,int layer_id);
#ifndef _SCREEN_H
#define _SCREEN_H
-#include <mach/board.h>
#ifdef CONFIG_HDMI_DUAL_DISP
/* Scaler PLL CONFIG */
} MCU_STATUS;
+enum rk_disp_prop{ //display device property
+ PRMRY = 0, //primary display device ,like LCD screen
+ EXTEND, //extend display device ,like hdmi ,tv out
+};
+
+struct rk29lcd_info {
+ u32 lcd_id;
+ u32 txd_pin;
+ u32 clk_pin;
+ u32 cs_pin;
+ int (*io_init)(void);
+ int (*io_deinit)(void);
+};
/* Screen description */