patman: Convert camel case in checkpatch.py
[platform/kernel/u-boot.git] / common / fdt_simplefb.c
index 1650615..c52846f 100644 (file)
@@ -16,7 +16,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int lcd_dt_simplefb_configure_node(void *blob, int off)
+static int fdt_simplefb_configure_node(void *blob, int off)
 {
        int xsize, ysize;
        int bpix; /* log2 of bits per pixel */
@@ -58,7 +58,7 @@ static int lcd_dt_simplefb_configure_node(void *blob, int off)
                                       xsize * (1 << bpix) / 8, name);
 }
 
-int lcd_dt_simplefb_add_node(void *blob)
+int fdt_simplefb_add_node(void *blob)
 {
        static const char compat[] = "simple-framebuffer";
        static const char disabled[] = "disabled";
@@ -76,10 +76,10 @@ int lcd_dt_simplefb_add_node(void *blob)
        if (ret < 0)
                return -1;
 
-       return lcd_dt_simplefb_configure_node(blob, off);
+       return fdt_simplefb_configure_node(blob, off);
 }
 
-int lcd_dt_simplefb_enable_existing_node(void *blob)
+int fdt_simplefb_enable_existing_node(void *blob)
 {
        int off;
 
@@ -87,5 +87,32 @@ int lcd_dt_simplefb_enable_existing_node(void *blob)
        if (off < 0)
                return -1;
 
-       return lcd_dt_simplefb_configure_node(blob, off);
+       return fdt_simplefb_configure_node(blob, off);
 }
+
+#if CONFIG_IS_ENABLED(DM_VIDEO)
+int fdt_simplefb_enable_and_mem_rsv(void *blob)
+{
+       struct fdt_memory mem;
+       int ret;
+
+       /* nothing to do when video is not active */
+       if (!video_is_active())
+               return 0;
+
+       ret = fdt_simplefb_enable_existing_node(blob);
+       if (ret)
+               return ret;
+
+       /* nothing to do when the frame buffer is not defined */
+       if (gd->video_bottom == gd->video_top)
+               return 0;
+
+       /* reserved with no-map tag the video buffer */
+       mem.start = gd->video_bottom;
+       mem.end = gd->video_top - 1;
+
+       return fdtdec_add_reserved_memory(blob, "framebuffer", &mem, NULL, 0, NULL,
+                                         FDTDEC_RESERVED_MEMORY_NO_MAP);
+}
+#endif