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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
|
From 026ceab45d93841cabd7a0fc734a919171543c46 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 28 May 2009 13:27:43 +0300
Subject: [PATCH 088/146] DSS2: Board file changes for new device model
Changes to Beagle, SDP, Overo board files
---
arch/arm/mach-omap2/board-3430sdp.c | 102 ++++++++--------
arch/arm/mach-omap2/board-omap3beagle.c | 195 ++++++++++++++++---------------
arch/arm/mach-omap2/board-overo.c | 43 ++++---
3 files changed, 173 insertions(+), 167 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 2ee6cbb..ec0c358 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -178,21 +178,6 @@ static unsigned enable_gpio;
static int lcd_enabled;
static int dvi_enabled;
-static struct platform_device sdp3430_lcd_device = {
- .name = "sdp2430_lcd",
- .id = -1,
-};
-
-static struct regulator_consumer_supply sdp3430_vdac_supply = {
- .supply = "vdac",
- .dev = &sdp3430_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply sdp3430_vdvi_supply = {
- .supply = "vdvi",
- .dev = &sdp3430_lcd_device.dev,
-};
-
static void enable_vpll2(int enable)
{
u8 ded_val, grp_val;
@@ -253,7 +238,7 @@ err0:
return;
}
-static int sdp3430_panel_enable_lcd(struct omap_display *display)
+static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
u8 ded_val, ded_reg;
u8 grp_val, grp_reg;
@@ -283,7 +268,7 @@ static int sdp3430_panel_enable_lcd(struct omap_display *display)
return 0;
}
-static void sdp3430_panel_disable_lcd(struct omap_display *display)
+static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
lcd_enabled = 0;
@@ -293,16 +278,7 @@ static void sdp3430_panel_disable_lcd(struct omap_display *display)
gpio_direction_output(backlight_gpio, 0);
}
-static struct omap_dss_display_config sdp3430_display_data = {
- .type = OMAP_DISPLAY_TYPE_DPI,
- .name = "lcd",
- .panel_name = "sharp-ls037v7dw01",
- .u.dpi.data_lines = 16,
- .panel_enable = sdp3430_panel_enable_lcd,
- .panel_disable = sdp3430_panel_disable_lcd,
-};
-
-static int sdp3430_panel_enable_dvi(struct omap_display *display)
+static int sdp3430_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
@@ -316,24 +292,14 @@ static int sdp3430_panel_enable_dvi(struct omap_display *display)
return 0;
}
-static void sdp3430_panel_disable_dvi(struct omap_display *display)
+static void sdp3430_panel_disable_dvi(struct omap_dss_device *dssdev)
{
sdp3430_dsi_power_down();
dvi_enabled = 0;
}
-
-static struct omap_dss_display_config sdp3430_display_data_dvi = {
- .type = OMAP_DISPLAY_TYPE_DPI,
- .name = "dvi",
- .panel_name = "panel-generic",
- .u.dpi.data_lines = 24,
- .panel_enable = sdp3430_panel_enable_dvi,
- .panel_disable = sdp3430_panel_disable_dvi,
-};
-
-static int sdp3430_panel_enable_tv(struct omap_display *display)
+static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
{
#define ENABLE_VDAC_DEDICATED 0x03
#define ENABLE_VDAC_DEV_GRP 0x20
@@ -347,7 +313,7 @@ static int sdp3430_panel_enable_tv(struct omap_display *display)
return 0;
}
-static void sdp3430_panel_disable_tv(struct omap_display *display)
+static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
{
twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
TWL4030_VDAC_DEDICATED);
@@ -355,23 +321,47 @@ static void sdp3430_panel_disable_tv(struct omap_display *display)
TWL4030_VDAC_DEV_GRP);
}
-static struct omap_dss_display_config sdp3430_display_data_tv = {
- .type = OMAP_DISPLAY_TYPE_VENC,
+
+static struct omap_dss_device sdp3430_lcd_device = {
+ .name = "lcd",
+ .driver_name = "sharp_ls_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 16,
+ .platform_enable = sdp3430_panel_enable_lcd,
+ .platform_disable = sdp3430_panel_disable_lcd,
+};
+
+static struct omap_dss_device sdp3430_dvi_device = {
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 24,
+ .platform_enable = sdp3430_panel_enable_dvi,
+ .platform_disable = sdp3430_panel_disable_dvi,
+};
+
+static struct omap_dss_device sdp3430_tv_device = {
.name = "tv",
- .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
- .panel_enable = sdp3430_panel_enable_tv,
- .panel_disable = sdp3430_panel_disable_tv,
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ .platform_enable = sdp3430_panel_enable_tv,
+ .platform_disable = sdp3430_panel_disable_tv,
+};
+
+
+static struct omap_dss_device *sdp3430_dss_devices[] = {
+ &sdp3430_lcd_device,
+ &sdp3430_dvi_device,
+ &sdp3430_tv_device,
};
static struct omap_dss_board_info sdp3430_dss_data = {
+ .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
+ .devices = sdp3430_dss_devices,
+ .default_device = &sdp3430_lcd_device,
.dsi_power_up = sdp3430_dsi_power_up,
.dsi_power_down = sdp3430_dsi_power_down,
- .num_displays = 3,
- .displays = {
- &sdp3430_display_data,
- &sdp3430_display_data_dvi,
- &sdp3430_display_data_tv,
- }
};
static struct platform_device sdp3430_dss_device = {
@@ -382,6 +372,16 @@ static struct platform_device sdp3430_dss_device = {
},
};
+static struct regulator_consumer_supply sdp3430_vdac_supply = {
+ .supply = "vdac",
+ .dev = &sdp3430_dss_device.dev,
+};
+
+static struct regulator_consumer_supply sdp3430_vdvi_supply = {
+ .supply = "vdvi",
+ .dev = &sdp3430_dss_device.dev,
+};
+
static struct platform_device *sdp3430_devices[] __initdata = {
&sdp3430_dss_device,
};
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 4ab7396..67e1d5c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -108,6 +108,105 @@ static struct platform_device omap3beagle_nand_device = {
.resource = &omap3beagle_nand_resource,
};
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 1);
+
+ return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+ .reset_gpio = 170,
+ .platform_enable = beagle_enable_dvi,
+ .platform_disable = beagle_disable_dvi,
+};
+
+static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+#define ENABLE_VDAC_DEDICATED 0x03
+#define ENABLE_VDAC_DEV_GRP 0x20
+
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEDICATED,
+ TWL4030_VDAC_DEDICATED);
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
+
+ return 0;
+}
+
+static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEDICATED);
+ twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
+ TWL4030_VDAC_DEV_GRP);
+}
+
+static struct omap_dss_device beagle_tv_device = {
+ .name = "tv",
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ .platform_enable = beagle_panel_enable_tv,
+ .platform_disable = beagle_panel_disable_tv,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+ &beagle_dvi_device,
+ &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+ .num_devices = ARRAY_SIZE(beagle_dss_devices),
+ .devices = beagle_dss_devices,
+ .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+ .name = "omapdss",
+ .id = -1,
+ .dev = {
+ .platform_data = &beagle_dss_data,
+ },
+};
+
+static struct regulator_consumer_supply beagle_vdac_supply = {
+ .supply = "vdac",
+ .dev = &beagle_dss_device.dev,
+};
+
+static struct regulator_consumer_supply beagle_vdvi_supply = {
+ .supply = "vdvi",
+ .dev = &beagle_dss_device.dev,
+};
+
+static void __init beagle_display_init(void)
+{
+ int r;
+
+ r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+ if (r < 0) {
+ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
#include "sdram-micron-mt46h32m32lf-6.h"
static struct omap_uart_config omap3_beagle_uart_config __initdata = {
@@ -182,16 +281,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = {
.setup = beagle_twl_gpio_setup,
};
-static struct regulator_consumer_supply beagle_vdac_supply = {
- .supply = "vdac",
- .dev = &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
- .supply = "vdvi",
- .dev = &omap3_beagle_lcd_device.dev,
-};
-
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data beagle_vmmc1 = {
.constraints = {
@@ -345,92 +434,6 @@ static struct platform_device keys_gpio = {
},
};
-/* DSS */
-
-static int beagle_enable_dvi(struct omap_display *display)
-{
- if (display->hw_config.panel_reset_gpio != -1)
- gpio_set_value(display->hw_config.panel_reset_gpio, 1);
-
- return 0;
-}
-
-static void beagle_disable_dvi(struct omap_display *display)
-{
- if (display->hw_config.panel_reset_gpio != -1)
- gpio_set_value(display->hw_config.panel_reset_gpio, 0);
-}
-
-static struct omap_dss_display_config beagle_display_data_dvi = {
- .type = OMAP_DISPLAY_TYPE_DPI,
- .name = "dvi",
- .panel_name = "panel-generic",
- .u.dpi.data_lines = 24,
- .panel_reset_gpio = 170,
- .panel_enable = beagle_enable_dvi,
- .panel_disable = beagle_disable_dvi,
-};
-
-
-static int beagle_panel_enable_tv(struct omap_display *display)
-{
-#define ENABLE_VDAC_DEDICATED 0x03
-#define ENABLE_VDAC_DEV_GRP 0x20
-
- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
- ENABLE_VDAC_DEDICATED,
- TWL4030_VDAC_DEDICATED);
- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
- ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
-
- return 0;
-}
-
-static void beagle_panel_disable_tv(struct omap_display *display)
-{
- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
- TWL4030_VDAC_DEDICATED);
- twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
- TWL4030_VDAC_DEV_GRP);
-}
-
-static struct omap_dss_display_config beagle_display_data_tv = {
- .type = OMAP_DISPLAY_TYPE_VENC,
- .name = "tv",
- .u.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
- .panel_enable = beagle_panel_enable_tv,
- .panel_disable = beagle_panel_disable_tv,
-};
-
-static struct omap_dss_board_info beagle_dss_data = {
- .num_displays = 2,
- .displays = {
- &beagle_display_data_dvi,
- &beagle_display_data_tv,
- }
-};
-
-static struct platform_device beagle_dss_device = {
- .name = "omapdss",
- .id = -1,
- .dev = {
- .platform_data = &beagle_dss_data,
- },
-};
-
-static void __init beagle_display_init(void)
-{
- int r;
-
- r = gpio_request(beagle_display_data_dvi.panel_reset_gpio, "DVI reset");
- if (r < 0) {
- printk(KERN_ERR "Unable to get DVI reset GPIO\n");
- return;
- }
-
- gpio_direction_output(beagle_display_data_dvi.panel_reset_gpio, 0);
-}
-
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
{ OMAP_TAG_UART, &omap3_beagle_uart_config },
};
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 7bcac03..39f95f5 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -386,7 +386,7 @@ static void __init overo_display_init(void)
gpio_export(OVERO_GPIO_LCD_EN, 0);
}
-static int overo_panel_enable_dvi(struct omap_display *display)
+static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
{
if (lcd_enabled) {
printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
@@ -399,23 +399,23 @@ static int overo_panel_enable_dvi(struct omap_display *display)
return 0;
}
-static void overo_panel_disable_dvi(struct omap_display *display)
+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_display_config overo_display_data_dvi = {
+static struct omap_dss_device overo_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi",
- .panel_name = "panel-generic",
- .u.dpi.data_lines = 24,
- .panel_enable = overo_panel_enable_dvi,
- .panel_disable = overo_panel_disable_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_display *display)
+static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
@@ -427,27 +427,30 @@ static int overo_panel_enable_lcd(struct omap_display *display)
return 0;
}
-static void overo_panel_disable_lcd(struct omap_display *display)
+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_display_config overo_display_data_lcd = {
+static struct omap_dss_device overo_lcd_device = {
.type = OMAP_DISPLAY_TYPE_DPI,
.name = "lcd",
- .panel_name = "samsung-lte430wq-f0c",
- .u.dpi.data_lines = 24,
- .panel_enable = overo_panel_enable_lcd,
- .panel_disable = overo_panel_disable_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_displays = 2,
- .displays = {
- &overo_display_data_dvi,
- &overo_display_data_lcd,
- }
+ .num_devices = ARRAY_SIZE(overo_dss_devices),
+ .devices = overo_dss_devices,
+ .default_device = &overo_dvi_device,
};
static struct platform_device overo_dss_device = {
--
1.6.2.4
|