aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-omap4panda.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-03-22 01:27:36 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-03-22 01:27:36 -0400
commitda49252fb0392d8196833ef3da92e48fb371f8d7 (patch)
tree1299899f7513a900b2229b8cde289bca8c41d2f5 /arch/arm/mach-omap2/board-omap4panda.c
parenteddecbb601c9ea3fab7e67d7892010fc9426d1e6 (diff)
parentb295d6e593e02168fdafc5db11464b6d51cf239d (diff)
Merge branch 'for-paul' of git://gitorious.org/linux-omap-dss2/linux
Conflicts: arch/arm/mach-omap2/board-overo.c Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c203
1 files changed, 202 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 0f4d8a762a70..209cffbee4e0 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -34,11 +34,13 @@
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <plat/display.h>
37 38
38#include <plat/board.h> 39#include <plat/board.h>
39#include <plat/common.h> 40#include <plat/common.h>
40#include <plat/usb.h> 41#include <plat/usb.h>
41#include <plat/mmc.h> 42#include <plat/mmc.h>
43#include <plat/panel-generic-dpi.h>
42#include "timer-gp.h" 44#include "timer-gp.h"
43 45
44#include "hsmmc.h" 46#include "hsmmc.h"
@@ -49,6 +51,8 @@
49#define GPIO_HUB_NRESET 62 51#define GPIO_HUB_NRESET 62
50#define GPIO_WIFI_PMENA 43 52#define GPIO_WIFI_PMENA 43
51#define GPIO_WIFI_IRQ 53 53#define GPIO_WIFI_IRQ 53
54#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
55#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
52 56
53/* wl127x BT, FM, GPS connectivity chip */ 57/* wl127x BT, FM, GPS connectivity chip */
54static int wl1271_gpios[] = {46, -1, -1}; 58static int wl1271_gpios[] = {46, -1, -1};
@@ -433,6 +437,17 @@ static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
433 .platform_data = &omap4_panda_twldata, 437 .platform_data = &omap4_panda_twldata,
434 }, 438 },
435}; 439};
440
441/*
442 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
443 * is connected as I2C slave device, and can be accessed at address 0x50
444 */
445static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
446 {
447 I2C_BOARD_INFO("eeprom", 0x50),
448 },
449};
450
436static int __init omap4_panda_i2c_init(void) 451static int __init omap4_panda_i2c_init(void)
437{ 452{
438 /* 453 /*
@@ -442,7 +457,12 @@ static int __init omap4_panda_i2c_init(void)
442 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, 457 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
443 ARRAY_SIZE(omap4_panda_i2c_boardinfo)); 458 ARRAY_SIZE(omap4_panda_i2c_boardinfo));
444 omap_register_i2c_bus(2, 400, NULL, 0); 459 omap_register_i2c_bus(2, 400, NULL, 0);
445 omap_register_i2c_bus(3, 400, NULL, 0); 460 /*
461 * Bus 3 is attached to the DVI port where devices like the pico DLP
462 * projector don't work reliably with 400kHz
463 */
464 omap_register_i2c_bus(3, 100, panda_i2c_eeprom,
465 ARRAY_SIZE(panda_i2c_eeprom));
446 omap_register_i2c_bus(4, 400, NULL, 0); 466 omap_register_i2c_bus(4, 400, NULL, 0);
447 return 0; 467 return 0;
448} 468}
@@ -462,6 +482,64 @@ static struct omap_board_mux board_mux[] __initdata = {
462 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), 482 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
463 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), 483 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
464 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), 484 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
485 /* gpio 0 - TFP410 PD */
486 OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3),
487 /* dispc2_data23 */
488 OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
489 /* dispc2_data22 */
490 OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
491 /* dispc2_data21 */
492 OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
493 /* dispc2_data20 */
494 OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
495 /* dispc2_data19 */
496 OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
497 /* dispc2_data18 */
498 OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
499 /* dispc2_data15 */
500 OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
501 /* dispc2_data14 */
502 OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
503 /* dispc2_data13 */
504 OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
505 /* dispc2_data12 */
506 OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
507 /* dispc2_data11 */
508 OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
509 /* dispc2_data10 */
510 OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
511 /* dispc2_data9 */
512 OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
513 /* dispc2_data16 */
514 OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
515 /* dispc2_data17 */
516 OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
517 /* dispc2_hsync */
518 OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
519 /* dispc2_pclk */
520 OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
521 /* dispc2_vsync */
522 OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
523 /* dispc2_de */
524 OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
525 /* dispc2_data8 */
526 OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
527 /* dispc2_data7 */
528 OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
529 /* dispc2_data6 */
530 OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
531 /* dispc2_data5 */
532 OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
533 /* dispc2_data4 */
534 OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
535 /* dispc2_data3 */
536 OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
537 /* dispc2_data2 */
538 OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
539 /* dispc2_data1 */
540 OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
541 /* dispc2_data0 */
542 OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
465 { .reg_offset = OMAP_MUX_TERMINATOR }, 543 { .reg_offset = OMAP_MUX_TERMINATOR },
466}; 544};
467 545
@@ -535,6 +613,128 @@ static inline void board_serial_init(void)
535} 613}
536#endif 614#endif
537 615
616/* Display DVI */
617#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
618
619static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
620{
621 gpio_set_value(dssdev->reset_gpio, 1);
622 return 0;
623}
624
625static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
626{
627 gpio_set_value(dssdev->reset_gpio, 0);
628}
629
630/* Using generic display panel */
631static struct panel_generic_dpi_data omap4_dvi_panel = {
632 .name = "generic",
633 .platform_enable = omap4_panda_enable_dvi,
634 .platform_disable = omap4_panda_disable_dvi,
635};
636
637struct omap_dss_device omap4_panda_dvi_device = {
638 .type = OMAP_DISPLAY_TYPE_DPI,
639 .name = "dvi",
640 .driver_name = "generic_dpi_panel",
641 .data = &omap4_dvi_panel,
642 .phy.dpi.data_lines = 24,
643 .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
644 .channel = OMAP_DSS_CHANNEL_LCD2,
645};
646
647int __init omap4_panda_dvi_init(void)
648{
649 int r;
650
651 /* Requesting TFP410 DVI GPIO and disabling it, at bootup */
652 r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
653 GPIOF_OUT_INIT_LOW, "DVI PD");
654 if (r)
655 pr_err("Failed to get DVI powerdown GPIO\n");
656
657 return r;
658}
659
660
661static void omap4_panda_hdmi_mux_init(void)
662{
663 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
664 omap_mux_init_signal("hdmi_hpd",
665 OMAP_PIN_INPUT_PULLUP);
666 omap_mux_init_signal("hdmi_cec",
667 OMAP_PIN_INPUT_PULLUP);
668 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
669 omap_mux_init_signal("hdmi_ddc_scl",
670 OMAP_PIN_INPUT_PULLUP);
671 omap_mux_init_signal("hdmi_ddc_sda",
672 OMAP_PIN_INPUT_PULLUP);
673}
674
675static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
676{
677 int status;
678
679 status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
680 "hdmi_gpio_hpd");
681 if (status) {
682 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
683 return status;
684 }
685 status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
686 "hdmi_gpio_ls_oe");
687 if (status) {
688 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
689 goto error1;
690 }
691
692 return 0;
693
694error1:
695 gpio_free(HDMI_GPIO_HPD);
696
697 return status;
698}
699
700static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
701{
702 gpio_free(HDMI_GPIO_LS_OE);
703 gpio_free(HDMI_GPIO_HPD);
704}
705
706static struct omap_dss_device omap4_panda_hdmi_device = {
707 .name = "hdmi",
708 .driver_name = "hdmi_panel",
709 .type = OMAP_DISPLAY_TYPE_HDMI,
710 .platform_enable = omap4_panda_panel_enable_hdmi,
711 .platform_disable = omap4_panda_panel_disable_hdmi,
712 .channel = OMAP_DSS_CHANNEL_DIGIT,
713};
714
715static struct omap_dss_device *omap4_panda_dss_devices[] = {
716 &omap4_panda_dvi_device,
717 &omap4_panda_hdmi_device,
718};
719
720static struct omap_dss_board_info omap4_panda_dss_data = {
721 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
722 .devices = omap4_panda_dss_devices,
723 .default_device = &omap4_panda_dvi_device,
724};
725
726void omap4_panda_display_init(void)
727{
728 int r;
729
730 r = omap4_panda_dvi_init();
731 if (r)
732 pr_err("error initializing panda DVI\n");
733
734 omap4_panda_hdmi_mux_init();
735 omap_display_init(&omap4_panda_dss_data);
736}
737
538static void __init omap4_panda_init(void) 738static void __init omap4_panda_init(void)
539{ 739{
540 int package = OMAP_PACKAGE_CBS; 740 int package = OMAP_PACKAGE_CBS;
@@ -553,6 +753,7 @@ static void __init omap4_panda_init(void)
553 omap4_twl6030_hsmmc_init(mmc); 753 omap4_twl6030_hsmmc_init(mmc);
554 omap4_ehci_init(); 754 omap4_ehci_init();
555 usb_musb_init(&musb_board_data); 755 usb_musb_init(&musb_board_data);
756 omap4_panda_display_init();
556} 757}
557 758
558static void __init omap4_panda_map_io(void) 759static void __init omap4_panda_map_io(void)