1 // SPDX-License-Identifier: GPL-2.0+
5 #include <linux/errno.h>
6 #include <asm/mach-imx/video.h>
9 #include <asm/arch/mxc_hdmi.h>
12 int detect_hdmi(struct display_info_t const *dev)
14 struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
15 return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
19 int board_video_skip(void)
23 char const *panel = env_get("panel");
26 for (i = 0; i < display_count; i++) {
27 struct display_info_t const *dev = displays+i;
28 if (dev->detect && dev->detect(dev)) {
29 panel = dev->mode.name;
30 printf("auto-detected panel %s\n", panel);
35 panel = displays[0].mode.name;
36 printf("No panel detected: default to %s\n", panel);
40 for (i = 0; i < display_count; i++) {
41 if (!strcmp(panel, displays[i].mode.name))
46 if (i < display_count) {
47 ret = ipuv3_fb_init(&displays[i].mode, displays[i].di ? 1 : 0,
50 if (displays[i].enable)
51 displays[i].enable(displays + i);
53 printf("Display: %s (%ux%u)\n",
54 displays[i].mode.name,
55 displays[i].mode.xres,
56 displays[i].mode.yres);
58 #ifdef CONFIG_IMX_HDMI
59 if (!strcmp(displays[i].mode.name, "HDMI"))
60 imx_enable_hdmi_phy();
63 printf("LCD %s cannot be configured: %d\n",
64 displays[i].mode.name, ret);
66 printf("unsupported panel %s\n", panel);
73 int ipu_displays_init(void)
75 return board_video_skip();