From 49e15e380f2b9c779ad7cad2bd7544ef506aa17f Mon Sep 17 00:00:00 2001
From: Bian Jiang
Date: Mon, 12 Mar 2012 18:26:32 +0800
Subject: [PATCH] LCD: Porting Citizen FL0904 0.46" SVGA flocs600
---
.config | 5 +-
arch/arm/mach-s5pv210/mach-smdkc110.c | 150 +++++++++++++++++++++++++++++++-
drivers/video/samsung/Kconfig | 9 ++-
drivers/video/samsung/Makefile | 1 +
drivers/video/samsung/s3cfb.c | 10 ++
drivers/video/samsung/s3cfb_flocs600.c | 46 ++++++++++
6 files changed, 217 insertions(+), 4 deletions(-)
create mode 100644 drivers/video/samsung/s3cfb_flocs600.c
diff --git a/.config b/.config
index 29d2580..d75abfc 100644
--- a/.config
+++ b/.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.7
-# Thu Mar 8 16:22:49 2012
+# Mon Mar 12 18:14:42 2012
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
@@ -1608,7 +1608,8 @@ CONFIG_FB_S3C_LCD_INIT=y
CONFIG_FB_S3C_DEFAULT_WINDOW=2
CONFIG_FB_S3C_NR_BUFFERS=4
# CONFIG_FB_S3C_VIRTUAL is not set
-CONFIG_FB_S3C_LTE480WV=y
+CONFIG_FB_S3C_FLOCS600=y
+# CONFIG_FB_S3C_LTE480WV is not set
# CONFIG_FB_S3C_HT101HD1 is not set
# CONFIG_FB_S3C_TL2796 is not set
# CONFIG_FB_S3C_LVDS is not set
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index deb377a..40273c9 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -164,7 +164,9 @@ static struct s3c2410_uartcfg smdkc110_uartcfgs[] __initdata = {
};
#define S5PV210_LCD_WIDTH 800
-#define S5PV210_LCD_HEIGHT 480
+//#define S5PV210_LCD_HEIGHT 480
+/* Change For Citizen SVGA-Flocs FL0904 By: Bian Jiang 2012.3.12 */
+#define S5PV210_LCD_HEIGHT 600
//#define S5PV210_VIDEO_SAMSUNG_MEMSIZE_FIMC0 (6144 * SZ_1K)
#define S5PV210_VIDEO_SAMSUNG_MEMSIZE_FIMC0 (24576 * SZ_1K)
@@ -837,6 +839,147 @@ static struct s3c_platform_fb lte480wv_fb_data __initdata = {
};
#endif
+#ifdef CONFIG_FB_S3C_FLOCS600
+/* Citizen FL0904 0.46" flocs600 Add By: Bian Jiang 2012.3.12 */
+static struct s3cfb_lcd flocs600 = {
+ .width = S5PV210_LCD_WIDTH,
+ .height = S5PV210_LCD_HEIGHT,
+ .bpp = 32,
+ .freq = 60,
+
+ .timing = {
+ .h_fp = 8,
+ .h_bp = 13,
+ .h_sw = 3,
+ .v_fp = 5,
+ .v_fpe = 1,
+ .v_bp = 7,
+ .v_bpe = 1,
+ .v_sw = 1,
+ },
+ .polarity = {
+ .rise_vclk = 0,
+ .inv_hsync = 1,
+ .inv_vsync = 1,
+ .inv_vden = 0,
+ },
+};
+
+static void flocs600_cfg_gpio(struct platform_device *pdev)
+{
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ s3c_gpio_cfgpin(S5PV210_GPF0(i), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV210_GPF0(i), S3C_GPIO_PULL_NONE);
+ }
+
+ for (i = 0; i < 8; i++) {
+ s3c_gpio_cfgpin(S5PV210_GPF1(i), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV210_GPF1(i), S3C_GPIO_PULL_NONE);
+ }
+
+ for (i = 0; i < 8; i++) {
+ s3c_gpio_cfgpin(S5PV210_GPF2(i), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV210_GPF2(i), S3C_GPIO_PULL_NONE);
+ }
+
+ for (i = 0; i < 4; i++) {
+ s3c_gpio_cfgpin(S5PV210_GPF3(i), S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(S5PV210_GPF3(i), S3C_GPIO_PULL_NONE);
+ }
+
+ /* mDNIe SEL: why we shall write 0x2 ? */
+ writel(0x2, S5P_MDNIE_SEL);
+
+ /* drive strength to max */
+ writel(0xffffffff, S5PV210_GPF0_BASE + 0xc);
+ writel(0xffffffff, S5PV210_GPF1_BASE + 0xc);
+ writel(0xffffffff, S5PV210_GPF2_BASE + 0xc);
+ writel(0x000000ff, S5PV210_GPF3_BASE + 0xc);
+}
+
+#define S5PV210_GPD_0_0_TOUT_0 (0x2)
+#define S5PV210_GPD_0_1_TOUT_1 (0x2 << 4)
+#define S5PV210_GPD_0_2_TOUT_2 (0x2 << 8)
+#define S5PV210_GPD_0_3_TOUT_3 (0x2 << 12) +static int flocs600_backlight_on(struct platform_device *pdev) +{ + int err; + + err = gpio_request(S5PV210_GPD0(3), "GPD0"); + + if (err) { + printk(KERN_ERR "failed to request GPD0 for " + "lcd backlight control\n"); + return err; + } + + gpio_direction_output(S5PV210_GPD0(3), 1); + + s3c_gpio_cfgpin(S5PV210_GPD0(3), S5PV210_GPD_0_3_TOUT_3); + + gpio_free(S5PV210_GPD0(3)); + return 0; +} + +static int flocs600_backlight_off(struct platform_device *pdev, int onoff) +{ + int err; + + err = gpio_request(S5PV210_GPD0(3), "GPD0"); + + if (err) { + printk(KERN_ERR "failed to request GPD0 for " + "lcd backlight control\n"); + return err; + } + + gpio_direction_output(S5PV210_GPD0(3), 0); + gpio_free(S5PV210_GPD0(3)); + return 0; +} + +static int flocs600_reset_lcd(struct platform_device *pdev) +{ + int err; + + err = gpio_request(S5PV210_GPH0(6), "GPH0"); + if (err) { + printk(KERN_ERR "failed to request GPH0 for " + "lcd reset control\n"); + return err; + } + + gpio_direction_output(S5PV210_GPH0(6), 1); + mdelay(100); + + gpio_set_value(S5PV210_GPH0(6), 0); + mdelay(10); + + gpio_set_value(S5PV210_GPH0(6), 1); + mdelay(10); + + gpio_free(S5PV210_GPH0(6)); + + return 0; +} + +static struct s3c_platform_fb flocs600_fb_data __initdata = { + .hw_ver = 0x62, + .nr_wins = 5, + .default_win = CONFIG_FB_S3C_DEFAULT_WINDOW, + .swap = FB_SWAP_WORD | FB_SWAP_HWORD, + + .lcd = &flocs600, + .cfg_gpio = flocs600_cfg_gpio, + .backlight_on = flocs600_backlight_on, + .backlight_onoff = flocs600_backlight_off, + .reset_lcd = flocs600_reset_lcd, +}; +#endif + + #ifdef CONFIG_S3C64XX_DEV_SPI #define SMDK_MMCSPI_CS 0 @@ -1935,6 +2078,11 @@ static void __init smdkc110_machine_init(void) s3cfb_set_platdata(&lte480wv_fb_data); #endif +/* Citizen Flocs FL0904 0.46" SVGA Add By: Bian Jiang 2012.4.12 */ +#ifdef CONFIG_FB_S3C_FLOCS600 + s3cfb_set_platdata(&flocs600_fb_data); +#endif + /* spi */ //#if 0 #ifdef CONFIG_S3C64XX_DEV_SPI diff --git a/drivers/video/samsung/Kconfig b/drivers/video/samsung/Kconfig index 7738be14..7da6c62 100644 --- a/drivers/video/samsung/Kconfig +++ b/drivers/video/samsung/Kconfig @@ -71,13 +71,20 @@ config FB_S3C_Y_VRES choice depends on FB_S3C prompt "Select LCD Type" -default FB_S3C_LTE480WV +default FB_S3C_FLOCS600 +config FB_S3C_FLOCS600 + bool "FLOCS600" + depends on (MACH_SMDKV210 || MACH_SMDKC110) + ---help--- + This enables support for Citizen FL0904 FLOCS600 0.46" SVGA LCD panel + config FB_S3C_LTE480WV bool "LTE480WV" depends on (MACH_SMDKV210 || MACH_SMDKC110) ---help--- This enables support for Samsung LTE480WV 4.8\" WVGA LCD panel + config FB_S3C_HT101HD1 bool "HT101HD1" depends on MACH_SMDKV210 diff --git a/drivers/video/samsung/Makefile b/drivers/video/samsung/Makefile index e317c86..79390c8 100644 --- a/drivers/video/samsung/Makefile +++ b/drivers/video/samsung/Makefile @@ -7,6 +7,7 @@ obj-y += s3cfb.o obj-$(CONFIG_ARCH_S5PV210) += s3cfb_fimd6x.o obj-$(CONFIG_FB_S3C_LTE480WV) += s3cfb_lte480wv.o +obj-$(CONFIG_FB_S3C_FLOCS600) += s3cfb_flocs600.o obj-$(CONFIG_FB_S3C_LVDS) += s3cfb_lvds.o obj-$(CONFIG_FB_S3C_HT101HD1) += s3cfb_ht101hd1.o obj-$(CONFIG_FB_S3C_TL2796) += s3cfb_tl2796.o diff --git a/drivers/video/samsung/s3cfb.c b/drivers/video/samsung/s3cfb.c index a7a71e0..add9a47 100644 --- a/drivers/video/samsung/s3cfb.c +++ b/drivers/video/samsung/s3cfb.c @@ -983,6 +983,16 @@ static int __devinit s3cfb_probe(struct platform_device *pdev) } s3cfb_set_clock(fbdev); + +#if defined(CONFIG_DE_MOBILE_PHONE_BOARD) || defined(CONFIG_DE_BASE_BOARD) + /* Add By: Bian Jiang 2012.3.12 + * WIN0 在uboot中使用了,但是为了保持uboot的logo显示,所以uboot不关闭win0 + * 但是 如果不关闭win0,会导致播放视频和camera preview花屏。 + */ + s3cfb_set_window(fbdev, 0, 0); +#endif + s3cfb_set_window(fbdev, pdata->default_win, 1);
s3cfb_display_on(fbdev);
diff --git a/drivers/video/samsung/s3cfb_flocs600.c b/drivers/video/samsung/s3cfb_flocs600.c
new file mode 100644
index 0000000..3469a08
--- /dev/null
+++ b/drivers/video/samsung/s3cfb_flocs600.c
@@ -0,0 +1,46 @@
+/* linux/drivers/video/samsung/s3cfb_flocs600.c
+ *
+ * Citizen Flocs FL0904 0.46" SVGA Display Panel Support
+ *
+ * Jinsung Yang, Copyright (c) 2009 Samsung Electronics
+ * http://www.samsungsemi.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include "s3cfb.h"
+
+static struct s3cfb_lcd flocs600 = {
+ .width = 800,
+ .height = 600,
+ .bpp = 32,
+ .freq = 60,
+
+ .timing = {
+ .h_fp = 8,
+ .h_bp = 13,
+ .h_sw = 3,
+ .v_fp = 5,
+ .v_fpe = 1,
+ .v_bp = 7,
+ .v_bpe = 1,
+ .v_sw = 1,
+ },
+
+ .polarity = {
+ .rise_vclk = 0,
+ .inv_hsync = 1,
+ .inv_vsync = 1,
+ .inv_vden = 0,
+ },
+};
+
+/* name should be fixed as 's3cfb_set_lcd_info' */
+void s3cfb_set_lcd_info(struct s3cfb_global *ctrl)
+{
+ flocs600.init_ldi = NULL;
+ ctrl->lcd = &flocs600;
+}
+
--
1.7.4.1 |
Recent Comments