From: Eric Benard Date: Fri, 4 Apr 2014 17:05:56 +0000 (+0200) Subject: imx-common/video: add detect_hdmi X-Git-Tag: v2014.07-rc2~9^2~3^2~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e688a99c07337738dba9fb22a05b9d33eaac597c;p=u-boot imx-common/video: add detect_hdmi this function is used by several board together with board_video_skip to detect if hdmi is plugged is order to select the display to use. So move it in imx-common to share it. Signed-off-by: Eric BĂ©nard --- diff --git a/arch/arm/imx-common/video.c b/arch/arm/imx-common/video.c index 098239a716..0121cd78f2 100644 --- a/arch/arm/imx-common/video.c +++ b/arch/arm/imx-common/video.c @@ -53,3 +53,13 @@ int board_video_skip(void) return 0; } + +#ifdef CONFIG_IMX_HDMI +#include +#include +int detect_hdmi(struct display_info_t const *dev) +{ + struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR; + return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT; +} +#endif diff --git a/arch/arm/include/asm/imx-common/video.h b/arch/arm/include/asm/imx-common/video.h index e0c4ef4508..2d948508d5 100644 --- a/arch/arm/include/asm/imx-common/video.h +++ b/arch/arm/include/asm/imx-common/video.h @@ -17,4 +17,8 @@ struct display_info_t { struct fb_videomode mode; }; +#ifdef CONFIG_IMX_HDMI +extern int detect_hdmi(struct display_info_t const *dev); +#endif + #endif