diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:18 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 12:57:44 -0500 |
commit | 87c37b51ade7d1296ab99ed8f237637bed7779c7 (patch) | |
tree | 615582ab943b3f0c2e587668d09e7d38d6e0289c /arch/arm/mach-clps711x/edb7211.c | |
parent | 90383e0ac2ae3df283f2b56997040f71f6d1df08 (diff) |
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>
Diffstat (limited to 'arch/arm/mach-clps711x/edb7211.c')
-rw-r--r-- | arch/arm/mach-clps711x/edb7211.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index cc32a65d6982..81cc6835d7a5 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c | |||
@@ -8,6 +8,8 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/gpio.h> | ||
12 | #include <linux/delay.h> | ||
11 | #include <linux/memblock.h> | 13 | #include <linux/memblock.h> |
12 | #include <linux/types.h> | 14 | #include <linux/types.h> |
13 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
@@ -18,12 +20,17 @@ | |||
18 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
19 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
20 | 22 | ||
23 | #include <video/platform_lcd.h> | ||
24 | |||
21 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
22 | 26 | ||
23 | #include "common.h" | 27 | #include "common.h" |
24 | 28 | ||
25 | #define VIDEORAM_SIZE SZ_128K | 29 | #define VIDEORAM_SIZE SZ_128K |
26 | 30 | ||
31 | #define EDB7211_LCD_DC_DC_EN CLPS711X_GPIO(3, 1) | ||
32 | #define EDB7211_LCDEN CLPS711X_GPIO(3, 2) | ||
33 | |||
27 | #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) | 34 | #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) |
28 | #define EDB7211_CS8900_IRQ (IRQ_EINT3) | 35 | #define EDB7211_CS8900_IRQ (IRQ_EINT3) |
29 | 36 | ||
@@ -32,6 +39,28 @@ static struct resource edb7211_cs8900_resource[] __initdata = { | |||
32 | DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), | 39 | DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), |
33 | }; | 40 | }; |
34 | 41 | ||
42 | static void edb7211_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) | ||
43 | { | ||
44 | if (power) { | ||
45 | gpio_set_value(EDB7211_LCDEN, 1); | ||
46 | udelay(100); | ||
47 | gpio_set_value(EDB7211_LCD_DC_DC_EN, 1); | ||
48 | } else { | ||
49 | gpio_set_value(EDB7211_LCD_DC_DC_EN, 0); | ||
50 | udelay(100); | ||
51 | gpio_set_value(EDB7211_LCDEN, 0); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | static struct plat_lcd_data edb7211_lcd_power_pdata = { | ||
56 | .set_power = edb7211_lcd_power_set, | ||
57 | }; | ||
58 | |||
59 | static struct gpio edb7211_gpios[] __initconst = { | ||
60 | { EDB7211_LCD_DC_DC_EN, GPIOF_OUT_INIT_LOW, "LCD DC-DC" }, | ||
61 | { EDB7211_LCDEN, GPIOF_OUT_INIT_LOW, "LCD POWER" }, | ||
62 | }; | ||
63 | |||
35 | static struct map_desc edb7211_io_desc[] __initdata = { | 64 | static struct map_desc edb7211_io_desc[] __initdata = { |
36 | { /* Memory-mapped extra keyboard row */ | 65 | { /* Memory-mapped extra keyboard row */ |
37 | .virtual = IO_ADDRESS(EP7211_PHYS_EXTKBD), | 66 | .virtual = IO_ADDRESS(EP7211_PHYS_EXTKBD), |
@@ -83,6 +112,11 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) | |||
83 | 112 | ||
84 | static void __init edb7211_init(void) | 113 | static void __init edb7211_init(void) |
85 | { | 114 | { |
115 | gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); | ||
116 | |||
117 | platform_device_register_data(&platform_bus, "platform-lcd", 0, | ||
118 | &edb7211_lcd_power_pdata, | ||
119 | sizeof(edb7211_lcd_power_pdata)); | ||
86 | platform_device_register_simple("video-clps711x", 0, NULL, 0); | 120 | platform_device_register_simple("video-clps711x", 0, NULL, 0); |
87 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, | 121 | platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, |
88 | ARRAY_SIZE(edb7211_cs8900_resource)); | 122 | ARRAY_SIZE(edb7211_cs8900_resource)); |