diff options
-rw-r--r-- | arch/arm/mach-omap2/board-am3517evm.c | 145 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t35.c | 239 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 246 |
3 files changed, 618 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index b4e6eca0e8a9..54af5f8d8184 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -29,9 +29,151 @@ | |||
29 | #include <plat/board.h> | 29 | #include <plat/board.h> |
30 | #include <plat/common.h> | 30 | #include <plat/common.h> |
31 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | #include <plat/display.h> | ||
32 | 33 | ||
33 | #include "mux.h" | 34 | #include "mux.h" |
34 | 35 | ||
36 | #define LCD_PANEL_PWR 176 | ||
37 | #define LCD_PANEL_BKLIGHT_PWR 182 | ||
38 | #define LCD_PANEL_PWM 181 | ||
39 | |||
40 | static int lcd_enabled; | ||
41 | static int dvi_enabled; | ||
42 | |||
43 | static void __init am3517_evm_display_init(void) | ||
44 | { | ||
45 | int r; | ||
46 | |||
47 | omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); | ||
48 | omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); | ||
49 | omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); | ||
50 | /* | ||
51 | * Enable GPIO 182 = LCD Backlight Power | ||
52 | */ | ||
53 | r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); | ||
54 | if (r) { | ||
55 | printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); | ||
56 | return; | ||
57 | } | ||
58 | gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); | ||
59 | /* | ||
60 | * Enable GPIO 181 = LCD Panel PWM | ||
61 | */ | ||
62 | r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); | ||
63 | if (r) { | ||
64 | printk(KERN_ERR "failed to get lcd_pwm\n"); | ||
65 | goto err_1; | ||
66 | } | ||
67 | gpio_direction_output(LCD_PANEL_PWM, 1); | ||
68 | /* | ||
69 | * Enable GPIO 176 = LCD Panel Power enable pin | ||
70 | */ | ||
71 | r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); | ||
72 | if (r) { | ||
73 | printk(KERN_ERR "failed to get lcd_panel_pwr\n"); | ||
74 | goto err_2; | ||
75 | } | ||
76 | gpio_direction_output(LCD_PANEL_PWR, 1); | ||
77 | |||
78 | printk(KERN_INFO "Display initialized successfully\n"); | ||
79 | return; | ||
80 | |||
81 | err_2: | ||
82 | gpio_free(LCD_PANEL_PWM); | ||
83 | err_1: | ||
84 | gpio_free(LCD_PANEL_BKLIGHT_PWR); | ||
85 | } | ||
86 | |||
87 | static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
88 | { | ||
89 | if (dvi_enabled) { | ||
90 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
91 | return -EINVAL; | ||
92 | } | ||
93 | gpio_set_value(LCD_PANEL_PWR, 1); | ||
94 | lcd_enabled = 1; | ||
95 | |||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
100 | { | ||
101 | gpio_set_value(LCD_PANEL_PWR, 0); | ||
102 | lcd_enabled = 0; | ||
103 | } | ||
104 | |||
105 | static struct omap_dss_device am3517_evm_lcd_device = { | ||
106 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
107 | .name = "lcd", | ||
108 | .driver_name = "sharp_lq_panel", | ||
109 | .phy.dpi.data_lines = 16, | ||
110 | .platform_enable = am3517_evm_panel_enable_lcd, | ||
111 | .platform_disable = am3517_evm_panel_disable_lcd, | ||
112 | }; | ||
113 | |||
114 | static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | static struct omap_dss_device am3517_evm_tv_device = { | ||
124 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
125 | .name = "tv", | ||
126 | .driver_name = "venc", | ||
127 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
128 | .platform_enable = am3517_evm_panel_enable_tv, | ||
129 | .platform_disable = am3517_evm_panel_disable_tv, | ||
130 | }; | ||
131 | |||
132 | static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
133 | { | ||
134 | if (lcd_enabled) { | ||
135 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
136 | return -EINVAL; | ||
137 | } | ||
138 | dvi_enabled = 1; | ||
139 | |||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
144 | { | ||
145 | dvi_enabled = 0; | ||
146 | } | ||
147 | |||
148 | static struct omap_dss_device am3517_evm_dvi_device = { | ||
149 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
150 | .name = "dvi", | ||
151 | .driver_name = "generic_panel", | ||
152 | .phy.dpi.data_lines = 24, | ||
153 | .platform_enable = am3517_evm_panel_enable_dvi, | ||
154 | .platform_disable = am3517_evm_panel_disable_dvi, | ||
155 | }; | ||
156 | |||
157 | static struct omap_dss_device *am3517_evm_dss_devices[] = { | ||
158 | &am3517_evm_lcd_device, | ||
159 | &am3517_evm_tv_device, | ||
160 | &am3517_evm_dvi_device, | ||
161 | }; | ||
162 | |||
163 | static struct omap_dss_board_info am3517_evm_dss_data = { | ||
164 | .num_devices = ARRAY_SIZE(am3517_evm_dss_devices), | ||
165 | .devices = am3517_evm_dss_devices, | ||
166 | .default_device = &am3517_evm_lcd_device, | ||
167 | }; | ||
168 | |||
169 | struct platform_device am3517_evm_dss_device = { | ||
170 | .name = "omapdss", | ||
171 | .id = -1, | ||
172 | .dev = { | ||
173 | .platform_data = &am3517_evm_dss_data, | ||
174 | }, | ||
175 | }; | ||
176 | |||
35 | /* | 177 | /* |
36 | * Board initialization | 178 | * Board initialization |
37 | */ | 179 | */ |
@@ -39,6 +181,7 @@ static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | |||
39 | }; | 181 | }; |
40 | 182 | ||
41 | static struct platform_device *am3517_evm_devices[] __initdata = { | 183 | static struct platform_device *am3517_evm_devices[] __initdata = { |
184 | &am3517_evm_dss_device, | ||
42 | }; | 185 | }; |
43 | 186 | ||
44 | static void __init am3517_evm_init_irq(void) | 187 | static void __init am3517_evm_init_irq(void) |
@@ -78,6 +221,8 @@ static void __init am3517_evm_init(void) | |||
78 | 221 | ||
79 | omap_serial_init(); | 222 | omap_serial_init(); |
80 | usb_ehci_init(&ehci_pdata); | 223 | usb_ehci_init(&ehci_pdata); |
224 | /* DSS */ | ||
225 | am3517_evm_display_init(); | ||
81 | } | 226 | } |
82 | 227 | ||
83 | static void __init am3517_evm_map_io(void) | 228 | static void __init am3517_evm_map_io(void) |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 2626a9f8a73a..85b45437d51a 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -32,6 +32,9 @@ | |||
32 | #include <linux/i2c/twl.h> | 32 | #include <linux/i2c/twl.h> |
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | 34 | ||
35 | #include <linux/spi/spi.h> | ||
36 | #include <linux/spi/tdo24m.h> | ||
37 | |||
35 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
@@ -41,6 +44,7 @@ | |||
41 | #include <plat/nand.h> | 44 | #include <plat/nand.h> |
42 | #include <plat/gpmc.h> | 45 | #include <plat/gpmc.h> |
43 | #include <plat/usb.h> | 46 | #include <plat/usb.h> |
47 | #include <plat/display.h> | ||
44 | 48 | ||
45 | #include <mach/hardware.h> | 49 | #include <mach/hardware.h> |
46 | 50 | ||
@@ -248,7 +252,6 @@ static inline void cm_t35_init_nand(void) {} | |||
248 | 252 | ||
249 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | 253 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
250 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 254 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
251 | #include <linux/spi/spi.h> | ||
252 | #include <linux/spi/ads7846.h> | 255 | #include <linux/spi/ads7846.h> |
253 | 256 | ||
254 | #include <plat/mcspi.h> | 257 | #include <plat/mcspi.h> |
@@ -304,6 +307,193 @@ static void __init cm_t35_init_ads7846(void) | |||
304 | static inline void cm_t35_init_ads7846(void) {} | 307 | static inline void cm_t35_init_ads7846(void) {} |
305 | #endif | 308 | #endif |
306 | 309 | ||
310 | #define CM_T35_LCD_EN_GPIO 157 | ||
311 | #define CM_T35_LCD_BL_GPIO 58 | ||
312 | #define CM_T35_DVI_EN_GPIO 54 | ||
313 | |||
314 | static int lcd_bl_gpio; | ||
315 | static int lcd_en_gpio; | ||
316 | static int dvi_en_gpio; | ||
317 | |||
318 | static int lcd_enabled; | ||
319 | static int dvi_enabled; | ||
320 | |||
321 | static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
322 | { | ||
323 | if (dvi_enabled) { | ||
324 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
325 | return -EINVAL; | ||
326 | } | ||
327 | |||
328 | gpio_set_value(lcd_en_gpio, 1); | ||
329 | gpio_set_value(lcd_bl_gpio, 1); | ||
330 | |||
331 | lcd_enabled = 1; | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
337 | { | ||
338 | lcd_enabled = 0; | ||
339 | |||
340 | gpio_set_value(lcd_bl_gpio, 0); | ||
341 | gpio_set_value(lcd_en_gpio, 0); | ||
342 | } | ||
343 | |||
344 | static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
345 | { | ||
346 | if (lcd_enabled) { | ||
347 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
348 | return -EINVAL; | ||
349 | } | ||
350 | |||
351 | gpio_set_value(dvi_en_gpio, 0); | ||
352 | dvi_enabled = 1; | ||
353 | |||
354 | return 0; | ||
355 | } | ||
356 | |||
357 | static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
358 | { | ||
359 | gpio_set_value(dvi_en_gpio, 1); | ||
360 | dvi_enabled = 0; | ||
361 | } | ||
362 | |||
363 | static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) | ||
364 | { | ||
365 | return 0; | ||
366 | } | ||
367 | |||
368 | static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) | ||
369 | { | ||
370 | } | ||
371 | |||
372 | static struct omap_dss_device cm_t35_lcd_device = { | ||
373 | .name = "lcd", | ||
374 | .driver_name = "toppoly_tdo35s_panel", | ||
375 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
376 | .phy.dpi.data_lines = 18, | ||
377 | .platform_enable = cm_t35_panel_enable_lcd, | ||
378 | .platform_disable = cm_t35_panel_disable_lcd, | ||
379 | }; | ||
380 | |||
381 | static struct omap_dss_device cm_t35_dvi_device = { | ||
382 | .name = "dvi", | ||
383 | .driver_name = "generic_panel", | ||
384 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
385 | .phy.dpi.data_lines = 24, | ||
386 | .platform_enable = cm_t35_panel_enable_dvi, | ||
387 | .platform_disable = cm_t35_panel_disable_dvi, | ||
388 | }; | ||
389 | |||
390 | static struct omap_dss_device cm_t35_tv_device = { | ||
391 | .name = "tv", | ||
392 | .driver_name = "venc", | ||
393 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
394 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
395 | .platform_enable = cm_t35_panel_enable_tv, | ||
396 | .platform_disable = cm_t35_panel_disable_tv, | ||
397 | }; | ||
398 | |||
399 | static struct omap_dss_device *cm_t35_dss_devices[] = { | ||
400 | &cm_t35_lcd_device, | ||
401 | &cm_t35_dvi_device, | ||
402 | &cm_t35_tv_device, | ||
403 | }; | ||
404 | |||
405 | static struct omap_dss_board_info cm_t35_dss_data = { | ||
406 | .num_devices = ARRAY_SIZE(cm_t35_dss_devices), | ||
407 | .devices = cm_t35_dss_devices, | ||
408 | .default_device = &cm_t35_dvi_device, | ||
409 | }; | ||
410 | |||
411 | static struct platform_device cm_t35_dss_device = { | ||
412 | .name = "omapdss", | ||
413 | .id = -1, | ||
414 | .dev = { | ||
415 | .platform_data = &cm_t35_dss_data, | ||
416 | }, | ||
417 | }; | ||
418 | |||
419 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { | ||
420 | .turbo_mode = 0, | ||
421 | .single_channel = 1, /* 0: slave, 1: master */ | ||
422 | }; | ||
423 | |||
424 | static struct tdo24m_platform_data tdo24m_config = { | ||
425 | .model = TDO35S, | ||
426 | }; | ||
427 | |||
428 | static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { | ||
429 | { | ||
430 | .modalias = "tdo24m", | ||
431 | .bus_num = 4, | ||
432 | .chip_select = 0, | ||
433 | .max_speed_hz = 1000000, | ||
434 | .controller_data = &tdo24m_mcspi_config, | ||
435 | .platform_data = &tdo24m_config, | ||
436 | }, | ||
437 | }; | ||
438 | |||
439 | static void __init cm_t35_init_display(void) | ||
440 | { | ||
441 | int err; | ||
442 | |||
443 | lcd_en_gpio = CM_T35_LCD_EN_GPIO; | ||
444 | lcd_bl_gpio = CM_T35_LCD_BL_GPIO; | ||
445 | dvi_en_gpio = CM_T35_DVI_EN_GPIO; | ||
446 | |||
447 | spi_register_board_info(cm_t35_lcd_spi_board_info, | ||
448 | ARRAY_SIZE(cm_t35_lcd_spi_board_info)); | ||
449 | |||
450 | err = gpio_request(lcd_en_gpio, "LCD RST"); | ||
451 | if (err) { | ||
452 | pr_err("CM-T35: failed to get LCD reset GPIO\n"); | ||
453 | goto out; | ||
454 | } | ||
455 | |||
456 | err = gpio_request(lcd_bl_gpio, "LCD BL"); | ||
457 | if (err) { | ||
458 | pr_err("CM-T35: failed to get LCD backlight control GPIO\n"); | ||
459 | goto err_lcd_bl; | ||
460 | } | ||
461 | |||
462 | err = gpio_request(dvi_en_gpio, "DVI EN"); | ||
463 | if (err) { | ||
464 | pr_err("CM-T35: failed to get DVI reset GPIO\n"); | ||
465 | goto err_dvi_en; | ||
466 | } | ||
467 | |||
468 | gpio_export(lcd_en_gpio, 0); | ||
469 | gpio_export(lcd_bl_gpio, 0); | ||
470 | gpio_export(dvi_en_gpio, 0); | ||
471 | gpio_direction_output(lcd_en_gpio, 0); | ||
472 | gpio_direction_output(lcd_bl_gpio, 0); | ||
473 | gpio_direction_output(dvi_en_gpio, 1); | ||
474 | |||
475 | msleep(50); | ||
476 | gpio_set_value(lcd_en_gpio, 1); | ||
477 | |||
478 | err = platform_device_register(&cm_t35_dss_device); | ||
479 | if (err) { | ||
480 | pr_err("CM-T35: failed to register DSS device\n"); | ||
481 | goto err_dev_reg; | ||
482 | } | ||
483 | |||
484 | return; | ||
485 | |||
486 | err_dev_reg: | ||
487 | gpio_free(dvi_en_gpio); | ||
488 | err_dvi_en: | ||
489 | gpio_free(lcd_bl_gpio); | ||
490 | err_lcd_bl: | ||
491 | gpio_free(lcd_en_gpio); | ||
492 | out: | ||
493 | |||
494 | return; | ||
495 | } | ||
496 | |||
307 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { | 497 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { |
308 | .supply = "vmmc", | 498 | .supply = "vmmc", |
309 | }; | 499 | }; |
@@ -312,6 +502,16 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { | |||
312 | .supply = "vmmc_aux", | 502 | .supply = "vmmc_aux", |
313 | }; | 503 | }; |
314 | 504 | ||
505 | static struct regulator_consumer_supply cm_t35_vdac_supply = { | ||
506 | .supply = "vdda_dac", | ||
507 | .dev = &cm_t35_dss_device.dev, | ||
508 | }; | ||
509 | |||
510 | static struct regulator_consumer_supply cm_t35_vdvi_supply = { | ||
511 | .supply = "vdvi", | ||
512 | .dev = &cm_t35_dss_device.dev, | ||
513 | }; | ||
514 | |||
315 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 515 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
316 | static struct regulator_init_data cm_t35_vmmc1 = { | 516 | static struct regulator_init_data cm_t35_vmmc1 = { |
317 | .constraints = { | 517 | .constraints = { |
@@ -342,6 +542,35 @@ static struct regulator_init_data cm_t35_vsim = { | |||
342 | .consumer_supplies = &cm_t35_vsim_supply, | 542 | .consumer_supplies = &cm_t35_vsim_supply, |
343 | }; | 543 | }; |
344 | 544 | ||
545 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | ||
546 | static struct regulator_init_data cm_t35_vdac = { | ||
547 | .constraints = { | ||
548 | .min_uV = 1800000, | ||
549 | .max_uV = 1800000, | ||
550 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
551 | | REGULATOR_MODE_STANDBY, | ||
552 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
553 | | REGULATOR_CHANGE_STATUS, | ||
554 | }, | ||
555 | .num_consumer_supplies = 1, | ||
556 | .consumer_supplies = &cm_t35_vdac_supply, | ||
557 | }; | ||
558 | |||
559 | /* VPLL2 for digital video outputs */ | ||
560 | static struct regulator_init_data cm_t35_vpll2 = { | ||
561 | .constraints = { | ||
562 | .name = "VDVI", | ||
563 | .min_uV = 1800000, | ||
564 | .max_uV = 1800000, | ||
565 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
566 | | REGULATOR_MODE_STANDBY, | ||
567 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
568 | | REGULATOR_CHANGE_STATUS, | ||
569 | }, | ||
570 | .num_consumer_supplies = 1, | ||
571 | .consumer_supplies = &cm_t35_vdvi_supply, | ||
572 | }; | ||
573 | |||
345 | static struct twl4030_usb_data cm_t35_usb_data = { | 574 | static struct twl4030_usb_data cm_t35_usb_data = { |
346 | .usb_mode = T2_USB_MODE_ULPI, | 575 | .usb_mode = T2_USB_MODE_ULPI, |
347 | }; | 576 | }; |
@@ -445,6 +674,8 @@ static struct twl4030_platform_data cm_t35_twldata = { | |||
445 | .gpio = &cm_t35_gpio_data, | 674 | .gpio = &cm_t35_gpio_data, |
446 | .vmmc1 = &cm_t35_vmmc1, | 675 | .vmmc1 = &cm_t35_vmmc1, |
447 | .vsim = &cm_t35_vsim, | 676 | .vsim = &cm_t35_vsim, |
677 | .vdac = &cm_t35_vdac, | ||
678 | .vpll2 = &cm_t35_vpll2, | ||
448 | }; | 679 | }; |
449 | 680 | ||
450 | static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = { | 681 | static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = { |
@@ -568,6 +799,11 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
568 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), | 799 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), |
569 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), | 800 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), |
570 | 801 | ||
802 | /* display controls */ | ||
803 | OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
804 | OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
805 | OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
806 | |||
571 | /* TPS IRQ */ | 807 | /* TPS IRQ */ |
572 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \ | 808 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \ |
573 | OMAP_PIN_INPUT_PULLUP), | 809 | OMAP_PIN_INPUT_PULLUP), |
@@ -584,6 +820,7 @@ static void __init cm_t35_init(void) | |||
584 | cm_t35_init_ads7846(); | 820 | cm_t35_init_ads7846(); |
585 | cm_t35_init_ethernet(); | 821 | cm_t35_init_ethernet(); |
586 | cm_t35_init_led(); | 822 | cm_t35_init_led(); |
823 | cm_t35_init_display(); | ||
587 | 824 | ||
588 | usb_musb_init(); | 825 | usb_musb_init(); |
589 | } | 826 | } |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 34de17851572..822df79ce891 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <plat/usb.h> | 41 | #include <plat/usb.h> |
42 | #include <plat/common.h> | 42 | #include <plat/common.h> |
43 | #include <plat/mcspi.h> | 43 | #include <plat/mcspi.h> |
44 | #include <plat/display.h> | ||
44 | 45 | ||
45 | #include "mux.h" | 46 | #include "mux.h" |
46 | #include "sdram-micron-mt46h32m32lf-6.h" | 47 | #include "sdram-micron-mt46h32m32lf-6.h" |
@@ -147,6 +148,187 @@ static inline void __init omap3evm_init_smsc911x(void) | |||
147 | static inline void __init omap3evm_init_smsc911x(void) { return; } | 148 | static inline void __init omap3evm_init_smsc911x(void) { return; } |
148 | #endif | 149 | #endif |
149 | 150 | ||
151 | /* | ||
152 | * OMAP3EVM LCD Panel control signals | ||
153 | */ | ||
154 | #define OMAP3EVM_LCD_PANEL_LR 2 | ||
155 | #define OMAP3EVM_LCD_PANEL_UD 3 | ||
156 | #define OMAP3EVM_LCD_PANEL_INI 152 | ||
157 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
158 | #define OMAP3EVM_LCD_PANEL_QVGA 154 | ||
159 | #define OMAP3EVM_LCD_PANEL_RESB 155 | ||
160 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 | ||
161 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 | ||
162 | |||
163 | static int lcd_enabled; | ||
164 | static int dvi_enabled; | ||
165 | |||
166 | static void __init omap3_evm_display_init(void) | ||
167 | { | ||
168 | int r; | ||
169 | |||
170 | r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb"); | ||
171 | if (r) { | ||
172 | printk(KERN_ERR "failed to get lcd_panel_resb\n"); | ||
173 | return; | ||
174 | } | ||
175 | gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1); | ||
176 | |||
177 | r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini"); | ||
178 | if (r) { | ||
179 | printk(KERN_ERR "failed to get lcd_panel_ini\n"); | ||
180 | goto err_1; | ||
181 | } | ||
182 | gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1); | ||
183 | |||
184 | r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga"); | ||
185 | if (r) { | ||
186 | printk(KERN_ERR "failed to get lcd_panel_qvga\n"); | ||
187 | goto err_2; | ||
188 | } | ||
189 | gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0); | ||
190 | |||
191 | r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr"); | ||
192 | if (r) { | ||
193 | printk(KERN_ERR "failed to get lcd_panel_lr\n"); | ||
194 | goto err_3; | ||
195 | } | ||
196 | gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1); | ||
197 | |||
198 | r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud"); | ||
199 | if (r) { | ||
200 | printk(KERN_ERR "failed to get lcd_panel_ud\n"); | ||
201 | goto err_4; | ||
202 | } | ||
203 | gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1); | ||
204 | |||
205 | r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd"); | ||
206 | if (r) { | ||
207 | printk(KERN_ERR "failed to get lcd_panel_envdd\n"); | ||
208 | goto err_5; | ||
209 | } | ||
210 | gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
211 | |||
212 | return; | ||
213 | |||
214 | err_5: | ||
215 | gpio_free(OMAP3EVM_LCD_PANEL_UD); | ||
216 | err_4: | ||
217 | gpio_free(OMAP3EVM_LCD_PANEL_LR); | ||
218 | err_3: | ||
219 | gpio_free(OMAP3EVM_LCD_PANEL_QVGA); | ||
220 | err_2: | ||
221 | gpio_free(OMAP3EVM_LCD_PANEL_INI); | ||
222 | err_1: | ||
223 | gpio_free(OMAP3EVM_LCD_PANEL_RESB); | ||
224 | |||
225 | } | ||
226 | |||
227 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | ||
228 | { | ||
229 | if (dvi_enabled) { | ||
230 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
231 | return -EINVAL; | ||
232 | } | ||
233 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
234 | |||
235 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
236 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
237 | else | ||
238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
239 | |||
240 | lcd_enabled = 1; | ||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | ||
245 | { | ||
246 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | ||
247 | |||
248 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
249 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
250 | else | ||
251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
252 | |||
253 | lcd_enabled = 0; | ||
254 | } | ||
255 | |||
256 | static struct omap_dss_device omap3_evm_lcd_device = { | ||
257 | .name = "lcd", | ||
258 | .driver_name = "sharp_ls_panel", | ||
259 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
260 | .phy.dpi.data_lines = 18, | ||
261 | .platform_enable = omap3_evm_enable_lcd, | ||
262 | .platform_disable = omap3_evm_disable_lcd, | ||
263 | }; | ||
264 | |||
265 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) | ||
266 | { | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static void omap3_evm_disable_tv(struct omap_dss_device *dssdev) | ||
271 | { | ||
272 | } | ||
273 | |||
274 | static struct omap_dss_device omap3_evm_tv_device = { | ||
275 | .name = "tv", | ||
276 | .driver_name = "venc", | ||
277 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
278 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
279 | .platform_enable = omap3_evm_enable_tv, | ||
280 | .platform_disable = omap3_evm_disable_tv, | ||
281 | }; | ||
282 | |||
283 | static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | ||
284 | { | ||
285 | if (lcd_enabled) { | ||
286 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
287 | return -EINVAL; | ||
288 | } | ||
289 | |||
290 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); | ||
291 | |||
292 | dvi_enabled = 1; | ||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) | ||
297 | { | ||
298 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); | ||
299 | |||
300 | dvi_enabled = 0; | ||
301 | } | ||
302 | |||
303 | static struct omap_dss_device omap3_evm_dvi_device = { | ||
304 | .name = "dvi", | ||
305 | .driver_name = "generic_panel", | ||
306 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
307 | .phy.dpi.data_lines = 24, | ||
308 | .platform_enable = omap3_evm_enable_dvi, | ||
309 | .platform_disable = omap3_evm_disable_dvi, | ||
310 | }; | ||
311 | |||
312 | static struct omap_dss_device *omap3_evm_dss_devices[] = { | ||
313 | &omap3_evm_lcd_device, | ||
314 | &omap3_evm_tv_device, | ||
315 | &omap3_evm_dvi_device, | ||
316 | }; | ||
317 | |||
318 | static struct omap_dss_board_info omap3_evm_dss_data = { | ||
319 | .num_devices = ARRAY_SIZE(omap3_evm_dss_devices), | ||
320 | .devices = omap3_evm_dss_devices, | ||
321 | .default_device = &omap3_evm_lcd_device, | ||
322 | }; | ||
323 | |||
324 | static struct platform_device omap3_evm_dss_device = { | ||
325 | .name = "omapdss", | ||
326 | .id = -1, | ||
327 | .dev = { | ||
328 | .platform_data = &omap3_evm_dss_data, | ||
329 | }, | ||
330 | }; | ||
331 | |||
150 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 332 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
151 | .supply = "vmmc", | 333 | .supply = "vmmc", |
152 | }; | 334 | }; |
@@ -236,6 +418,14 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
236 | * the P2 connector; notably LEDA for the LCD backlight. | 418 | * the P2 connector; notably LEDA for the LCD backlight. |
237 | */ | 419 | */ |
238 | 420 | ||
421 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ | ||
422 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); | ||
423 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
424 | |||
425 | /* gpio + 7 == DVI Enable */ | ||
426 | gpio_request(gpio + 7, "EN_DVI"); | ||
427 | gpio_direction_output(gpio + 7, 0); | ||
428 | |||
239 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ | 429 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ |
240 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 430 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
241 | 431 | ||
@@ -300,6 +490,47 @@ static struct twl4030_codec_data omap3evm_codec_data = { | |||
300 | .audio = &omap3evm_audio_data, | 490 | .audio = &omap3evm_audio_data, |
301 | }; | 491 | }; |
302 | 492 | ||
493 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { | ||
494 | .supply = "vdda_dac", | ||
495 | .dev = &omap3_evm_dss_device.dev, | ||
496 | }; | ||
497 | |||
498 | /* VDAC for DSS driving S-Video */ | ||
499 | static struct regulator_init_data omap3_evm_vdac = { | ||
500 | .constraints = { | ||
501 | .min_uV = 1800000, | ||
502 | .max_uV = 1800000, | ||
503 | .apply_uV = true, | ||
504 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
505 | | REGULATOR_MODE_STANDBY, | ||
506 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
507 | | REGULATOR_CHANGE_STATUS, | ||
508 | }, | ||
509 | .num_consumer_supplies = 1, | ||
510 | .consumer_supplies = &omap3_evm_vdda_dac_supply, | ||
511 | }; | ||
512 | |||
513 | /* VPLL2 for digital video outputs */ | ||
514 | static struct regulator_consumer_supply omap3_evm_vpll2_supply = { | ||
515 | .supply = "vdvi", | ||
516 | .dev = &omap3_evm_lcd_device.dev, | ||
517 | }; | ||
518 | |||
519 | static struct regulator_init_data omap3_evm_vpll2 = { | ||
520 | .constraints = { | ||
521 | .name = "VDVI", | ||
522 | .min_uV = 1800000, | ||
523 | .max_uV = 1800000, | ||
524 | .apply_uV = true, | ||
525 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
526 | | REGULATOR_MODE_STANDBY, | ||
527 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
528 | | REGULATOR_CHANGE_STATUS, | ||
529 | }, | ||
530 | .num_consumer_supplies = 1, | ||
531 | .consumer_supplies = &omap3_evm_vpll2_supply, | ||
532 | }; | ||
533 | |||
303 | static struct twl4030_platform_data omap3evm_twldata = { | 534 | static struct twl4030_platform_data omap3evm_twldata = { |
304 | .irq_base = TWL4030_IRQ_BASE, | 535 | .irq_base = TWL4030_IRQ_BASE, |
305 | .irq_end = TWL4030_IRQ_END, | 536 | .irq_end = TWL4030_IRQ_END, |
@@ -310,6 +541,8 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
310 | .usb = &omap3evm_usb_data, | 541 | .usb = &omap3evm_usb_data, |
311 | .gpio = &omap3evm_gpio_data, | 542 | .gpio = &omap3evm_gpio_data, |
312 | .codec = &omap3evm_codec_data, | 543 | .codec = &omap3evm_codec_data, |
544 | .vdac = &omap3_evm_vdac, | ||
545 | .vpll2 = &omap3_evm_vpll2, | ||
313 | }; | 546 | }; |
314 | 547 | ||
315 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | 548 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
@@ -337,15 +570,6 @@ static int __init omap3_evm_i2c_init(void) | |||
337 | return 0; | 570 | return 0; |
338 | } | 571 | } |
339 | 572 | ||
340 | static struct platform_device omap3_evm_lcd_device = { | ||
341 | .name = "omap3evm_lcd", | ||
342 | .id = -1, | ||
343 | }; | ||
344 | |||
345 | static struct omap_lcd_config omap3_evm_lcd_config __initdata = { | ||
346 | .ctrl_name = "internal", | ||
347 | }; | ||
348 | |||
349 | static void ads7846_dev_init(void) | 573 | static void ads7846_dev_init(void) |
350 | { | 574 | { |
351 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) | 575 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) |
@@ -393,7 +617,6 @@ struct spi_board_info omap3evm_spi_board_info[] = { | |||
393 | }; | 617 | }; |
394 | 618 | ||
395 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | 619 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
396 | { OMAP_TAG_LCD, &omap3_evm_lcd_config }, | ||
397 | }; | 620 | }; |
398 | 621 | ||
399 | static void __init omap3_evm_init_irq(void) | 622 | static void __init omap3_evm_init_irq(void) |
@@ -406,7 +629,7 @@ static void __init omap3_evm_init_irq(void) | |||
406 | } | 629 | } |
407 | 630 | ||
408 | static struct platform_device *omap3_evm_devices[] __initdata = { | 631 | static struct platform_device *omap3_evm_devices[] __initdata = { |
409 | &omap3_evm_lcd_device, | 632 | &omap3_evm_dss_device, |
410 | }; | 633 | }; |
411 | 634 | ||
412 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 635 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
@@ -473,6 +696,7 @@ static void __init omap3_evm_init(void) | |||
473 | usb_ehci_init(&ehci_pdata); | 696 | usb_ehci_init(&ehci_pdata); |
474 | ads7846_dev_init(); | 697 | ads7846_dev_init(); |
475 | omap3evm_init_smsc911x(); | 698 | omap3evm_init_smsc911x(); |
699 | omap3_evm_display_init(); | ||
476 | } | 700 | } |
477 | 701 | ||
478 | static void __init omap3_evm_map_io(void) | 702 | static void __init omap3_evm_map_io(void) |