s5pc210: slp7: enable lcd
authorDonghwa Lee <dh09.lee@samsung.com>
Thu, 20 Jan 2011 09:05:27 +0000 (18:05 +0900)
committerDonghwa Lee <dh09.lee@samsung.com>
Thu, 20 Jan 2011 09:05:27 +0000 (18:05 +0900)
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
board/samsung/slp7_c210/slp7.c
drivers/swi/swi.c
drivers/video/nt39411.c
include/configs/s5pc210_slp7.h
include/nt39411.h
include/swi.h

index 982eae1..b3e31fb 100644 (file)
@@ -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");
 }
index faf9507..5b15f85 100644 (file)
@@ -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;
-}
index 6a2f14d..5ca9c8a 100644 (file)
@@ -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;
        }
index 258308f..1c34a15 100644 (file)
 #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
index ca0944f..7940cfc 100644 (file)
@@ -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);
index 8c78fc0..e665318 100644 (file)
@@ -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_*/