video: Moving mx3fb.c to CONFIG_VIDEO
[platform/kernel/u-boot.git] / drivers / video / cfb_console.c
index 917bba6..4e653b8 100644 (file)
 #endif
 
 /*
+ * Defines for the i.MX31 driver (mx3fb.c)
+ */
+#ifdef CONFIG_VIDEO_MX3
+#define VIDEO_FB_16BPP_WORD_SWAP
+#endif
+
+/*
  * Include video_fb.h after definitions of VIDEO_HW_RECTFILL etc.
  */
 #include <video_fb.h>
@@ -348,13 +355,6 @@ void console_cursor(int state);
 #endif
 #endif
 
-#if defined(DEBUG) || defined(DEBUG_CFB_CONSOLE)
-#define PRINTD(x)              printf(x)
-#else
-#define PRINTD(x)
-#endif
-
-
 #ifdef CONFIG_CONSOLE_EXTRA_INFO
 /*
  * setup a board string: type, speed, etc.
@@ -373,8 +373,8 @@ static void *video_console_address; /* console buffer start address */
 
 static int video_logo_height = VIDEO_LOGO_HEIGHT;
 
-static int console_col = 0;    /* cursor col */
-static int console_row = 0;    /* cursor row */
+static int console_col;                /* cursor col */
+static int console_row;                /* cursor row */
 
 static u32 eorx, fgx, bgx;     /* color pats */
 
@@ -1566,18 +1566,21 @@ static void *video_logo(void)
        char *s;
        ulong addr;
 
-       if ((s = getenv("splashimage")) != NULL) {
+       s = getenv("splashimage");
+       if (s != NULL) {
                int x = 0, y = 0;
 
                addr = simple_strtoul(s, NULL, 16);
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
-               if ((s = getenv("splashpos")) != NULL) {
+               s = getenv("splashpos");
+               if (s != NULL) {
                        if (s[0] == 'm')
                                x = BMP_ALIGN_CENTER;
                        else
                                x = simple_strtol(s, NULL, 0);
 
-                       if ((s = strchr(s + 1, ',')) != NULL) {
+                       s = strchr(s + 1, ',');
+                       if (s != NULL) {
                                if (s[1] == 'm')
                                        y = BMP_ALIGN_CENTER;
                                else
@@ -1655,7 +1658,8 @@ static int video_init(void)
 {
        unsigned char color8;
 
-       if ((pGD = video_hw_init()) == NULL)
+       pGD = video_hw_init();
+       if (pGD == NULL)
                return -1;
 
        video_fb_address = (void *) VIDEO_FB_ADRS;
@@ -1736,7 +1740,7 @@ static int video_init(void)
 
 #ifdef CONFIG_VIDEO_LOGO
        /* Plot the logo and get start point of console */
-       PRINTD("Video: Drawing the logo ...\n");
+       debug("Video: Drawing the logo ...\n");
        video_console_address = video_logo();
 #else
        video_console_address = video_fb_address;
@@ -1775,7 +1779,7 @@ int drv_video_init(void)
        skip_dev_init = (video_init() == -1);
 
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
-       PRINTD("KBD: Keyboard init ...\n");
+       debug("KBD: Keyboard init ...\n");
        skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);
 #endif