CONFIG_DISPLAY_SUPPORT=y
CONFIG_FB_ROCKCHIP=y
CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL=y
+CONFIG_LCDC_RK3188=y
+CONFIG_LCDC0_RK3188=y
+CONFIG_LCDC1_RK3188=y
CONFIG_LCD_B101EW05=y
CONFIG_RK_TRSM=y
CONFIG_RK_HDMI=y
CONFIG_DISPLAY_SUPPORT=y
CONFIG_FB_ROCKCHIP=y
CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL=y
+CONFIG_LCDC_RK3188=y
+CONFIG_LCDC0_RK3188=y
+CONFIG_LCDC1_RK3188=y
CONFIG_LCD_B101EW05=y
CONFIG_RK_TRSM=y
CONFIG_RK_HDMI=y
#if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
struct rk29fb_info lcdc0_screen_info = {
- #if defined(CONFIG_RK_HDMI)
- .prop = EXTEND, //extend display device
- .lcd_info = NULL,
+#if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC0) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
+ .prop = EXTEND, //extend display device
+ .io_init = NULL,
+ .io_disable = NULL,
+ .io_enable = NULL,
.set_screen_info = hdmi_init_lcdc,
- #endif
+#else
+ .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
};
#endif
#if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
struct rk29fb_info lcdc1_screen_info = {
+#if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC1) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
+ .prop = EXTEND, //extend display device
+ .io_init = NULL,
+ .io_disable = NULL,
+ .io_enable = NULL,
+ .set_screen_info = hdmi_init_lcdc,
+#else
.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
};
#endif
static struct resource resource_lcdc0[] = {
[0] = {
.name = "lcdc0 reg",
- .start = RK30_LCDC0_PHYS,
- .end = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
+ .start = RK3026_LCDC0_PHYS,
+ .end = RK3026_LCDC0_PHYS + RK3026_LCDC0_PHYS - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "lcdc0 irq",
- .start = IRQ_LCDC0,
- .end = IRQ_LCDC0,
+ .start = IRQ_LCDC,
+ .end = IRQ_LCDC,
.flags = IORESOURCE_IRQ,
},
};
static struct resource resource_lcdc1[] = {
[0] = {
.name = "lcdc1 reg",
- .start = RK30_LCDC1_PHYS,
- .end = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
+ .start = RK3026_LCDC1_PHYS,
+ .end = RK3026_LCDC1_PHYS + RK3026_LCDC1_PHYS - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
#if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
struct rk29fb_info lcdc0_screen_info = {
- #if defined(CONFIG_RK_HDMI)
- .prop = EXTEND, //extend display device
- .lcd_info = NULL,
+#if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC0) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
+ .prop = EXTEND, //extend display device
+ .io_init = NULL,
+ .io_disable = NULL,
+ .io_enable = NULL,
.set_screen_info = hdmi_init_lcdc,
- #endif
+#else
+ .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
};
#endif
#if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
struct rk29fb_info lcdc1_screen_info = {
+#if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC1) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
+ .prop = EXTEND, //extend display device
+ .io_init = NULL,
+ .io_disable = NULL,
+ .io_enable = NULL,
+ .set_screen_info = hdmi_init_lcdc,
+#else
.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
};
#endif
static struct resource resource_lcdc0[] = {
[0] = {
.name = "lcdc0 reg",
- .start = RK30_LCDC0_PHYS,
- .end = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
+ .start = RK3026_LCDC0_PHYS,
+ .end = RK3026_LCDC0_PHYS + RK3026_LCDC0_PHYS - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "lcdc0 irq",
- .start = IRQ_LCDC0,
- .end = IRQ_LCDC0,
+ .start = IRQ_LCDC,
+ .end = IRQ_LCDC,
.flags = IORESOURCE_IRQ,
},
};
static struct resource resource_lcdc1[] = {
[0] = {
.name = "lcdc1 reg",
- .start = RK30_LCDC1_PHYS,
- .end = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
+ .start = RK3026_LCDC1_PHYS,
+ .end = RK3026_LCDC1_PHYS + RK3026_LCDC1_PHYS - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
config LCDC_RK3188
bool "rk3188 lcdc support"
- depends on FB_ROCKCHIP && ARCH_RK3188
+ depends on FB_ROCKCHIP && (ARCH_RK3188 || ARCH_RK3026)
help
Driver for rk3188 lcdc.There are two lcd controllers on rk3188
config LCDC0_RK3188
}
rk3188_lcdc_read_reg_defalut_cfg(lcdc_dev);
+ #ifdef CONFIG_ARCH_RK3188
if(lcdc_dev->id == 0)
{
#if defined(CONFIG_LCDC0_IO_18V)
- v = 0x40004000; //bit14: 1,1.8v;0,3.3v
- writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+ v = 0x40004000; //bit14: 1,1.8v;0,3.3v
+ writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
#else
- v = 0x40000000;
- writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+ v = 0x40000000;
+ writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
#endif
}
-
if(lcdc_dev->id == 1) //iomux for lcdc1
{
#if defined(CONFIG_LCDC1_IO_18V)
iomux_set(LCDC1_D21);
iomux_set(LCDC1_D22);
iomux_set(LCDC1_D23);
-
}
+ #endif
lcdc_set_bit(lcdc_dev,SYS_CTRL,m_AUTO_GATING_EN);//eanble axi-clk auto gating for low power
//lcdc_set_bit(lcdc_dev,DSP_CTRL0,m_WIN0_TOP);
if(dev_drv->cur_screen->dsp_lut)
v_VASP(screen->vsync_len + screen->upper_margin));
}
spin_unlock(&lcdc_dev->reg_lock);
-
+ if(dev_drv->screen0->type == SCREEN_RGB) //iomux for RGB screen
+ {
+ iomux_set(LCDC0_DCLK);
+ iomux_set(LCDC0_HSYNC);
+ iomux_set(LCDC0_VSYNC);
+ iomux_set(LCDC0_DEN);
+ iomux_set(LCDC0_D10);
+ iomux_set(LCDC0_D11);
+ iomux_set(LCDC0_D12);
+ iomux_set(LCDC0_D13);
+ iomux_set(LCDC0_D14);
+ iomux_set(LCDC0_D15);
+ iomux_set(LCDC0_D16);
+ iomux_set(LCDC0_D17);
+ iomux_set(LCDC0_D18);
+ iomux_set(LCDC0_D19);
+ iomux_set(LCDC0_D20);
+ iomux_set(LCDC0_D21);
+ iomux_set(LCDC0_D22);
+ iomux_set(LCDC0_D23);
+ }
ret = clk_set_rate(lcdc_dev->dclk, screen->pixclock);
if(ret)
{
return ret;
}
+static int rk3188_lcdc_dpi_open(struct rk_lcdc_device_driver *dev_drv,bool open)
+{
+ struct rk3188_lcdc_device *lcdc_dev =
+ container_of(dev_drv,struct rk3188_lcdc_device,driver);
+ lcdc_msk_reg(lcdc_dev,SYS_CTRL,m_DIRECT_PATCH_EN,v_DIRECT_PATCH_EN(open));
+ lcdc_cfg_done(lcdc_dev);
+ return 0;
+}
+
+static int rk3188_lcdc_dpi_layer_sel(struct rk_lcdc_device_driver *dev_drv,int layer_id)
+{
+ struct rk3188_lcdc_device *lcdc_dev =
+ container_of(dev_drv,struct rk3188_lcdc_device,driver);
+ lcdc_msk_reg(lcdc_dev,SYS_CTRL,m_DIRECT_PATH_LAY_SEL,v_DIRECT_PATH_LAY_SEL(layer_id));
+ lcdc_cfg_done(lcdc_dev);
+ return 0;
+
+}
+static int rk3188_lcdc_dpi_status(struct rk_lcdc_device_driver *dev_drv)
+{
+ struct rk3188_lcdc_device *lcdc_dev =
+ container_of(dev_drv,struct rk3188_lcdc_device,driver);
+ int ovl = lcdc_read_bit(lcdc_dev,SYS_CTRL,m_DIRECT_PATCH_EN);
+ return ovl;
+}
static struct layer_par lcdc_layer[] = {
[0] = {
.fb_get_layer = rk3188_fb_get_layer,
.fb_layer_remap = rk3188_fb_layer_remap,
.set_dsp_lut = rk3188_set_dsp_lut,
+ .dpi_open = rk3188_lcdc_dpi_open,
+ .dpi_layer_sel = rk3188_lcdc_dpi_layer_sel,
+ .dpi_status = rk3188_lcdc_dpi_status,
};
static irqreturn_t rk3188_lcdc_isr(int irq, void *dev_id)
#define m_WIN1_FORMAT (7<<6)
#define m_HWC_COLOR_MODE (1<<9)
#define m_HWC_SIZE (1<<10)
-#define m_WIN0_3D_EN (1<11)
+#define m_WIN0_3D_EN (1<<11)
#define m_WIN0_3D_MODE (7<<12)
#define m_WIN0_RB_SWAP (1<<15)
#define m_WIN0_ALPHA_SWAP (1<<16)
#define v_WIN1_FORMAT(x) (((x)&7)<<6)
#define v_HWC_COLOR_MODE(x) (((x)&1)<<9)
#define v_HWC_SIZE(x) (((x)&1)<<10)
-#define v_WIN0_3D_EN(x) (((x)&1)<11)
+#define v_WIN0_3D_EN(x) (((x)&1)<<11)
#define v_WIN0_3D_MODE(x) (((x)&7)<<12)
#define v_WIN0_RB_SWAP(x) (((x)&1)<<15)
#define v_WIN0_ALPHA_SWAP(x) (((x)&1)<<16)
#define WIN1_LUT_ADDR (0x400)
#define DSP_LUT_ADDR (0x800)
+/*
+ RK3026/RK3028A max output resolution 1920x1080
+ support IEP instead of 3d
+*/
+#ifdef CONFIG_ARCH_RK3026
+//SYS_CTRL 0x00
+#define m_DIRECT_PATCH_EN (1<<11)
+#define m_DIRECT_PATH_LAY_SEL (1<<12)
+
+#define v_DIRECT_PATCH_EN(x) (((x)&1)<<11)
+#define v_DIRECT_PATH_LAY_SEL(x) (((x)&1)<<12)
+
+//INT_STATUS 0x10
+#define m_WIN0_EMPTY_INTR_EN (1<<24)
+#define m_WIN1_EMPTY_INTR_EN (1<<25)
+#define m_WIN0_EMPTY_INTR_CLR (1<<26)
+#define m_WIN1_EMPTY_INTR_CLR (1<<27)
+#define m_WIN0_EMPTY_INTR_STA (1<<28)
+#define m_WIN1_EMPTY_INTR_STA (1<<29)
+
+#define v_WIN0_EMPTY_INTR_EN(x) (((x)&1)<<24)
+#define v_WIN1_EMPTY_INTR_EN(x) (((x)&1)<<25)
+#define v_WIN0_EMPTY_INTR_CLR(x) (((x)&1)<<26)
+#define v_WIN1_EMPTY_INTR_CLR(x) (((x)&1)<<27)
+#define v_WIN0_EMPTY_INTR_STA(x) (((x)&1)<<28)
+#define v_WIN1_EMPTY_INTR_STA(x) (((x)&1)<<29)
+#endif
+
#define CalScale(x, y) ((((u32)(x-1))*0x1000)/(y-1))
return 0;
}
+int rk_fb_dpi_open(bool open)
+{
+ struct rk_lcdc_device_driver * dev_drv = NULL;
+ dev_drv = rk_get_prmry_lcdc_drv();
+ dev_drv->dpi_open(dev_drv,open);
+
+ return 0;
+}
+int rk_fb_dpi_layer_sel(int layer_id)
+{
+ struct rk_lcdc_device_driver * dev_drv = NULL;
+ dev_drv = rk_get_prmry_lcdc_drv();
+ dev_drv->dpi_layer_sel(dev_drv,layer_id);
+
+ return 0;
+}
+int rk_fb_dpi_status(void)
+{
+ int ret;
+ struct rk_lcdc_device_driver * dev_drv = NULL;
+ dev_drv = rk_get_prmry_lcdc_drv();
+ ret = dev_drv->dpi_status(dev_drv);
+
+ return ret;
+}
/******************************************
function:this function will be called by hdmi,when
dev_drv->lcdc_hdmi_process = def_drv->lcdc_hdmi_process;
if(def_drv->lcdc_reg_update)
dev_drv->lcdc_reg_update = def_drv->lcdc_reg_update;
+ if(def_drv->dpi_open)
+ dev_drv->dpi_open = def_drv->dpi_open;
+ if(def_drv->dpi_layer_sel)
+ dev_drv->dpi_layer_sel = def_drv->dpi_layer_sel;
+ if(def_drv->dpi_status)
+ dev_drv->dpi_status = def_drv->dpi_status;
init_layer_par(dev_drv);
init_completion(&dev_drv->frame_done);
spin_lock_init(&dev_drv->cpl_lock);
int (*read_dsp_lut)(struct rk_lcdc_device_driver *dev_drv,int *lut);
int (*lcdc_hdmi_process)(struct rk_lcdc_device_driver *dev_drv,int mode); //some lcdc need to some process in hdmi mode
int (*lcdc_rst)(struct rk_lcdc_device_driver *dev_drv);
+ int (*dpi_open)(struct rk_lcdc_device_driver *dev_drv,bool open);
+ int (*dpi_layer_sel)(struct rk_lcdc_device_driver *dev_drv,int layer_id);
+ int (*dpi_status)(struct rk_lcdc_device_driver *dev_drv);
};
extern rk_screen * rk_fb_get_prmry_screen(void);
u32 rk_fb_get_prmry_screen_pixclock(void);
+extern int rk_fb_dpi_open(bool open);
+extern int rk_fb_dpi_layer_sel(int layer_id);
+extern int rk_fb_dpi_status(void);
+
extern int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id);
extern int rk_fb_disp_scale(u8 scale_x, u8 scale_y,u8 lcdc_id);
extern int rkfb_create_sysfs(struct fb_info *fbi);