diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 131 |
1 files changed, 129 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 795ffc461522..e2b912f376cc 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <plat/common.h> | 40 | #include <plat/common.h> |
41 | #include <plat/usb.h> | 41 | #include <plat/usb.h> |
42 | #include <plat/mmc.h> | 42 | #include <plat/mmc.h> |
43 | #include <plat/panel-generic-dpi.h> | ||
43 | #include "timer-gp.h" | 44 | #include "timer-gp.h" |
44 | 45 | ||
45 | #include "hsmmc.h" | 46 | #include "hsmmc.h" |
@@ -435,6 +436,17 @@ static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { | |||
435 | .platform_data = &omap4_panda_twldata, | 436 | .platform_data = &omap4_panda_twldata, |
436 | }, | 437 | }, |
437 | }; | 438 | }; |
439 | |||
440 | /* | ||
441 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM | ||
442 | * is connected as I2C slave device, and can be accessed at address 0x50 | ||
443 | */ | ||
444 | static struct i2c_board_info __initdata panda_i2c_eeprom[] = { | ||
445 | { | ||
446 | I2C_BOARD_INFO("eeprom", 0x50), | ||
447 | }, | ||
448 | }; | ||
449 | |||
438 | static int __init omap4_panda_i2c_init(void) | 450 | static int __init omap4_panda_i2c_init(void) |
439 | { | 451 | { |
440 | /* | 452 | /* |
@@ -444,7 +456,12 @@ static int __init omap4_panda_i2c_init(void) | |||
444 | omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, | 456 | omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, |
445 | ARRAY_SIZE(omap4_panda_i2c_boardinfo)); | 457 | ARRAY_SIZE(omap4_panda_i2c_boardinfo)); |
446 | omap_register_i2c_bus(2, 400, NULL, 0); | 458 | omap_register_i2c_bus(2, 400, NULL, 0); |
447 | omap_register_i2c_bus(3, 400, NULL, 0); | 459 | /* |
460 | * Bus 3 is attached to the DVI port where devices like the pico DLP | ||
461 | * projector don't work reliably with 400kHz | ||
462 | */ | ||
463 | omap_register_i2c_bus(3, 100, panda_i2c_eeprom, | ||
464 | ARRAY_SIZE(panda_i2c_eeprom)); | ||
448 | omap_register_i2c_bus(4, 400, NULL, 0); | 465 | omap_register_i2c_bus(4, 400, NULL, 0); |
449 | return 0; | 466 | return 0; |
450 | } | 467 | } |
@@ -464,12 +481,115 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
464 | OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | 481 | OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), |
465 | OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | 482 | OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), |
466 | OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | 483 | OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), |
484 | /* gpio 0 - TFP410 PD */ | ||
485 | OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3), | ||
486 | /* dispc2_data23 */ | ||
487 | OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
488 | /* dispc2_data22 */ | ||
489 | OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
490 | /* dispc2_data21 */ | ||
491 | OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
492 | /* dispc2_data20 */ | ||
493 | OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
494 | /* dispc2_data19 */ | ||
495 | OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
496 | /* dispc2_data18 */ | ||
497 | OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
498 | /* dispc2_data15 */ | ||
499 | OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
500 | /* dispc2_data14 */ | ||
501 | OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
502 | /* dispc2_data13 */ | ||
503 | OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
504 | /* dispc2_data12 */ | ||
505 | OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
506 | /* dispc2_data11 */ | ||
507 | OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
508 | /* dispc2_data10 */ | ||
509 | OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
510 | /* dispc2_data9 */ | ||
511 | OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
512 | /* dispc2_data16 */ | ||
513 | OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
514 | /* dispc2_data17 */ | ||
515 | OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
516 | /* dispc2_hsync */ | ||
517 | OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
518 | /* dispc2_pclk */ | ||
519 | OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
520 | /* dispc2_vsync */ | ||
521 | OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
522 | /* dispc2_de */ | ||
523 | OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
524 | /* dispc2_data8 */ | ||
525 | OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
526 | /* dispc2_data7 */ | ||
527 | OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
528 | /* dispc2_data6 */ | ||
529 | OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
530 | /* dispc2_data5 */ | ||
531 | OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
532 | /* dispc2_data4 */ | ||
533 | OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
534 | /* dispc2_data3 */ | ||
535 | OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
536 | /* dispc2_data2 */ | ||
537 | OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
538 | /* dispc2_data1 */ | ||
539 | OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
540 | /* dispc2_data0 */ | ||
541 | OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5), | ||
467 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 542 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
468 | }; | 543 | }; |
469 | #else | 544 | #else |
470 | #define board_mux NULL | 545 | #define board_mux NULL |
471 | #endif | 546 | #endif |
472 | 547 | ||
548 | /* Display DVI */ | ||
549 | #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0 | ||
550 | |||
551 | static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev) | ||
552 | { | ||
553 | gpio_set_value(dssdev->reset_gpio, 1); | ||
554 | return 0; | ||
555 | } | ||
556 | |||
557 | static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev) | ||
558 | { | ||
559 | gpio_set_value(dssdev->reset_gpio, 0); | ||
560 | } | ||
561 | |||
562 | /* Using generic display panel */ | ||
563 | static struct panel_generic_dpi_data omap4_dvi_panel = { | ||
564 | .name = "generic", | ||
565 | .platform_enable = omap4_panda_enable_dvi, | ||
566 | .platform_disable = omap4_panda_disable_dvi, | ||
567 | }; | ||
568 | |||
569 | struct omap_dss_device omap4_panda_dvi_device = { | ||
570 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
571 | .name = "dvi", | ||
572 | .driver_name = "generic_dpi_panel", | ||
573 | .data = &omap4_dvi_panel, | ||
574 | .phy.dpi.data_lines = 24, | ||
575 | .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, | ||
576 | .channel = OMAP_DSS_CHANNEL_LCD2, | ||
577 | }; | ||
578 | |||
579 | int __init omap4_panda_dvi_init(void) | ||
580 | { | ||
581 | int r; | ||
582 | |||
583 | /* Requesting TFP410 DVI GPIO and disabling it, at bootup */ | ||
584 | r = gpio_request_one(omap4_panda_dvi_device.reset_gpio, | ||
585 | GPIOF_OUT_INIT_LOW, "DVI PD"); | ||
586 | if (r) | ||
587 | pr_err("Failed to get DVI powerdown GPIO\n"); | ||
588 | |||
589 | return r; | ||
590 | } | ||
591 | |||
592 | |||
473 | static void omap4_panda_hdmi_mux_init(void) | 593 | static void omap4_panda_hdmi_mux_init(void) |
474 | { | 594 | { |
475 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ | 595 | /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ |
@@ -525,17 +645,24 @@ static struct omap_dss_device omap4_panda_hdmi_device = { | |||
525 | }; | 645 | }; |
526 | 646 | ||
527 | static struct omap_dss_device *omap4_panda_dss_devices[] = { | 647 | static struct omap_dss_device *omap4_panda_dss_devices[] = { |
648 | &omap4_panda_dvi_device, | ||
528 | &omap4_panda_hdmi_device, | 649 | &omap4_panda_hdmi_device, |
529 | }; | 650 | }; |
530 | 651 | ||
531 | static struct omap_dss_board_info omap4_panda_dss_data = { | 652 | static struct omap_dss_board_info omap4_panda_dss_data = { |
532 | .num_devices = ARRAY_SIZE(omap4_panda_dss_devices), | 653 | .num_devices = ARRAY_SIZE(omap4_panda_dss_devices), |
533 | .devices = omap4_panda_dss_devices, | 654 | .devices = omap4_panda_dss_devices, |
534 | .default_device = &omap4_panda_hdmi_device, | 655 | .default_device = &omap4_panda_dvi_device, |
535 | }; | 656 | }; |
536 | 657 | ||
537 | void omap4_panda_display_init(void) | 658 | void omap4_panda_display_init(void) |
538 | { | 659 | { |
660 | int r; | ||
661 | |||
662 | r = omap4_panda_dvi_init(); | ||
663 | if (r) | ||
664 | pr_err("error initializing panda DVI\n"); | ||
665 | |||
539 | omap4_panda_hdmi_mux_init(); | 666 | omap4_panda_hdmi_mux_init(); |
540 | omap_display_init(&omap4_panda_dss_data); | 667 | omap_display_init(&omap4_panda_dss_data); |
541 | } | 668 | } |