From patchwork Wed Apr 2 19:57:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Benard X-Patchwork-Id: 336457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B95AF140121 for ; Thu, 3 Apr 2014 06:58:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 240B04BA7A; Wed, 2 Apr 2014 21:58:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FRYDsVUwN285; Wed, 2 Apr 2014 21:58:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DBDF44BAAD; Wed, 2 Apr 2014 21:58:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E81BD4BAA2 for ; Wed, 2 Apr 2014 21:58:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jWzfnLp+fxX3 for ; Wed, 2 Apr 2014 21:58:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by theia.denx.de (Postfix) with ESMTP id 2D8064BA8E for ; Wed, 2 Apr 2014 21:58:06 +0200 (CEST) Received: from localhost.localdomain (unknown [82.233.81.124]) by smtp3-g21.free.fr (Postfix) with ESMTP id 8B9C3A623A; Wed, 2 Apr 2014 21:58:01 +0200 (CEST) From: =?UTF-8?q?Eric=20B=C3=A9nard?= To: sbabic@denx.de Date: Wed, 2 Apr 2014 21:57:45 +0200 Message-Id: <1396468670-29774-3-git-send-email-eric@eukrea.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396468670-29774-1-git-send-email-eric@eukrea.com> References: <1396468670-29774-1-git-send-email-eric@eukrea.com> MIME-Version: 1.0 Cc: Fabio Estevam , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/8] mx6sabresd: use common board_video_skip X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Eric BĂ©nard Cc: Fabio Estevam --- board/freescale/mx6sabresd/mx6sabresd.c | 59 ++------------------------------- include/configs/mx6sabresd.h | 1 + 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 12d8c56..d54d5db 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -14,14 +14,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include -#include #include #include DECLARE_GLOBAL_DATA_PTR; @@ -255,14 +254,6 @@ int board_phy_config(struct phy_device *phydev) } #if defined(CONFIG_VIDEO_IPUV3) -struct display_info_t { - int bus; - int addr; - int pixfmt; - int (*detect)(struct display_info_t const *dev); - void (*enable)(struct display_info_t const *dev); - struct fb_videomode mode; -}; static int detect_hdmi(struct display_info_t const *dev) { @@ -299,7 +290,7 @@ static void enable_lvds(struct display_info_t const *dev) writel(reg, &iomux->gpr[2]); } -static struct display_info_t const displays[] = {{ +struct display_info_t const displays[] = {{ .bus = -1, .addr = 0, .pixfmt = IPU_PIX_FMT_RGB666, @@ -340,51 +331,7 @@ static struct display_info_t const displays[] = {{ .sync = FB_SYNC_EXT, .vmode = FB_VMODE_NONINTERLACED } } }; - -int board_video_skip(void) -{ - int i; - int ret; - char const *panel = getenv("panel"); - if (!panel) { - for (i = 0; i < ARRAY_SIZE(displays); i++) { - struct display_info_t const *dev = displays+i; - if (dev->detect && dev->detect(dev)) { - panel = dev->mode.name; - printf("auto-detected panel %s\n", panel); - break; - } - } - if (!panel) { - panel = displays[0].mode.name; - printf("No panel detected: default to %s\n", panel); - i = 0; - } - } else { - for (i = 0; i < ARRAY_SIZE(displays); i++) { - if (!strcmp(panel, displays[i].mode.name)) - break; - } - } - if (i < ARRAY_SIZE(displays)) { - ret = ipuv3_fb_init(&displays[i].mode, 0, - displays[i].pixfmt); - if (!ret) { - displays[i].enable(displays+i); - printf("Display: %s (%ux%u)\n", - displays[i].mode.name, - displays[i].mode.xres, - displays[i].mode.yres); - } else - printf("LCD %s cannot be configured: %d\n", - displays[i].mode.name, ret); - } else { - printf("unsupported panel %s\n", panel); - return -EINVAL; - } - - return 0; -} +size_t display_number = ARRAY_SIZE(displays); static void setup_display(void) { diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h index 4919f53..72ae024 100644 --- a/include/configs/mx6sabresd.h +++ b/include/configs/mx6sabresd.h @@ -47,5 +47,6 @@ #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IPUV3_CLK 260000000 #define CONFIG_IMX_HDMI +#define CONFIG_IMX_VIDEO_SKIP #endif /* __MX6QSABRESD_CONFIG_H */