diff options
-rw-r--r-- | arch/arm/mach-pxa/hx4700.c | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 81359d574f88..f2058721254b 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <mach/irda.h> | 45 | #include <mach/irda.h> |
46 | #include <mach/pxa2xx_spi.h> | 46 | #include <mach/pxa2xx_spi.h> |
47 | 47 | ||
48 | #include <video/platform_lcd.h> | ||
48 | #include <video/w100fb.h> | 49 | #include <video/w100fb.h> |
49 | 50 | ||
50 | #include "devices.h" | 51 | #include "devices.h" |
@@ -368,8 +369,6 @@ static struct platform_device egpio = { | |||
368 | * LCD - Sony display connected to ATI Imageon w3220 | 369 | * LCD - Sony display connected to ATI Imageon w3220 |
369 | */ | 370 | */ |
370 | 371 | ||
371 | static int lcd_power; | ||
372 | |||
373 | static void sony_lcd_init(void) | 372 | static void sony_lcd_init(void) |
374 | { | 373 | { |
375 | gpio_set_value(GPIO84_HX4700_LCD_SQN, 1); | 374 | gpio_set_value(GPIO84_HX4700_LCD_SQN, 1); |
@@ -410,35 +409,6 @@ static void sony_lcd_off(void) | |||
410 | gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0); | 409 | gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0); |
411 | } | 410 | } |
412 | 411 | ||
413 | static int hx4700_lcd_set_power(struct lcd_device *ldev, int level) | ||
414 | { | ||
415 | switch (level) { | ||
416 | case FB_BLANK_UNBLANK: | ||
417 | sony_lcd_init(); | ||
418 | break; | ||
419 | case FB_BLANK_NORMAL: | ||
420 | case FB_BLANK_VSYNC_SUSPEND: | ||
421 | case FB_BLANK_HSYNC_SUSPEND: | ||
422 | case FB_BLANK_POWERDOWN: | ||
423 | sony_lcd_off(); | ||
424 | break; | ||
425 | } | ||
426 | lcd_power = level; | ||
427 | return 0; | ||
428 | } | ||
429 | |||
430 | static int hx4700_lcd_get_power(struct lcd_device *lm) | ||
431 | { | ||
432 | return lcd_power; | ||
433 | } | ||
434 | |||
435 | static struct lcd_ops hx4700_lcd_ops = { | ||
436 | .get_power = hx4700_lcd_get_power, | ||
437 | .set_power = hx4700_lcd_set_power, | ||
438 | }; | ||
439 | |||
440 | static struct lcd_device *hx4700_lcd_device; | ||
441 | |||
442 | #ifdef CONFIG_PM | 412 | #ifdef CONFIG_PM |
443 | static void w3220_lcd_suspend(struct w100fb_par *wfb) | 413 | static void w3220_lcd_suspend(struct w100fb_par *wfb) |
444 | { | 414 | { |
@@ -573,6 +543,27 @@ static struct platform_device w3220 = { | |||
573 | .resource = w3220_resources, | 543 | .resource = w3220_resources, |
574 | }; | 544 | }; |
575 | 545 | ||
546 | static void hx4700_lcd_set_power(struct plat_lcd_data *pd, unsigned int power) | ||
547 | { | ||
548 | if (power) | ||
549 | sony_lcd_init(); | ||
550 | else | ||
551 | sony_lcd_off(); | ||
552 | } | ||
553 | |||
554 | static struct plat_lcd_data hx4700_lcd_data = { | ||
555 | .set_power = hx4700_lcd_set_power, | ||
556 | }; | ||
557 | |||
558 | static struct platform_device hx4700_lcd = { | ||
559 | .name = "platform-lcd", | ||
560 | .id = -1, | ||
561 | .dev = { | ||
562 | .platform_data = &hx4700_lcd_data, | ||
563 | .parent = &w3220.dev, | ||
564 | }, | ||
565 | }; | ||
566 | |||
576 | /* | 567 | /* |
577 | * Backlight | 568 | * Backlight |
578 | */ | 569 | */ |
@@ -872,9 +863,6 @@ static void __init hx4700_init(void) | |||
872 | pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); | 863 | pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); |
873 | spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info)); | 864 | spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info)); |
874 | 865 | ||
875 | hx4700_lcd_device = lcd_device_register("w100fb", NULL, | ||
876 | (void *)&w3220_info, &hx4700_lcd_ops); | ||
877 | |||
878 | gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0); | 866 | gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0); |
879 | mdelay(10); | 867 | mdelay(10); |
880 | gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1); | 868 | gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1); |