aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r--arch/arm/mach-clps711x/edb7211.c34
-rw-r--r--arch/arm/mach-clps711x/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-clps711x/p720t.c20
3 files changed, 54 insertions, 2 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
42static 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
55static struct plat_lcd_data edb7211_lcd_power_pdata = {
56 .set_power = edb7211_lcd_power_set,
57};
58
59static 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
35static struct map_desc edb7211_io_desc[] __initdata = { 64static 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
84static void __init edb7211_init(void) 113static 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));
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index 5a278cb02b03..4e273f2a5cb1 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -82,8 +82,6 @@
82 * Relevant bits in port D, which controls power to the various parts of 82 * Relevant bits in port D, which controls power to the various parts of
83 * the LCD on the EDB7211. 83 * the LCD on the EDB7211.
84 */ 84 */
85#define EDB_PD1_LCD_DC_DC_EN (1<<1)
86#define EDB_PD2_LCDEN (1<<2)
87#define EDB_PD3_LCDBL (1<<3) 85#define EDB_PD3_LCDBL (1<<3)
88 86
89#endif 87#endif
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index a58a0585e3e7..34c8ee9ebb5e 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -37,10 +37,27 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <mach/syspld.h> 38#include <mach/syspld.h>
39 39
40#include <video/platform_lcd.h>
41
40#include "common.h" 42#include "common.h"
41 43
42#define GPIO_USERLED CLPS711X_GPIO(3, 0) 44#define GPIO_USERLED CLPS711X_GPIO(3, 0)
43 45
46static void p720t_lcd_power_set(struct plat_lcd_data *pd, unsigned int power)
47{
48 if (power) {
49 PLD_LCDEN = PLD_LCDEN_EN;
50 PLD_PWR |= PLD_S4_ON | PLD_S2_ON | PLD_S1_ON;
51 } else {
52 PLD_PWR &= ~(PLD_S4_ON | PLD_S2_ON | PLD_S1_ON);
53 PLD_LCDEN = 0;
54 }
55}
56
57static struct plat_lcd_data p720t_lcd_power_pdata = {
58 .set_power = p720t_lcd_power_set,
59};
60
44/* 61/*
45 * Map the P720T system PLD. It occupies two address spaces: 62 * Map the P720T system PLD. It occupies two address spaces:
46 * 0x10000000 and 0x10400000. We map both regions as one. 63 * 0x10000000 and 0x10400000. We map both regions as one.
@@ -121,6 +138,9 @@ static struct gpio_led_platform_data p720t_gpio_led_pdata __initdata = {
121 138
122static void __init p720t_init(void) 139static void __init p720t_init(void)
123{ 140{
141 platform_device_register_data(&platform_bus, "platform-lcd", 0,
142 &p720t_lcd_power_pdata,
143 sizeof(p720t_lcd_power_pdata));
124 platform_device_register_simple("video-clps711x", 0, NULL, 0); 144 platform_device_register_simple("video-clps711x", 0, NULL, 0);
125} 145}
126 146