]> git.sur5r.net Git - u-boot/commitdiff
imx-common/video: add detect_hdmi
authorEric Benard <eric@eukrea.com>
Fri, 4 Apr 2014 17:05:56 +0000 (19:05 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 15 Apr 2014 10:23:57 +0000 (12:23 +0200)
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 <eric@eukrea.com>
arch/arm/imx-common/video.c
arch/arm/include/asm/imx-common/video.h

index 098239a7165d9f568a52b52941353c752c5618b8..0121cd78f27694629b49f50890642a0500a3d27e 100644 (file)
@@ -53,3 +53,13 @@ int board_video_skip(void)
 
        return 0;
 }
+
+#ifdef CONFIG_IMX_HDMI
+#include <asm/arch/mxc_hdmi.h>
+#include <asm/io.h>
+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
index e0c4ef450835e023060e49efe2f1e66b4264e193..2d948508d574f51f18d4f0071d159874083f05e9 100644 (file)
@@ -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