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 <eric@eukrea.com>
This commit is contained in:
Eric Benard 2014-04-04 19:05:56 +02:00 committed by Stefano Babic
parent 3cbeb0f004
commit e688a99c07
2 changed files with 14 additions and 0 deletions

View 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

View 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