aboutsummaryrefslogtreecommitdiff
path: root/linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch
blob: f1f25a743050a93dfafeb24ab2d97b7e70d1955d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--- linux-3.1.6/arch/arm/mach-s3c2410/mach-n30.c.orig	2011-12-31 16:56:14.728452388 +0100
+++ linux-3.1.6/arch/arm/mach-s3c2410/mach-n30.c	2011-12-31 16:57:30.185718019 +0100
@@ -56,6 +56,8 @@
 #include <plat/ts.h>
 #include <plat/udc.h>
 
+#include <video/platform_lcd.h>
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
@@ -545,6 +547,45 @@
 	.id   = -1,
 };
 
+static void n35_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
+{
+	if (power) {
+		gpio_set_value(S3C2410_GPB(8), 1);
+		s3c_gpio_setpull(S3C2410_GPB(8), S3C_GPIO_PULL_UP);
+
+		s3c_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT);
+		gpio_set_value(S3C2410_GPB(9), 1);
+		s3c_gpio_setpull(S3C2410_GPB(9), S3C_GPIO_PULL_UP);
+
+		s3c_gpio_cfgpin(S3C2410_GPB(10), S3C2410_GPIO_OUTPUT);
+		gpio_set_value(S3C2410_GPB(10), 1);
+		s3c_gpio_setpull(S3C2410_GPB(10), S3C_GPIO_PULL_UP);
+	} else {
+		gpio_set_value(S3C2410_GPB(8), 0);
+		s3c_gpio_setpull(S3C2410_GPB(8), S3C_GPIO_PULL_DOWN);
+
+		s3c_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_INPUT);
+		s3c_gpio_setpull(S3C2410_GPB(9), S3C_GPIO_PULL_DOWN);
+
+		s3c_gpio_cfgpin(S3C2410_GPB(10), S3C2410_GPIO_INPUT);
+		s3c_gpio_setpull(S3C2410_GPB(10), S3C_GPIO_PULL_DOWN);
+	}
+}
+
+
+static struct plat_lcd_data n35_lcd_power_data = {
+	.set_power = n35_lcd_set_power,
+};
+
+static struct platform_device n35_lcd_powerdev = {
+	.name	= "platform-lcd",
+	.id	= -1,
+	.dev	= {
+		.parent		= &s3c_device_lcd.dev,
+		.platform_data	= &n35_lcd_power_data,
+	},
+};
+
 static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
 {
 	switch (power_mode) {
@@ -597,6 +638,7 @@
 	&s3c_device_ts,
 	&s3c_device_timer[0],
 	&n35_backlight,
+	&n35_lcd_powerdev,
 	&n30_battery,
 	&n35_button_device,
 	&n35_blue_led,
@@ -786,6 +828,11 @@
 	if (machine_is_n35()) {
 		s3c_nand_set_platdata(&n35_nand_info);
 
+		WARN_ON(gpio_request(S3C2410_GPB(8), "LCD driver"));
+		WARN_ON(gpio_request(S3C2410_GPB(9), "LCD HSYNC"));
+		WARN_ON(gpio_request(S3C2410_GPB(10), "LCD VSYNC"));
+		s3c_gpio_cfgpin(S3C2410_GPB(8), S3C2410_GPIO_OUTPUT);
+
 		/* Clear any locks and write protects on the flash. */
 		WARN_ON(gpio_request(S3C2410_GPC(5), "NAND write protection"));
 		gpio_set_value(S3C2410_GPC(5), 1);