From 2248d38fe85f2361b8959bf8fc1c9b9f7ecf9f2e Mon Sep 17 00:00:00 2001 From: Donghwa Lee Date: Thu, 20 Jan 2011 09:34:11 +0900 Subject: [PATCH] s5pc210: slp7: add nt39411 panel configuration --- board/samsung/slp7_c210/slp7.c | 97 ++++++++++++++++++------------------------ drivers/video/s5p-fb.c | 2 + include/configs/s5pc210_slp7.h | 8 +++- 3 files changed, 49 insertions(+), 58 deletions(-) diff --git a/board/samsung/slp7_c210/slp7.c b/board/samsung/slp7_c210/slp7.c index 8d84689..7ec7e7c 100644 --- a/board/samsung/slp7_c210/slp7.c +++ b/board/samsung/slp7_c210/slp7.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -718,13 +720,12 @@ void fimd_clk_set(void) writel(cfg, &clk->div_lcd0); } -extern void ld9040_set_platform_data(struct spi_platform_data *pd); - -struct spi_platform_data spi_pd; +struct nt39411_platform_data nt39411_pd; static void lcd_cfg_gpio(void) { unsigned int i; + struct swi_platform_data swi_pd; for (i = 0; i < 8; i++) { /* set GPF0,1,2[0:7] for RGB Interface and Data lines (32bit) */ @@ -755,37 +756,27 @@ static void lcd_cfg_gpio(void) gpio_set_rate(&gpio1->f3, i, GPIO_DRV_SLOW); } - /* gpio pad configuration for LCD reset. */ - gpio_direction_output(&gpio2->y4, 5, 1); - - /* - * gpio pad configuration for - * DISPLAY_CS, DISPLAY_CLK, DISPLAY_SO, DISPLAY_SI. - */ - gpio_cfg_pin(&gpio2->y4, 3, GPIO_OUTPUT); - gpio_cfg_pin(&gpio2->y3, 1, GPIO_OUTPUT); - gpio_cfg_pin(&gpio2->y3, 3, GPIO_OUTPUT); - - spi_pd.cs_bank = &gpio2->y4; - spi_pd.cs_num = 3; - spi_pd.clk_bank = &gpio2->y3; - spi_pd.clk_num = 1; - spi_pd.si_bank = &gpio2->y3; - spi_pd.si_num = 3; + gpio_cfg_pin(&gpio1->f2, i, GPIO_FUNC(2)); + /* pull-up/down disable */ + gpio_set_pull(&gpio1->f0, i, GPIO_PULL_NONE); - spi_pd.mode = SPI_MODE_3; + /* LED_BACKLIGHT_PWM */ + swi_pd.swi_bank = &gpio1->d0; + swi_pd.controller_data = 1; + gpio_cfg_pin(&gpio1->d0, swi_pd.controller_data, GPIO_FUNC(2)); - spi_pd.cs_active = ACTIVE_LOW; - spi_pd.word_len = 8; + /* LVDS_nSHDN */ + gpio_direction_output(&gpio1->e1, 5, 1); - ld9040_set_platform_data(&spi_pd); + /* LCD_LDO_EN */ + gpio_direction_output(&gpio1->e2, 3, 1); + swi_pd.low_period = 30; + swi_pd.high_period = 30; + swi_set_platform_data(&swi_pd); return; } -extern void ld9040_cfg_ldo(void); -extern void ld9040_enable_ldo(unsigned int onoff); - int s5p_no_lcd_support(void) { return 0; @@ -794,48 +785,42 @@ int s5p_no_lcd_support(void) void init_panel_info(vidinfo_t *vid) { vid->vl_freq = 60; - vid->vl_col = 480; - vid->vl_row = 800; - vid->vl_width = 480; - vid->vl_height = 800; - vid->vl_clkp = CONFIG_SYS_HIGH; + vid->vl_col = 600; + vid->vl_row = 1024; + vid->vl_width = 600; + vid->vl_height = 1024; + vid->vl_clkp = CONFIG_SYS_LOW; vid->vl_hsp = CONFIG_SYS_HIGH; vid->vl_vsp = CONFIG_SYS_HIGH; - vid->vl_dp = CONFIG_SYS_HIGH; - - vid->vl_bpix = 32; - /* disable dual lcd mode. */ - vid->dual_lcd_enabled = 0; + vid->vl_dp = CONFIG_SYS_LOW; + vid->enable_ldo = nt39411_send_intensity; - /* LD9040 LCD Panel */ - vid->vl_hspw = 2; - vid->vl_hbpd = 16; - vid->vl_hfpd = 16; + /* NT39411 LCD Panel */ + vid->vl_hspw = 50; + vid->vl_hbpd = 142; + vid->vl_hfpd = 210; - vid->vl_vspw = 2; - vid->vl_vbpd = 6; - vid->vl_vfpd = 4; + vid->vl_vspw = 10; + vid->vl_vbpd = 11; + vid->vl_vfpd = 10; vid->cfg_gpio = lcd_cfg_gpio; vid->backlight_on = NULL; - vid->lcd_power_on = NULL; /* Don't need the poweron squence */ - vid->reset_lcd = NULL; /* Don't need the reset squence */ + /* vid->lcd_power_on = lcd_power_on; */ /* Don't need the poweron squence */ + /* vid->reset_lcd = reset_lcd; */ /* Don't need the reset squence */ - vid->cfg_ldo = ld9040_cfg_ldo; - vid->enable_ldo = ld9040_enable_ldo; + vid->cfg_ldo = NULL; + vid->enable_ldo = nt39411_send_intensity; vid->init_delay = 0; vid->power_on_delay = 0; vid->reset_delay = 0; vid->interface_mode = FIMD_RGB_INTERFACE; - - /* board should be detected at here. */ - - /* for LD8040. */ - vid->pclk_name = MPLL; - vid->sclk_div = 1; - - setenv("lcdinfo", "lcd=ld9040"); + nt39411_pd.brightness = NT39411_DEFAULT_INTENSITY; + nt39411_pd.a_onoff = A1_A2_ON; + nt39411_pd.b_onoff = B1_B2_ALL_ON; + nt39411_set_platform_data(&nt39411_pd); + setenv("lcdinfo", "lcd=nt39411"); } #endif diff --git a/drivers/video/s5p-fb.c b/drivers/video/s5p-fb.c index d44feec..261b4b4 100644 --- a/drivers/video/s5p-fb.c +++ b/drivers/video/s5p-fb.c @@ -252,8 +252,10 @@ static void lcd_panel_on(vidinfo_t *vid) if (vid->backlight_on) vid->backlight_on(1); +#ifdef CONFIG_DSIM if (vid->interface_mode == FIMD_CPU_INTERFACE) s5p_dsim_start(); +#endif if (vid->cfg_ldo) vid->cfg_ldo(); diff --git a/include/configs/s5pc210_slp7.h b/include/configs/s5pc210_slp7.h index 1b3615b..61ca679 100644 --- a/include/configs/s5pc210_slp7.h +++ b/include/configs/s5pc210_slp7.h @@ -87,6 +87,11 @@ */ #define CONFIG_SPI_GPIO 1 +/* + * swi + */ +#define CONFIG_SWI 1 + /* MMC */ #if 1 #define CONFIG_GENERIC_MMC 1 @@ -312,8 +317,7 @@ #define CONFIG_LCD 1 #define CONFIG_FB_ADDR 0x52504000 #define CONFIG_S5PC1XXFB 1 -#define CONFIG_LD9040 1 -#define CONFIG_DSIM 1 +#define CONFIG_NT39411 1 /* Insert bmp animation compressed */ #define CONFIG_VIDEO_BMP_GZIP #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (250*250*4) -- 2.7.4