summaryrefslogtreecommitdiff
path: root/common/lcd.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-11-25 11:09:48 -0500
committerTom Rini <trini@ti.com>2014-11-26 11:21:16 -0500
commitf2ffe7da7fcc266f8c9cb557031066cfd5eb2a03 (patch)
treeea83bd3054c5360223d53cf79cc3088e90a52d5a /common/lcd.c
parent1fc4e6f486cc1e9d2dcf0ba86e6021c3d83dce51 (diff)
parentb366fb92c3d118f97bb0f01fa9c40d253e70e12c (diff)
downloadu-boot-imx-f2ffe7da7fcc266f8c9cb557031066cfd5eb2a03.zip
u-boot-imx-f2ffe7da7fcc266f8c9cb557031066cfd5eb2a03.tar.gz
u-boot-imx-f2ffe7da7fcc266f8c9cb557031066cfd5eb2a03.tar.bz2
Merge branch 'master' of http://git.denx.de/u-boot-sunxi
Diffstat (limited to 'common/lcd.c')
-rw-r--r--common/lcd.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/common/lcd.c b/common/lcd.c
index d8e1371..28b3fe7 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -30,6 +30,7 @@
#include <splash.h>
#include <asm/io.h>
#include <asm/unaligned.h>
+#include <fdt_support.h>
#if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
defined(CONFIG_CPU_MONAHANS)
@@ -1172,51 +1173,13 @@ int lcd_get_screen_columns(void)
#if defined(CONFIG_LCD_DT_SIMPLEFB)
static int lcd_dt_simplefb_configure_node(void *blob, int off)
{
- u32 stride;
- fdt32_t cells[2];
- int ret;
- static const char format[] =
#if LCD_BPP == LCD_COLOR16
- "r5g6b5";
+ return fdt_setup_simplefb_node(blob, off, gd->fb_base,
+ panel_info.vl_col, panel_info.vl_row,
+ panel_info.vl_col * 2, "r5g6b5");
#else
- "";
+ return -1;
#endif
-
- if (!format[0])
- return -1;
-
- stride = panel_info.vl_col * 2;
-
- cells[0] = cpu_to_fdt32(gd->fb_base);
- cells[1] = cpu_to_fdt32(stride * panel_info.vl_row);
- ret = fdt_setprop(blob, off, "reg", cells, sizeof(cells[0]) * 2);
- if (ret < 0)
- return -1;
-
- cells[0] = cpu_to_fdt32(panel_info.vl_col);
- ret = fdt_setprop(blob, off, "width", cells, sizeof(cells[0]));
- if (ret < 0)
- return -1;
-
- cells[0] = cpu_to_fdt32(panel_info.vl_row);
- ret = fdt_setprop(blob, off, "height", cells, sizeof(cells[0]));
- if (ret < 0)
- return -1;
-
- cells[0] = cpu_to_fdt32(stride);
- ret = fdt_setprop(blob, off, "stride", cells, sizeof(cells[0]));
- if (ret < 0)
- return -1;
-
- ret = fdt_setprop(blob, off, "format", format, strlen(format) + 1);
- if (ret < 0)
- return -1;
-
- ret = fdt_delprop(blob, off, "status");
- if (ret < 0)
- return -1;
-
- return 0;
}
int lcd_dt_simplefb_add_node(void *blob)