Skip to content

Commit b295d6e

Browse files
Murthy, Raghuveertomba
Murthy, Raghuveer
authored andcommitted
OMAP4: PandaBoard: Adding DVI support
Adding DVI support to OMAP4 PandaBoard. PandaBoard uses TFP410 DVI Framer chip http://focus.ti.com/lit/ds/symlink/tfp410.pdf The TFP410 gets its power enable and display data over GPIO lines muxed in from OMAP4430. PandaBoard supports other LCD displays through expansion connectors, following board rework. This will disable the DVI interface. However, the existing mux settings remain the same PandaBoard additionally supports display over HDMI interface. It is mutually exclusive to display over DVI. Hence the mux settings need to be configured seperately, as and when HDMI is enabled Also, I2C3 bus used for reading EDID data from DVI Monitors is registered here. Since the design is similar to BeagleBoard, the code for the same is taken from the kernel.org commit e3333f4 (omap: Adding beagle i2c eeprom driver to read EDID) Reviewed-by: Manjunath G Kondaiah <[email protected]> Reviewed-by: Anand Gadiyar <[email protected]> Reviewed-by: Nishanth Menon <[email protected]> Reviewed-by: Sumit Semwal <[email protected]> Signed-off-by: Raghuveer Murthy <[email protected]> [[email protected]: fixed conflicts with HDMI] Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent 2de1108 commit b295d6e

File tree

1 file changed

+129
-2
lines changed

1 file changed

+129
-2
lines changed

arch/arm/mach-omap2/board-omap4panda.c

+129-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <plat/common.h>
4141
#include <plat/usb.h>
4242
#include <plat/mmc.h>
43+
#include <plat/panel-generic-dpi.h>
4344
#include "timer-gp.h"
4445

4546
#include "hsmmc.h"
@@ -435,6 +436,17 @@ static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
435436
.platform_data = &omap4_panda_twldata,
436437
},
437438
};
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+
438450
static int __init omap4_panda_i2c_init(void)
439451
{
440452
/*
@@ -444,7 +456,12 @@ static int __init omap4_panda_i2c_init(void)
444456
omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
445457
ARRAY_SIZE(omap4_panda_i2c_boardinfo));
446458
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));
448465
omap_register_i2c_bus(4, 400, NULL, 0);
449466
return 0;
450467
}
@@ -464,12 +481,115 @@ static struct omap_board_mux board_mux[] __initdata = {
464481
OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
465482
OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
466483
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),
467542
{ .reg_offset = OMAP_MUX_TERMINATOR },
468543
};
469544
#else
470545
#define board_mux NULL
471546
#endif
472547

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+
473593
static void omap4_panda_hdmi_mux_init(void)
474594
{
475595
/* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
@@ -525,17 +645,24 @@ static struct omap_dss_device omap4_panda_hdmi_device = {
525645
};
526646

527647
static struct omap_dss_device *omap4_panda_dss_devices[] = {
648+
&omap4_panda_dvi_device,
528649
&omap4_panda_hdmi_device,
529650
};
530651

531652
static struct omap_dss_board_info omap4_panda_dss_data = {
532653
.num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
533654
.devices = omap4_panda_dss_devices,
534-
.default_device = &omap4_panda_hdmi_device,
655+
.default_device = &omap4_panda_dvi_device,
535656
};
536657

537658
void omap4_panda_display_init(void)
538659
{
660+
int r;
661+
662+
r = omap4_panda_dvi_init();
663+
if (r)
664+
pr_err("error initializing panda DVI\n");
665+
539666
omap4_panda_hdmi_mux_init();
540667
omap_display_init(&omap4_panda_dss_data);
541668
}

0 commit comments

Comments
 (0)