summaryrefslogtreecommitdiff
path: root/board/samsung
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2014-01-22 11:24:12 +0100
committerMinkyu Kang <mk7.kang@samsung.com>2014-02-03 15:36:14 +0900
commit679549d1802f0ee8e66576ecfc766d30b4040983 (patch)
treee9e78d320e68ba89f8d54a4c9c4d6d0cac612d0b /board/samsung
parent7f39b0678275c773301da15d3a7cc1ea7ca87171 (diff)
downloadu-boot-imx-679549d1802f0ee8e66576ecfc766d30b4040983.zip
u-boot-imx-679549d1802f0ee8e66576ecfc766d30b4040983.tar.gz
u-boot-imx-679549d1802f0ee8e66576ecfc766d30b4040983.tar.bz2
samsung: common: Add file for common functions, draw_logo() cleanup.
Changes: new file: - board/samsung/common/misc.c depends on: CONFIG_MISC_COMMON - move draw_logo() to misc.c configs: trats, trats2, universal: - enable CONFIG_MISC_COMMON, - enable CONFIG_MISC_INIT_R, - add misc_init_r() and call draw_logo() in it. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/common/Makefile1
-rw-r--r--board/samsung/common/misc.c41
-rw-r--r--board/samsung/trats/trats.c11
-rw-r--r--board/samsung/trats2/trats2.c4
-rw-r--r--board/samsung/universal_c210/universal.c11
5 files changed, 68 insertions, 0 deletions
diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile
index 22bd6b1..7d2bb8c 100644
--- a/board/samsung/common/Makefile
+++ b/board/samsung/common/Makefile
@@ -8,6 +8,7 @@
obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
obj-$(CONFIG_THOR_FUNCTION) += thor.o
obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
+obj-$(CONFIG_MISC_COMMON) += misc.o
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_BOARD_COMMON) += board.o
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
new file mode 100644
index 0000000..f6be891
--- /dev/null
+++ b/board/samsung/common/misc.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Przemyslaw Marczak <p.marczak@samsung.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <lcd.h>
+#include <libtizen.h>
+#include <samsung/misc.h>
+
+#ifdef CONFIG_CMD_BMP
+void draw_logo(void)
+{
+ int x, y;
+ ulong addr;
+
+ addr = panel_info.logo_addr;
+ if (!addr) {
+ error("There is no logo data.");
+ return;
+ }
+
+ if (panel_info.vl_width >= panel_info.logo_width) {
+ x = ((panel_info.vl_width - panel_info.logo_width) >> 1);
+ } else {
+ x = 0;
+ printf("Warning: image width is bigger than display width\n");
+ }
+
+ if (panel_info.vl_height >= panel_info.logo_height) {
+ y = ((panel_info.vl_height - panel_info.logo_height) >> 1);
+ } else {
+ y = 0;
+ printf("Warning: image height is bigger than display height\n");
+ }
+
+ bmp_display(addr, x, y);
+}
+#endif /* CONFIG_CMD_BMP */
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 640a193..a644b60 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -786,3 +786,14 @@ void init_panel_info(vidinfo_t *vid)
setenv("lcdinfo", "lcd=s6e8ax0");
}
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_CMD_BMP
+ if (panel_info.logo_on)
+ draw_logo();
+#endif
+ return 0;
+}
+#endif
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index feb6c4c..4834f90 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -615,6 +615,10 @@ void init_panel_info(vidinfo_t *vid)
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
+#ifdef CONFIG_CMD_BMP
+ if (panel_info.logo_on)
+ draw_logo();
+#endif
return 0;
}
#endif
diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
index 3feef3f..2b8c69b 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -511,3 +511,14 @@ int board_init(void)
return 0;
}
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_CMD_BMP
+ if (panel_info.logo_on)
+ draw_logo();
+#endif
+ return 0;
+}
+#endif