From a3f4a64a2420fda8292e76da4535f000110123e3 Mon Sep 17 00:00:00 2001 From: Donghwa Lee Date: Thu, 20 Jan 2011 18:05:27 +0900 Subject: [PATCH] s5pc210: slp7: enable lcd Signed-off-by: Donghwa Lee --- board/samsung/slp7_c210/slp7.c | 28 ++++++++++++++-------------- drivers/swi/swi.c | 18 +----------------- drivers/video/nt39411.c | 16 ++++++++-------- include/configs/s5pc210_slp7.h | 2 +- include/nt39411.h | 7 ++++--- include/swi.h | 3 +-- 6 files changed, 29 insertions(+), 45 deletions(-) diff --git a/board/samsung/slp7_c210/slp7.c b/board/samsung/slp7_c210/slp7.c index 982eae1..b3e31fb 100644 --- a/board/samsung/slp7_c210/slp7.c +++ b/board/samsung/slp7_c210/slp7.c @@ -411,7 +411,8 @@ static void check_keypad(void) unsigned int val = 0; unsigned int power_key, auto_download = 0; - val = ~(gpio_get_value(&gpio2->x2, 1)); + /* volume down */ + val = !(gpio_get_value(&gpio2->x2, 1)); power_key = pmic_get_irq(PWRONR); @@ -699,7 +700,6 @@ 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) */ @@ -735,9 +735,9 @@ static void lcd_cfg_gpio(void) gpio_set_pull(&gpio1->f0, i, GPIO_PULL_NONE); /* 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)); + nt39411_pd.swi.swi_bank = &gpio1->d0; + nt39411_pd.swi.controller_data = 0; + gpio_cfg_pin(&gpio1->d0, nt39411_pd.swi.controller_data, GPIO_FUNC(2)); /* LVDS_nSHDN */ gpio_direction_output(&gpio1->e1, 5, 1); @@ -745,9 +745,8 @@ static void lcd_cfg_gpio(void) /* 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); + nt39411_pd.swi.low_period = 30; + nt39411_pd.swi.high_period = 30; return; } @@ -759,14 +758,15 @@ int s5p_no_lcd_support(void) void init_panel_info(vidinfo_t *vid) { vid->vl_freq = 60; - vid->vl_col = 600; - vid->vl_row = 1024; - vid->vl_width = 600; - vid->vl_height = 1024; + vid->vl_col = 1024; + vid->vl_row = 600; + vid->vl_width = 1024; + vid->vl_height = 600; vid->vl_clkp = CONFIG_SYS_LOW; vid->vl_hsp = CONFIG_SYS_HIGH; vid->vl_vsp = CONFIG_SYS_HIGH; vid->vl_dp = CONFIG_SYS_LOW; + vid->vl_bpix = 32; vid->enable_ldo = nt39411_send_intensity; /* NT39411 LCD Panel */ @@ -791,8 +791,8 @@ void init_panel_info(vidinfo_t *vid) vid->reset_delay = 0; vid->interface_mode = FIMD_RGB_INTERFACE; nt39411_pd.brightness = NT39411_DEFAULT_INTENSITY; - nt39411_pd.a_onoff = A1_A2_ON; - nt39411_pd.b_onoff = B1_B2_ALL_ON; + nt39411_pd.a_onoff = A1_ON; + nt39411_pd.b_onoff = B1_ON; nt39411_set_platform_data(&nt39411_pd); setenv("lcdinfo", "lcd=nt39411"); } diff --git a/drivers/swi/swi.c b/drivers/swi/swi.c index faf9507..5b15f85 100644 --- a/drivers/swi/swi.c +++ b/drivers/swi/swi.c @@ -27,7 +27,7 @@ struct swi_platform_data *swi; -int swi_transfer_command(unsigned int command) +int swi_transfer_command(struct swi_platform_data *swi, unsigned int command) { switch (command) { case SWI_LOW: @@ -50,19 +50,3 @@ int swi_transfer_command(unsigned int command) return 1; } - -/* - * register SWI devices for a given board. - * - * @info : array of chip descriptors. - * @n : how many descriptors are provided. - */ -void swi_set_platform_data(struct swi_platform_data *pd) -{ - if (pd == NULL) { - printf("pd is NULL.\n"); - return; - } - - swi = pd; -} diff --git a/drivers/video/nt39411.c b/drivers/video/nt39411.c index 6a2f14d..5ca9c8a 100644 --- a/drivers/video/nt39411.c +++ b/drivers/video/nt39411.c @@ -33,41 +33,41 @@ static void nt39411_apply(int level) /* A1-A3 current select */ for (i = 0; i < A1_A3_CURRENT; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); for (i = 0; i < gamma_table_10[level]; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); /* B1-B2 current select */ for (i = 0; i < B1_B2_CURRENT; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); for (i = 0; i < gamma_table_10[level]; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); if (first) { /* A1-A3 on/off select */ for (i = 0; i < A1_A3_ONOFF; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); /* A1-A3 all on */ for (i = 0; i < nt39411->a_onoff; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); /* B1-B2 on/off select */ for (i = 0; i < B1_B2_ONOFF; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); udelay(500); /* B1-B2 all on */ for (i = 0; i < nt39411->b_onoff; i++) - swi_transfer_command(SWI_CHANGE); + swi_transfer_command(&nt39411->swi, SWI_CHANGE); first = 0; } diff --git a/include/configs/s5pc210_slp7.h b/include/configs/s5pc210_slp7.h index 258308f..1c34a15 100644 --- a/include/configs/s5pc210_slp7.h +++ b/include/configs/s5pc210_slp7.h @@ -316,7 +316,7 @@ #define CONFIG_SYS_DOWN_ADDR CONFIG_SYS_SDRAM_BASE /* LCD */ -#if 0 +#if 1 #define CONFIG_LCD 1 #define CONFIG_FB_ADDR 0x52504000 #define CONFIG_S5PC1XXFB 1 diff --git a/include/nt39411.h b/include/nt39411.h index ca0944f..7940cfc 100644 --- a/include/nt39411.h +++ b/include/nt39411.h @@ -14,6 +14,7 @@ #define _NT39411_H_ struct nt39411_platform_data { + struct swi_platform_data swi; int a_onoff; int b_onoff; unsigned int brightness; @@ -40,9 +41,9 @@ struct nt39411_platform_data { #define A1_A3_ALL_OFF 1 #define B1_B2_ALL_ON 4 -#define B1_ON_B2_OFF 3 -#define B1_OFF_B2_ON 2 -#define B1_OFF_B2_OFF 1 +#define B1_ON 3 +#define B2_ON 2 +#define B1_B2_ALL_OFF 1 void nt39411_set_platform_data(struct nt39411_platform_data *pd); void nt39411_send_intensity(void); diff --git a/include/swi.h b/include/swi.h index 8c78fc0..e665318 100644 --- a/include/swi.h +++ b/include/swi.h @@ -54,7 +54,6 @@ struct swi_platform_data { }; -int swi_transfer_command(unsigned int command); -void swi_set_platform_data(struct swi_platform_data *pd); +int swi_transfer_command(struct swi_platform_data *swi, unsigned int command); #endif /*_SWI_H_*/ -- 2.7.4