All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/8] mx6sabresd: use common board_video_skip
Date: Wed,  2 Apr 2014 21:57:45 +0200	[thread overview]
Message-ID: <1396468670-29774-3-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1396468670-29774-1-git-send-email-eric@eukrea.com>

Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 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 <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
 #include <asm/imx-common/boot_mode.h>
+#include <asm/imx-common/video.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <miiphy.h>
 #include <netdev.h>
 #include <asm/arch/mxc_hdmi.h>
 #include <asm/arch/crm_regs.h>
-#include <linux/fb.h>
-#include <ipu_pixfmt.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 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 */
-- 
1.9.0

  parent reply	other threads:[~2014-04-02 19:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 19:57 [U-Boot] [PATCH 1/8] imx-common: add board_video_skip Eric Bénard
2014-04-02 19:57 ` [U-Boot] [PATCH 2/8] nitrogen6x: use common board_video_skip Eric Bénard
2014-04-04  0:57   ` Eric Nelson
2014-04-02 19:57 ` Eric Bénard [this message]
2014-04-02 19:57 ` [U-Boot] [PATCH 4/8] RiOTboard and MarSBoard: add new boards support Eric Bénard
2014-04-04 10:12   ` Stefano Babic
2014-04-04 14:51     ` selsinork at gmail.com
2014-04-04 17:08       ` Eric Bénard
2014-04-02 19:57 ` [U-Boot] [PATCH 5/8] imx-common/video: add detect_hdmi Eric Bénard
2014-04-02 19:57 ` [U-Boot] [PATCH 6/8] nitrogen6x: use common detect_hdmi Eric Bénard
2014-04-04  0:47   ` Eric Nelson
2014-04-02 19:57 ` [U-Boot] [PATCH 7/8] mx6sabresd: " Eric Bénard
2014-04-02 19:57 ` [U-Boot] [PATCH 8/8] embest/mx6boards: " Eric Bénard
2014-04-04 10:05 ` [U-Boot] [PATCH 1/8] imx-common: add board_video_skip Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396468670-29774-3-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.