summaryrefslogtreecommitdiff
path: root/drivers/video/wmt/devices/lcd-oem.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 20:10:08 +0530
committerSrikant Patnaik2015-01-11 20:10:08 +0530
commit6be9593ee4352c19377a47475fdcd8473897ac42 (patch)
treeb85d6e3d961374d41c446318e2c2598272a8e86c /drivers/video/wmt/devices/lcd-oem.c
parentddd6804ba90290b66ebff05b99752fcdd75fec45 (diff)
downloadFOSSEE-netbook-kernel-source-6be9593ee4352c19377a47475fdcd8473897ac42.tar.gz
FOSSEE-netbook-kernel-source-6be9593ee4352c19377a47475fdcd8473897ac42.tar.bz2
FOSSEE-netbook-kernel-source-6be9593ee4352c19377a47475fdcd8473897ac42.zip
Fix white screen issue during bootup
Signed-off-by: Manish Patel <manish.patel@xzadium.com>
Diffstat (limited to 'drivers/video/wmt/devices/lcd-oem.c')
-rw-r--r--[-rwxr-xr-x]drivers/video/wmt/devices/lcd-oem.c189
1 files changed, 41 insertions, 148 deletions
diff --git a/drivers/video/wmt/devices/lcd-oem.c b/drivers/video/wmt/devices/lcd-oem.c
index c079505e..ed5f3407 100755..100644
--- a/drivers/video/wmt/devices/lcd-oem.c
+++ b/drivers/video/wmt/devices/lcd-oem.c
@@ -2,7 +2,7 @@
* linux/drivers/video/wmt/lcd-oem.c
* WonderMedia video post processor (VPP) driver
*
- * Copyright c 2014 WonderMedia Technologies, Inc.
+ * Copyright c 2013 WonderMedia Technologies, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,46 +42,21 @@
/*--------------------- INTERNAL PRIVATE FUNCTIONS ---------------------------*/
/* void lcd_xxx(void); *//*Example*/
-#ifdef CONFIG_UBOOT
-int lcd_bl_time;
-void lcd_uboot_set_backlight(void)
-{
- int cur;
- do {
- wmt_read_ostc(&cur);
- } while (cur < lcd_bl_time);
- REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x800; /* BL( bit 11 ) */
-}
-#endif
-
-void lcd_oem_enable_backlight(int wait_ms)
-{
-#ifdef CONFIG_UBOOT
- wmt_read_ostc(&lcd_bl_time);
- lcd_bl_time += (wait_ms * 1000);
-#else
- mdelay(wait_ms);
- REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x800;
-#endif
-}
-
-#ifndef CONFIG_VPP_SHENZHEN
static void lcd_oem_initial(void)
{
- outl(inl(GPIO_BASE_ADDR + 0x80) | 0x801, GPIO_BASE_ADDR + 0x80);
- outl(inl(GPIO_BASE_ADDR + 0xC0) | 0x801, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0x80) |= 0x801;
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x801;
lcd_enable_signal(1);
}
static void lcd_oem_uninitial(void)
{
- outl(inl(GPIO_BASE_ADDR + 0xC0) & ~0x801, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) &= ~0x801;
lcd_enable_signal(0);
}
-#endif
-struct lcd_parm_t lcd_oem_parm = {
+lcd_parm_t lcd_oem_parm = {
.bits_per_pixel = 24,
.capability = LCD_CAP_VSYNC_HI,
.vmode = {
@@ -100,42 +75,34 @@ struct lcd_parm_t lcd_oem_parm = {
.vmode = 0,
.flag = 0,
},
- .width = 222,
- .height = 125,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_initial,
- .uninitial = lcd_oem_uninitial
-#endif
+// .initial = lcd_oem_initial,
+// .uninitial = lcd_oem_uninitial
};
-#ifndef CONFIG_VPP_SHENZHEN
static void lcd_oem_1024x600_initial(void)
{
- outl(inl(GPIO_BASE_ADDR + 0x80) | 0x801, GPIO_BASE_ADDR + 0x80);
+ REG32_VAL(GPIO_BASE_ADDR + 0x80) |= 0x801; /* GPIO enable */
/* DVDD */
- /* T2 > 0ms */ /* AVDD/VCOM( bit 0 ) */
- outl(inl(GPIO_BASE_ADDR + 0xC0) | 0x01, GPIO_BASE_ADDR + 0xC0);
+ /* T2 > 0ms */
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x01; /* AVDD/VCOM( bit 0 ) */
/* T4 > 0ms */
/* VGH */
/* 0 < T6 <= 10ms */
lcd_enable_signal(1); /* singal, DVO enable */
mdelay(200); /* T12 > 200ms */
- outl(inl(GPIO_BASE_ADDR + 0xC0) | 0x800, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x800; /* BL( bit 11 ) */
}
static void lcd_oem_1024x600_uninitial(void)
{
- /* BL( bit 11 ) */
- outl(inl(GPIO_BASE_ADDR + 0xC0) & ~0x800, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) &= ~0x800; /* BL( bit 11 ) */
mdelay(200); /* T12 > 200ms */
lcd_enable_signal(0); /* singal, DVO enable */
- /* AVDD/VCOM( bit 0 ) */
- outl(inl(GPIO_BASE_ADDR + 0xC0) & ~0x01, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) &= ~0x01; /* AVDD/VCOM( bit 0 ) */
}
-#endif
-struct lcd_parm_t lcd_oem_parm_1024x600 = {
+lcd_parm_t lcd_oem_parm_1024x600 = {
.bits_per_pixel = 24,
.capability = LCD_CAP_VSYNC_HI,
.vmode = {
@@ -171,13 +138,11 @@ struct lcd_parm_t lcd_oem_parm_1024x600 = {
.flag = 0,
#endif
},
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_1024x600_initial,
- .uninitial = lcd_oem_1024x600_uninitial,
-#endif
+// .initial = lcd_oem_1024x600_initial,
+// .uninitial = lcd_oem_1024x600_uninitial,
};
-struct lcd_parm_t lcd_oem_parm_1024x768 = {
+lcd_parm_t lcd_oem_parm_1024x768 = {
.bits_per_pixel = 24,
.capability = LCD_CAP_VSYNC_HI,
.vmode = {
@@ -196,15 +161,11 @@ struct lcd_parm_t lcd_oem_parm_1024x768 = {
.vmode = 0,
.flag = 0,
},
- .width = 222,
- .height = 125,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_initial,
- .uninitial = lcd_oem_uninitial
-#endif
+// .initial = lcd_oem_initial,
+// .uninitial = lcd_oem_uninitial
};
-struct lcd_parm_t lcd_oem_parm_1366x768 = {
+lcd_parm_t lcd_oem_parm_1366x768 = {
.bits_per_pixel = 18,
.capability = LCD_CAP_CLK_HI,
.vmode = {
@@ -223,40 +184,11 @@ struct lcd_parm_t lcd_oem_parm_1366x768 = {
.vmode = 0,
.flag = 0,
},
- .width = 293,
- .height = 164,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_initial,
- .uninitial = lcd_oem_uninitial
-#endif
-};
-
-struct lcd_parm_t lcd_oem_parm_480x800 = {
- .bits_per_pixel = 18,
- .capability = LCD_CAP_CLK_HI,
- .vmode = {
- .name = "OEM 480x800",
- .refresh = 60,
- .xres = 480,
- .yres = 800,
- .pixclock = KHZ2PICOS(27000),
- .left_margin = 78,
- .right_margin = 78,
- .upper_margin = 60,
- .lower_margin = 60,
- .hsync_len = 4,
- .vsync_len = 4,
- .sync = 0,
- .vmode = 0,
- .flag = 0,
- },
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_initial,
- .uninitial = lcd_oem_uninitial
-#endif
+// .initial = lcd_oem_initial,
+// .uninitial = lcd_oem_uninitial
};
-struct lcd_parm_t lcd_oem_parm_800x480 = {
+lcd_parm_t lcd_oem_parm_800x480 = {
.bits_per_pixel = 18,
.capability = LCD_CAP_CLK_HI,
.vmode = {
@@ -275,41 +207,33 @@ struct lcd_parm_t lcd_oem_parm_800x480 = {
.vmode = 0,
.flag = 0,
},
- .width = 154,
- .height = 85,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_initial,
- .uninitial = lcd_oem_uninitial
-#endif
+// .initial = lcd_oem_initial,
+// .uninitial = lcd_oem_uninitial
};
-#ifndef CONFIG_VPP_SHENZHEN
static void lcd_oem_1280x800_initial(void)
{
DBG_MSG("lcd 10 power sequence\n");
- outl(inl(GPIO_BASE_ADDR + 0x80) | 0x801, GPIO_BASE_ADDR + 0x80);
+ REG32_VAL(GPIO_BASE_ADDR + 0x80) |= 0x801; /* GPIO enable */
/* VDD on */
/* 0 < T < 50ms */
lcd_enable_signal(1); /* singal on */
- /* VGH,VGL low */ /* AVDD/VCOM( bit 0 ) */
- outl(inl(GPIO_BASE_ADDR + 0xC0) | 0x01, GPIO_BASE_ADDR + 0xC0);
+ /* VGH,VGL low */
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x01; /* AVDD/VCOM( bit 0 ) */
mdelay(150); /* T5 > 120ms */
- outl(inl(GPIO_BASE_ADDR + 0xC0) | 0x800, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) |= 0x800; /* BL( bit 11 ) */
}
static void lcd_oem_1280x800_uninitial(void)
{
- /* turn off backlight */
- outl(inl(GPIO_BASE_ADDR + 0xC0) & ~0x800, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) &= ~0x800; /* turn off backlight */
mdelay(150);
- /* turn off LCD */
- outl(inl(GPIO_BASE_ADDR + 0xC0) & ~0x01, GPIO_BASE_ADDR + 0xC0);
+ REG32_VAL(GPIO_BASE_ADDR + 0xC0) &= ~0x01; /* turn off LCD */
lcd_enable_signal(0); /* turn off singal */
}
-#endif
-struct lcd_parm_t lcd_oem_parm_800x1280 = {
+lcd_parm_t lcd_oem_parm_800x1280 = {
.bits_per_pixel = 24,
.capability = LCD_CAP_CLK_HI,
.vmode = {
@@ -328,15 +252,11 @@ struct lcd_parm_t lcd_oem_parm_800x1280 = {
.vmode = 0,
.flag = 0,
},
- .width = 135,
- .height = 217,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_1280x800_initial,
- .uninitial = lcd_oem_1280x800_uninitial,
-#endif
+// .initial = lcd_oem_1280x800_initial,
+// .uninitial = lcd_oem_1280x800_uninitial,
};
-struct lcd_parm_t lcd_oem_parm_1280x800 = {
+lcd_parm_t lcd_oem_parm_1280x800 = {
.bits_per_pixel = 24,
.capability = LCD_CAP_CLK_HI,
.vmode = {
@@ -355,37 +275,12 @@ struct lcd_parm_t lcd_oem_parm_1280x800 = {
.vmode = 0,
.flag = 0,
},
- .width = 217,
- .height = 135,
-#ifndef CONFIG_VPP_SHENZHEN
- .initial = lcd_oem_1280x800_initial,
- .uninitial = lcd_oem_1280x800_uninitial,
-#endif
-};
-
-struct lcd_parm_t lcd_oem_parm_768x1024 = {
- .bits_per_pixel = 24,
- .capability = LCD_CAP_CLK_HI,
- .vmode = {
- .name = "oem_768x1024",
- .refresh = 60,
- .xres = 768,
- .yres = 1024,
- .pixclock = KHZ2PICOS(59300),
- .left_margin = 80,
- .right_margin = 80,
- .upper_margin = 23,
- .lower_margin = 18,
- .hsync_len = 7,
- .vsync_len = 5,
- .sync = 0,
- .vmode = 0,
- .flag = 0,
- },
+// .initial = lcd_oem_1280x800_initial,
+// .uninitial = lcd_oem_1280x800_uninitial,
};
/*----------------------- Function Body --------------------------------------*/
-struct lcd_parm_t *lcd_oem_get_parm(int arg)
+lcd_parm_t *lcd_oem_get_parm(int arg)
{
return &lcd_oem_parm;
}
@@ -399,20 +294,18 @@ int lcd_oem_init(void)
} /* End of lcd_oem_init */
module_init(lcd_oem_init);
-struct lcd_parm_t *lcd_get_oem_parm(int resx, int resy)
+lcd_parm_t *lcd_get_oem_parm(int resx, int resy)
{
- struct lcd_parm_t *oem_parm[] = {
- &lcd_oem_parm_480x800,
+ lcd_parm_t *oem_parm[] = {
&lcd_oem_parm_1024x600,
&lcd_oem_parm_1024x768,
&lcd_oem_parm_1366x768,
&lcd_oem_parm_800x480,
&lcd_oem_parm_800x1280,
&lcd_oem_parm_1280x800,
- &lcd_oem_parm_768x1024,
0
};
- struct lcd_parm_t *p;
+ lcd_parm_t *p;
int i;
for (i = 0; ; i++) {