From 1f3bc5a9192a479d4306f39271c406dc523ebed0 Mon Sep 17 00:00:00 2001 From: ywj Date: Thu, 16 Aug 2012 14:31:09 +0800 Subject: [PATCH] new add LCD driver for factorytool --- drivers/video/display/screen/Kconfig | 2 + drivers/video/display/screen/Makefile | 1 + drivers/video/display/screen/lcd_common.c | 79 +++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 drivers/video/display/screen/lcd_common.c diff --git a/drivers/video/display/screen/Kconfig b/drivers/video/display/screen/Kconfig index 850ba6518c8d..0b62f51a534b 100644 --- a/drivers/video/display/screen/Kconfig +++ b/drivers/video/display/screen/Kconfig @@ -90,6 +90,8 @@ config LCD_HDMI_800x480 if support RK610, this setting can support dual screen output config LCD_HV070WSA100 bool "HV070WSA-100 1024X600" +config LCD_COMMON + bool "LCD COMMON" endchoice diff --git a/drivers/video/display/screen/Makefile b/drivers/video/display/screen/Makefile index 93aff20cc013..08f3f71b6d8b 100644 --- a/drivers/video/display/screen/Makefile +++ b/drivers/video/display/screen/Makefile @@ -41,3 +41,4 @@ obj-$(CONFIG_LCD_B101EW05) += lcd_b101ew05.o obj-$(CONFIG_LCD_HJ050NA_06A) += lcd_hj050na_06a.o obj-$(CONFIG_LCD_HSD100PXN_FOR_TDW851) += lcd_hsd100pxn_for_tdw851.o obj-$(CONFIG_LCD_HV070WSA100) += lcd_hv070wsa.o +obj-$(CONFIG_LCD_COMMON) += lcd_common.o diff --git a/drivers/video/display/screen/lcd_common.c b/drivers/video/display/screen/lcd_common.c new file mode 100644 index 000000000000..4d18e7b442aa --- /dev/null +++ b/drivers/video/display/screen/lcd_common.c @@ -0,0 +1,79 @@ +#include +#include +#include "../../rk29_fb.h" +#include +#include +#include +#include "screen.h" + +/* Base */ +#define OUT_TYPE SCREEN_RGB + +#define OUT_FACE OUT_D888_P666 + + +#define OUT_CLK 71000000 +#define LCDC_ACLK 300000000 //29 lcdc axi DMA ƵÂÊ + +/* Timing */ +#define H_PW 10 +#define H_BP 100 +#define H_VD 1280 +#define H_FP 18 + +#define V_PW 2 +#define V_BP 8 +#define V_VD 800 +#define V_FP 6 + +#define LCD_WIDTH 216 +#define LCD_HEIGHT 135 +/* Other */ +#define DCLK_POL 0 +#define SWAP_RB 0 + + +u32 lcdpamara[]={0x4B434F52,0x64636C5F,0x61746164,SCREEN_RGB,OUT_D888_P666,71000000,300000000,10,100,1280,18,2,8,800,6,216,135,0,0}; + +void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info ) +{ + /* screen type & face */ + screen->type = lcdpamara[3]; + screen->face = lcdpamara[4]; + + /* Screen size */ + screen->x_res = lcdpamara[9]; + screen->y_res = lcdpamara[13]; + + screen->width = lcdpamara[15]; + screen->height = lcdpamara[16]; + + /* Timing */ + screen->lcdc_aclk = lcdpamara[6]; + screen->pixclock = lcdpamara[5]; + screen->left_margin = lcdpamara[8]; + screen->right_margin = lcdpamara[10]; + screen->hsync_len = lcdpamara[7]; + screen->upper_margin = lcdpamara[12]; + screen->lower_margin = lcdpamara[14]; + screen->vsync_len = lcdpamara[11]; + + /* Pin polarity */ + screen->pin_hsync = 0; + screen->pin_vsync = 0; + screen->pin_den = 0; + screen->pin_dclk = lcdpamara[17]; + + /* Swap rule */ + screen->swap_rb = lcdpamara[18]; + screen->swap_rg = 0; + screen->swap_gb = 0; + screen->swap_delta = 0; + screen->swap_dumy = 0; + + /* Operation function*/ + screen->init = NULL; + screen->standby = NULL; + +} + -- 2.34.1