Skip to content

Commit 17c84ef

Browse files
K, Mythri Ptomba
K, Mythri P
authored andcommitted
OMAP4: HDMI: Add HDMI structure in the board file for OMAP4 PANDA
Adding board file structure for display which adds the display structure with HDMI as the default driver when the display init is called. HDMI GPIO configurations are also done in this file. Signed-off-by: Mythri P K <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent 0425b48 commit 17c84ef

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

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

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <asm/mach-types.h>
3535
#include <asm/mach/arch.h>
3636
#include <asm/mach/map.h>
37+
#include <plat/display.h>
3738

3839
#include <plat/board.h>
3940
#include <plat/common.h>
@@ -49,6 +50,8 @@
4950
#define GPIO_HUB_NRESET 62
5051
#define GPIO_WIFI_PMENA 43
5152
#define GPIO_WIFI_IRQ 53
53+
#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
54+
#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
5255

5356
/* wl127x BT, FM, GPS connectivity chip */
5457
static int wl1271_gpios[] = {46, -1, -1};
@@ -467,6 +470,76 @@ static struct omap_board_mux board_mux[] __initdata = {
467470
#define board_mux NULL
468471
#endif
469472

473+
static void omap4_panda_hdmi_mux_init(void)
474+
{
475+
/* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
476+
omap_mux_init_signal("hdmi_hpd",
477+
OMAP_PIN_INPUT_PULLUP);
478+
omap_mux_init_signal("hdmi_cec",
479+
OMAP_PIN_INPUT_PULLUP);
480+
/* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
481+
omap_mux_init_signal("hdmi_ddc_scl",
482+
OMAP_PIN_INPUT_PULLUP);
483+
omap_mux_init_signal("hdmi_ddc_sda",
484+
OMAP_PIN_INPUT_PULLUP);
485+
}
486+
487+
static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
488+
{
489+
int status;
490+
491+
status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
492+
"hdmi_gpio_hpd");
493+
if (status) {
494+
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
495+
return status;
496+
}
497+
status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
498+
"hdmi_gpio_ls_oe");
499+
if (status) {
500+
pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
501+
goto error1;
502+
}
503+
504+
return 0;
505+
506+
error1:
507+
gpio_free(HDMI_GPIO_HPD);
508+
509+
return status;
510+
}
511+
512+
static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
513+
{
514+
gpio_free(HDMI_GPIO_LS_OE);
515+
gpio_free(HDMI_GPIO_HPD);
516+
}
517+
518+
static struct omap_dss_device omap4_panda_hdmi_device = {
519+
.name = "hdmi",
520+
.driver_name = "hdmi_panel",
521+
.type = OMAP_DISPLAY_TYPE_HDMI,
522+
.platform_enable = omap4_panda_panel_enable_hdmi,
523+
.platform_disable = omap4_panda_panel_disable_hdmi,
524+
.channel = OMAP_DSS_CHANNEL_DIGIT,
525+
};
526+
527+
static struct omap_dss_device *omap4_panda_dss_devices[] = {
528+
&omap4_panda_hdmi_device,
529+
};
530+
531+
static struct omap_dss_board_info omap4_panda_dss_data = {
532+
.num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
533+
.devices = omap4_panda_dss_devices,
534+
.default_device = &omap4_panda_hdmi_device,
535+
};
536+
537+
void omap4_panda_display_init(void)
538+
{
539+
omap4_panda_hdmi_mux_init();
540+
omap_display_init(&omap4_panda_dss_data);
541+
}
542+
470543
static void __init omap4_panda_init(void)
471544
{
472545
int package = OMAP_PACKAGE_CBS;
@@ -485,6 +558,7 @@ static void __init omap4_panda_init(void)
485558
omap4_twl6030_hsmmc_init(mmc);
486559
omap4_ehci_init();
487560
usb_musb_init(&musb_board_data);
561+
omap4_panda_display_init();
488562
}
489563

490564
static void __init omap4_panda_map_io(void)

0 commit comments

Comments
 (0)