1 // SPDX-License-Identifier: GPL-2.0+
4 #include <linux/errno.h>
5 #include <asm/mach-imx/video.h>
8 #include <asm/arch/mxc_hdmi.h>
11 int detect_hdmi(struct display_info_t const *dev)
13 struct hdmi_regs *hdmi = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
14 return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
18 int board_video_skip(void)
22 char const *panel = env_get("panel");
25 for (i = 0; i < display_count; i++) {
26 struct display_info_t const *dev = displays+i;
27 if (dev->detect && dev->detect(dev)) {
28 panel = dev->mode.name;
29 printf("auto-detected panel %s\n", panel);
34 panel = displays[0].mode.name;
35 printf("No panel detected: default to %s\n", panel);
39 for (i = 0; i < display_count; i++) {
40 if (!strcmp(panel, displays[i].mode.name))
45 if (i < display_count) {
46 ret = ipuv3_fb_init(&displays[i].mode, displays[i].di ? 1 : 0,
49 if (displays[i].enable)
50 displays[i].enable(displays + i);
52 printf("Display: %s (%ux%u)\n",
53 displays[i].mode.name,
54 displays[i].mode.xres,
55 displays[i].mode.yres);
57 #ifdef CONFIG_IMX_HDMI
58 if (!strcmp(displays[i].mode.name, "HDMI"))
59 imx_enable_hdmi_phy();
62 printf("LCD %s cannot be configured: %d\n",
63 displays[i].mode.name, ret);
65 printf("unsupported panel %s\n", panel);
72 int ipu_displays_init(void)
74 return board_video_skip();