]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[ARM] pxa/hx4700: use platform_lcd driver
authorPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 7 Aug 2009 15:01:04 +0000 (17:01 +0200)
committerEric Miao <eric.y.miao@gmail.com>
Thu, 10 Sep 2009 10:49:37 +0000 (18:49 +0800)
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>
arch/arm/mach-pxa/hx4700.c

index 81359d574f88e7467d6aaf3cda53d21b37c2ddfc..f2058721254b29902cc4b4774c3e704bb8a5580a 100644 (file)
@@ -45,6 +45,7 @@
 #include <mach/irda.h>
 #include <mach/pxa2xx_spi.h>
 
+#include <video/platform_lcd.h>
 #include <video/w100fb.h>
 
 #include "devices.h"
@@ -368,8 +369,6 @@ static struct platform_device egpio = {
  * LCD - Sony display connected to ATI Imageon w3220
  */
 
-static int lcd_power;
-
 static void sony_lcd_init(void)
 {
        gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
@@ -410,35 +409,6 @@ static void sony_lcd_off(void)
        gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
 }
 
-static int hx4700_lcd_set_power(struct lcd_device *ldev, int level)
-{
-       switch (level) {
-       case FB_BLANK_UNBLANK:
-               sony_lcd_init();
-               break;
-       case FB_BLANK_NORMAL:
-       case FB_BLANK_VSYNC_SUSPEND:
-       case FB_BLANK_HSYNC_SUSPEND:
-       case FB_BLANK_POWERDOWN:
-               sony_lcd_off();
-               break;
-       }
-       lcd_power = level;
-       return 0;
-}
-
-static int hx4700_lcd_get_power(struct lcd_device *lm)
-{
-       return lcd_power;
-}
-
-static struct lcd_ops hx4700_lcd_ops = {
-       .get_power = hx4700_lcd_get_power,
-       .set_power = hx4700_lcd_set_power,
-};
-
-static struct lcd_device *hx4700_lcd_device;
-
 #ifdef CONFIG_PM
 static void w3220_lcd_suspend(struct w100fb_par *wfb)
 {
@@ -573,6 +543,27 @@ static struct platform_device w3220 = {
        .resource      = w3220_resources,
 };
 
+static void hx4700_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
+{
+       if (power)
+               sony_lcd_init();
+       else
+               sony_lcd_off();
+}
+
+static struct plat_lcd_data hx4700_lcd_data = {
+       .set_power = hx4700_lcd_set_power,
+};
+
+static struct platform_device hx4700_lcd = {
+       .name = "platform-lcd",
+       .id   = -1,
+       .dev  = {
+               .platform_data = &hx4700_lcd_data,
+               .parent        = &w3220.dev,
+       },
+};
+
 /*
  * Backlight
  */
@@ -872,9 +863,6 @@ static void __init hx4700_init(void)
        pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
        spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
 
-       hx4700_lcd_device = lcd_device_register("w100fb", NULL,
-                                       (void *)&w3220_info, &hx4700_lcd_ops);
-
        gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0);
        mdelay(10);
        gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1);