diff options
author | Vasily Khoruzhick <anarsoul@gmail.com> | 2011-01-06 14:52:50 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-03-20 19:14:55 -0400 |
commit | 25d391cbe610009d2ea10d820f36621b7610c963 (patch) | |
tree | e4e91407bd145793338eec7067337a297dd57036 /arch/arm/mach-s3c2410/mach-h1940.c | |
parent | a8e99850d39cac11d03100aa9c40ebaea16e48c5 (diff) |
ARM: S3C2410: H1940: Fix lcd_power_set function
Current implementation of lcd_power_set is not reliable, sometimes
it does not enable LCD at all.
Mimic WinCE behavior to fix this issue.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2410/mach-h1940.c')
-rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index a0116ef2eca7..882b32af9dde 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/leds.h> | 30 | #include <linux/leds.h> |
31 | #include <linux/pda_power.h> | 31 | #include <linux/pda_power.h> |
32 | #include <linux/s3c_adc_battery.h> | 32 | #include <linux/s3c_adc_battery.h> |
33 | #include <linux/delay.h> | ||
33 | 34 | ||
34 | #include <video/platform_lcd.h> | 35 | #include <video/platform_lcd.h> |
35 | 36 | ||
@@ -209,15 +210,15 @@ static struct s3c2410fb_mach_info h1940_fb_info __initdata = { | |||
209 | .num_displays = 1, | 210 | .num_displays = 1, |
210 | .default_display = 0, | 211 | .default_display = 0, |
211 | 212 | ||
212 | .lpcsel= 0x02, | 213 | .lpcsel = 0x02, |
213 | .gpccon= 0xaa940659, | 214 | .gpccon = 0xaa940659, |
214 | .gpccon_mask= 0xffffffff, | 215 | .gpccon_mask = 0xffffc0f0, |
215 | .gpcup= 0x0000ffff, | 216 | .gpcup = 0x0000ffff, |
216 | .gpcup_mask= 0xffffffff, | 217 | .gpcup_mask = 0xffffffff, |
217 | .gpdcon= 0xaa84aaa0, | 218 | .gpdcon = 0xaa84aaa0, |
218 | .gpdcon_mask= 0xffffffff, | 219 | .gpdcon_mask = 0xffffffff, |
219 | .gpdup= 0x0000faff, | 220 | .gpdup = 0x0000faff, |
220 | .gpdup_mask= 0xffffffff, | 221 | .gpdup_mask = 0xffffffff, |
221 | }; | 222 | }; |
222 | 223 | ||
223 | static int power_supply_init(struct device *dev) | 224 | static int power_supply_init(struct device *dev) |
@@ -526,14 +527,14 @@ static struct platform_device h1940_backlight = { | |||
526 | static void h1940_lcd_power_set(struct plat_lcd_data *pd, | 527 | static void h1940_lcd_power_set(struct plat_lcd_data *pd, |
527 | unsigned int power) | 528 | unsigned int power) |
528 | { | 529 | { |
529 | int value; | 530 | int value, retries = 100; |
530 | 531 | ||
531 | if (!power) { | 532 | if (!power) { |
532 | gpio_set_value(S3C2410_GPC(0), 0); | 533 | gpio_set_value(S3C2410_GPC(0), 0); |
533 | /* wait for 3ac */ | 534 | /* wait for 3ac */ |
534 | do { | 535 | do { |
535 | value = gpio_get_value(S3C2410_GPC(6)); | 536 | value = gpio_get_value(S3C2410_GPC(6)); |
536 | } while (value); | 537 | } while (value && retries--); |
537 | 538 | ||
538 | gpio_set_value(H1940_LATCH_LCD_P2, 0); | 539 | gpio_set_value(H1940_LATCH_LCD_P2, 0); |
539 | gpio_set_value(H1940_LATCH_LCD_P3, 0); | 540 | gpio_set_value(H1940_LATCH_LCD_P3, 0); |
@@ -551,6 +552,9 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd, | |||
551 | gpio_set_value(H1940_LATCH_LCD_P0, 1); | 552 | gpio_set_value(H1940_LATCH_LCD_P0, 1); |
552 | gpio_set_value(H1940_LATCH_LCD_P1, 1); | 553 | gpio_set_value(H1940_LATCH_LCD_P1, 1); |
553 | 554 | ||
555 | gpio_direction_input(S3C2410_GPC(1)); | ||
556 | gpio_direction_input(S3C2410_GPC(4)); | ||
557 | mdelay(10); | ||
554 | s3c_gpio_cfgpin(S3C2410_GPC(1), S3C_GPIO_SFN(2)); | 558 | s3c_gpio_cfgpin(S3C2410_GPC(1), S3C_GPIO_SFN(2)); |
555 | s3c_gpio_cfgpin(S3C2410_GPC(4), S3C_GPIO_SFN(2)); | 559 | s3c_gpio_cfgpin(S3C2410_GPC(4), S3C_GPIO_SFN(2)); |
556 | 560 | ||