aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2009-08-07 11:01:04 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-09-10 06:49:37 -0400
commite2c509c7e63ffdeef21f292441c3d4ce73db9250 (patch)
tree67a8230c2190bfbd0b7a6cd60e30f9c44dd19e9a
parent6cf4442feba5af93a09cadfc5a6512a971f7825d (diff)
[ARM] pxa/hx4700: use platform_lcd driver
Instead of directly registering an lcd_device, use the platform_lcd driver. This fixes a broken build in case CONFIG_LCD_CLASS_DEVICE is not enabled. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Cc: Ben Dooks <ben-linux-arm@fluff.org> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r--arch/arm/mach-pxa/hx4700.c56
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
371static int lcd_power;
372
373static void sony_lcd_init(void) 372static 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
413static 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
430static int hx4700_lcd_get_power(struct lcd_device *lm)
431{
432 return lcd_power;
433}
434
435static struct lcd_ops hx4700_lcd_ops = {
436 .get_power = hx4700_lcd_get_power,
437 .set_power = hx4700_lcd_set_power,
438};
439
440static struct lcd_device *hx4700_lcd_device;
441
442#ifdef CONFIG_PM 412#ifdef CONFIG_PM
443static void w3220_lcd_suspend(struct w100fb_par *wfb) 413static 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
546static 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
554static struct plat_lcd_data hx4700_lcd_data = {
555 .set_power = hx4700_lcd_set_power,
556};
557
558static 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);