1 #include <linux/kernel.h>
2 #include <linux/string.h>
5 #include <linux/rk_screen.h>
6 #include "rk2928_lvds.h"
8 static void rk_output_lvds(rk_screen *screen)
10 LVDSWrReg(m_PDN_CBG(1)|m_PD_PLL(0)|m_PDN(1)|m_OEN(0) \
11 |m_DS(DS_10PF)|m_MSBSEL(DATA_D0_MSB) \
12 |m_OUT_FORMAT(screen->lvds_format) \
13 |m_LCDC_SEL(screen->lcdc_id));
15 printk("%s>>connect to lcdc output interface%d\n",__func__,screen->lcdc_id);
18 static void rk_output_lvttl(rk_screen *screen)
20 LVDSWrReg(m_PDN_CBG(0)|m_PD_PLL(1)|m_PDN(0)|m_OEN(1) \
21 |m_DS(DS_10PF)|m_MSBSEL(DATA_D0_MSB) \
22 |m_OUT_FORMAT(screen->lvds_format) \
23 |m_LCDC_SEL(screen->lcdc_id));
24 printk("%s>>connect to lcdc output interface%d\n",__func__,screen->lcdc_id);
27 static void rk_output_disable(void)
29 LVDSWrReg(m_PDN_CBG(0)|m_PD_PLL(1)|m_PDN(0)|m_OEN(0));
30 printk("%s: reg = 0x%x\n", __func__, LVDSRdReg());
33 static int rk_lvds_set_param(rk_screen *screen,bool enable )
35 if(OUT_ENABLE == enable){
38 rk_output_lvds(screen);
42 rk_output_lvttl(screen);
45 printk("%s>>>>LVDS not support this screen type %d,power down LVDS\n",__func__,screen->type);
55 int rk_lvds_register(rk_screen *screen)
57 if(screen->sscreen_set == NULL)
58 screen->sscreen_set = rk_lvds_set_param;
60 rk_lvds_set_param(screen , OUT_ENABLE);