ARM: clps711x: Moving power management of framebuffer driver to the board

This patch moves the power management for clps711x-framebuffer driver
to the board code. To control we use "platform-lcd" driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index a58a058..34c8ee9 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -37,10 +37,27 @@
 #include <asm/mach/map.h>
 #include <mach/syspld.h>
 
+#include <video/platform_lcd.h>
+
 #include "common.h"
 
 #define GPIO_USERLED	CLPS711X_GPIO(3, 0)
 
+static void p720t_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
+{
+	if (power) {
+		PLD_LCDEN = PLD_LCDEN_EN;
+		PLD_PWR |= PLD_S4_ON | PLD_S2_ON | PLD_S1_ON;
+	} else {
+		PLD_PWR &= ~(PLD_S4_ON | PLD_S2_ON | PLD_S1_ON);
+		PLD_LCDEN = 0;
+	}
+}
+
+static struct plat_lcd_data p720t_lcd_power_pdata = {
+	.set_power	= p720t_lcd_power_set,
+};
+
 /*
  * Map the P720T system PLD. It occupies two address spaces:
  * 0x10000000 and 0x10400000. We map both regions as one.
@@ -121,6 +138,9 @@
 
 static void __init p720t_init(void)
 {
+	platform_device_register_data(&platform_bus, "platform-lcd", 0,
+				      &p720t_lcd_power_pdata,
+				      sizeof(p720t_lcd_power_pdata));
 	platform_device_register_simple("video-clps711x", 0, NULL, 0);
 }