rk2928: lvds support, lcd support

This commit is contained in:
kfx
2012-08-07 11:23:32 +08:00
parent 0b7992563d
commit e109d315f3
3 changed files with 12 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
/* screen type & face */
screen->type = OUT_TYPE;
screen->face = OUT_FACE;
screen->hw_format = 1;
/* Screen size */
screen->x_res = H_VD;

View File

@@ -7,10 +7,16 @@
static void rk_output_lvds(rk_screen *screen)
{
LVDSWrReg(m_PD_PLL(1)|m_PD_PLL(0)|m_PDN(1)|m_OEN(0) \
printk("%s: %x\n", __func__, m_PDN_CBG(1)|m_PD_PLL(0)|m_PDN(1)|m_OEN(0) \
|m_DS(DS_10PF)|m_MSBSEL(DATA_D0_MSB) \
|m_OUT_FORMAT(screen->hw_format) \
|m_LCDC_SEL(FROM_LCDC0));
LVDSWrReg(m_PDN_CBG(1)|m_PD_PLL(0)|m_PDN(1)|m_OEN(0) \
|m_DS(DS_10PF)|m_MSBSEL(DATA_D0_MSB) \
|m_OUT_FORMAT(screen->hw_format) \
|m_LCDC_SEL(FROM_LCDC0));
printk("%s: reg = 0x%x\n", __func__, LVDSRdReg());
}
static void rk_output_lvttl(rk_screen *screen)
@@ -19,11 +25,13 @@ static void rk_output_lvttl(rk_screen *screen)
|m_DS(DS_10PF)|m_MSBSEL(DATA_D0_MSB) \
|m_OUT_FORMAT(screen->hw_format) \
|m_LCDC_SEL(FROM_LCDC0));
printk("%s: reg = 0x%x\n", __func__, LVDSRdReg());
}
static void rk_output_disable(void)
{
LVDSWrReg(m_PD_PLL(0)|m_PD_PLL(0)|m_PDN(0)|m_OEN(0));
printk("%s: reg = 0x%x\n", __func__, LVDSRdReg());
}
static int rk_lvds_set_param(rk_screen *screen,bool enable )
@@ -32,6 +40,7 @@ static int rk_lvds_set_param(rk_screen *screen,bool enable )
switch(screen->type){
case SCREEN_LVDS:
rk_output_lvds(screen);
break;
case SCREEN_RGB:
rk_output_lvttl(screen);

View File

@@ -8,7 +8,7 @@
#define LVDSWrReg(val) __raw_writel( val ,LVDS_CON0_REG)
#define m_value(x,offset,mask) \
((mask<<(offset+8)) | (x&mask)<<offset)
((mask<<(offset+16)) | (x&mask)<<offset)
#define OEN (1<<9)
#define m_OEN(x) m_value(x,9,1)