aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-omap-pm/dss2/0096-DSS2-Overo-add-vdac-dsi-regulators-fix-panel-name.patch
blob: c81d79e7ca4595b9adf0f9f5b9f8d0a9e9c70b1e (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
From 1ccb690cf0a478e3bbbf9bf1ee0f03a33918b87e Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Mon, 1 Jun 2009 20:17:40 +0300
Subject: [PATCH 096/146] DSS2: Overo: add vdac/dsi regulators, fix panel names

---
 arch/arm/mach-omap2/board-overo.c |  224 ++++++++++++++++++++++---------------
 1 files changed, 132 insertions(+), 92 deletions(-)

diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 39f95f5..07868f9 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -183,9 +183,110 @@ static inline void __init overo_init_smsc911x(void)
 static inline void __init overo_init_smsc911x(void) { return; }
 #endif
 
+/* DSS */
 static int lcd_enabled;
 static int dvi_enabled;
 
+#define OVERO_GPIO_LCD_EN 144
+
+static void __init overo_display_init(void)
+{
+	int r;
+
+	r = gpio_request(OVERO_GPIO_LCD_EN, "display enable");
+	if (r)
+		printk("fail1\n");
+	r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1);
+	if (r)
+		printk("fail2\n");
+	gpio_export(OVERO_GPIO_LCD_EN, 0);
+}
+
+static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
+{
+	if (lcd_enabled) {
+		printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
+		return -EINVAL;
+	}
+	dvi_enabled = 1;
+
+	gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+
+	return 0;
+}
+
+static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+
+	dvi_enabled = 0;
+}
+
+static struct omap_dss_device overo_dvi_device = {
+	.type = OMAP_DISPLAY_TYPE_DPI,
+	.name = "dvi",
+	.driver_name = "generic_panel",
+	.phy.dpi.data_lines = 24,
+	.platform_enable = overo_panel_enable_dvi,
+	.platform_disable = overo_panel_disable_dvi,
+};
+
+static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
+{
+	if (dvi_enabled) {
+		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
+		return -EINVAL;
+	}
+
+	gpio_set_value(OVERO_GPIO_LCD_EN, 1);
+	lcd_enabled = 1;
+	return 0;
+}
+
+static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
+{
+	gpio_set_value(OVERO_GPIO_LCD_EN, 0);
+	lcd_enabled = 0;
+}
+
+static struct omap_dss_device overo_lcd_device = {
+	.type = OMAP_DISPLAY_TYPE_DPI,
+	.name = "lcd",
+	.driver_name = "samsung_lte_panel",
+	.phy.dpi.data_lines = 24,
+	.platform_enable = overo_panel_enable_lcd,
+	.platform_disable = overo_panel_disable_lcd,
+};
+
+static struct omap_dss_device *overo_dss_devices[] = {
+	&overo_dvi_device,
+	&overo_lcd_device,
+};
+
+static struct omap_dss_board_info overo_dss_data = {
+	.num_devices = ARRAY_SIZE(overo_dss_devices),
+	.devices = overo_dss_devices,
+	.default_device = &overo_dvi_device,
+};
+
+static struct platform_device overo_dss_device = {
+	.name          = "omapdss",
+	.id            = -1,
+	.dev            = {
+		.platform_data = &overo_dss_data,
+	},
+};
+
+static struct regulator_consumer_supply overo_vdda_dac_supply = {
+	.supply		= "vdda_dac",
+	.dev		= &overo_dss_device.dev,
+};
+
+static struct regulator_consumer_supply overo_vdds_dsi_supply = {
+	.supply		= "vdds_dsi",
+	.dev		= &overo_dss_device.dev,
+};
+
 static struct mtd_partition overo_nand_partitions[] = {
 	{
 		.name           = "xloader",
@@ -235,7 +336,6 @@ static struct platform_device overo_nand_device = {
 	.resource	= &overo_nand_resource,
 };
 
-
 static void __init overo_flash_init(void)
 {
 	u8 cs = 0;
@@ -334,6 +434,35 @@ static struct regulator_init_data overo_vmmc1 = {
 	.consumer_supplies	= &overo_vmmc1_supply,
 };
 
+/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
+static struct regulator_init_data overo_vdac = {
+	.constraints = {
+		.min_uV			= 1800000,
+		.max_uV			= 1800000,
+		.valid_modes_mask	= REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask		= REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies	= 1,
+	.consumer_supplies	= &overo_vdda_dac_supply,
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_init_data overo_vpll2 = {
+	.constraints = {
+		.name			= "VDVI",
+		.min_uV			= 1800000,
+		.max_uV			= 1800000,
+		.valid_modes_mask	= REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask		= REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies	= 1,
+	.consumer_supplies	= &overo_vdds_dsi_supply,
+};
+
 /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
 
 static struct twl4030_platform_data overo_twldata = {
@@ -342,6 +471,8 @@ static struct twl4030_platform_data overo_twldata = {
 	.gpio		= &overo_gpio_data,
 	.usb		= &overo_usb_data,
 	.vmmc1		= &overo_vmmc1,
+	.vdac		= &overo_vdac,
+	.vpll2		= &overo_vpll2,
 };
 
 static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
@@ -369,97 +500,6 @@ static void __init overo_init_irq(void)
 	omap_gpio_init();
 }
 
-/* DSS */
-
-#define OVERO_GPIO_LCD_EN 144
-
-static void __init overo_display_init(void)
-{
-	int r;
-
-	r = gpio_request(OVERO_GPIO_LCD_EN, "display enable");
-	if (r)
-		printk("fail1\n");
-	r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1);
-	if (r)
-		printk("fail2\n");
-	gpio_export(OVERO_GPIO_LCD_EN, 0);
-}
-
-static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
-{
-	if (lcd_enabled) {
-		printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
-		return -EINVAL;
-	}
-	dvi_enabled = 1;
-
-	gpio_set_value(OVERO_GPIO_LCD_EN, 1);
-
-	return 0;
-}
-
-static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
-{
-	gpio_set_value(OVERO_GPIO_LCD_EN, 0);
-
-	dvi_enabled = 0;
-}
-
-static struct omap_dss_device overo_dvi_device = {
-	.type = OMAP_DISPLAY_TYPE_DPI,
-	.name = "dvi",
-	.driver_name = "panel_generic",
-	.phy.dpi.data_lines = 24,
-	.platform_enable = overo_panel_enable_dvi,
-	.platform_disable = overo_panel_disable_dvi,
-};
-
-static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
-{
-	if (dvi_enabled) {
-		printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
-		return -EINVAL;
-	}
-
-	gpio_set_value(OVERO_GPIO_LCD_EN, 1);
-	lcd_enabled = 1;
-	return 0;
-}
-
-static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
-{
-	gpio_set_value(OVERO_GPIO_LCD_EN, 0);
-	lcd_enabled = 0;
-}
-
-static struct omap_dss_device overo_lcd_device = {
-	.type = OMAP_DISPLAY_TYPE_DPI,
-	.name = "lcd",
-	.driver_name = "samsung-lte430wq-f0c",
-	.phy.dpi.data_lines = 24,
-	.platform_enable = overo_panel_enable_lcd,
-	.platform_disable = overo_panel_disable_lcd,
-};
-
-static struct omap_dss_device *overo_dss_devices[] = {
-	&overo_dvi_device,
-	&overo_lcd_device,
-};
-
-static struct omap_dss_board_info overo_dss_data = {
-	.num_devices = ARRAY_SIZE(overo_dss_devices),
-	.devices = overo_dss_devices,
-	.default_device = &overo_dvi_device,
-};
-
-static struct platform_device overo_dss_device = {
-	.name          = "omapdss",
-	.id            = -1,
-	.dev            = {
-		.platform_data = &overo_dss_data,
-	},
-};
 
 static struct omap_board_config_kernel overo_config[] __initdata = {
 	{ OMAP_TAG_UART,	&overo_uart_config },
-- 
1.6.2.4