ARM: dts: imx6qdl-sr-som: Sync with kernel 5.8-rc1
[oweals/u-boot.git] / drivers / video / vidconsole-uclass.c
index c690eceeaa7f7b70205dc1efdb77756ce0f9f178..d30e6db6f6fe63389029b55769a2c546b4fae5d0 100644 (file)
@@ -8,6 +8,8 @@
  */
 
 #include <common.h>
+#include <command.h>
+#include <log.h>
 #include <linux/ctype.h>
 #include <dm.h>
 #include <video.h>
@@ -116,7 +118,6 @@ static void vidconsole_newline(struct udevice *dev)
        video_sync(dev->parent, false);
 }
 
-#if CONFIG_IS_ENABLED(VIDEO_BPP16) || CONFIG_IS_ENABLED(VIDEO_BPP32)
 static const struct vid_rgb colors[VID_COLOR_COUNT] = {
        { 0x00, 0x00, 0x00 },  /* black */
        { 0xc0, 0x00, 0x00 },  /* red */
@@ -135,33 +136,36 @@ static const struct vid_rgb colors[VID_COLOR_COUNT] = {
        { 0x00, 0xff, 0xff },  /* bright cyan */
        { 0xff, 0xff, 0xff },  /* white */
 };
-#endif
 
 u32 vid_console_color(struct video_priv *priv, unsigned int idx)
 {
        switch (priv->bpix) {
-#if CONFIG_IS_ENABLED(VIDEO_BPP16)
        case VIDEO_BPP16:
-               return ((colors[idx].r >> 3) << 11) |
-                      ((colors[idx].g >> 2) <<  5) |
-                      ((colors[idx].b >> 3) <<  0);
-#endif
-#if CONFIG_IS_ENABLED(VIDEO_BPP32)
+               if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
+                       return ((colors[idx].r >> 3) << 11) |
+                              ((colors[idx].g >> 2) <<  5) |
+                              ((colors[idx].b >> 3) <<  0);
+               }
+               break;
        case VIDEO_BPP32:
-               return (colors[idx].r << 16) |
-                      (colors[idx].g <<  8) |
-                      (colors[idx].b <<  0);
-#endif
+               if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
+                       return (colors[idx].r << 16) |
+                              (colors[idx].g <<  8) |
+                              (colors[idx].b <<  0);
+               }
+               break;
        default:
-               /*
-                * For unknown bit arrangements just support
-                * black and white.
-                */
-               if (idx)
-                       return 0xffffff; /* white */
-               else
-                       return 0x000000; /* black */
+               break;
        }
+
+       /*
+        * For unknown bit arrangements just support
+        * black and white.
+        */
+       if (idx)
+               return 0xffffff; /* white */
+
+       return 0x000000; /* black */
 }
 
 static char *parsenum(char *s, int *num)
@@ -621,7 +625,7 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
        priv->ycur = min_t(short, row, vid_priv->ysize - 1);
 }
 
-static int do_video_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_video_setcursor(struct cmd_tbl *cmdtp, int flag, int argc,
                              char *const argv[])
 {
        unsigned int col, row;
@@ -639,7 +643,7 @@ static int do_video_setcursor(cmd_tbl_t *cmdtp, int flag, int argc,
        return 0;
 }
 
-static int do_video_puts(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc,
                         char *const argv[])
 {
        struct udevice *dev;