From 0ddb908bb36acb7a8be737ac48cfabc1f7103f3e Mon Sep 17 00:00:00 2001
From: Przemyslaw Marczak
Date: Thu, 18 Sep 2014 15:27:59 +0200
Subject: [PATCH] thor: check board type before display for CONFIG_OF_MULTI.
For multi platform binary, it is required to check
the board type because not every board supports display.
Change-Id: Ia4153d58f48846a0bec6e9dc90ea17d87d5da096
Signed-off-by: Przemyslaw Marczak
---
common/cmd_thordown.c | 9 +++++++--
drivers/usb/gadget/f_thor.c | 16 ++++++++++++++++
include/libtizen.h | 1 +
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/common/cmd_thordown.c b/common/cmd_thordown.c
index 18a84cf243..76438e4ff9 100644
--- a/common/cmd_thordown.c
+++ b/common/cmd_thordown.c
@@ -65,9 +65,14 @@ done:
dfu_free_entities();
#ifdef CONFIG_TIZEN
- if (ret != CMD_RET_SUCCESS)
+ if (ret != CMD_RET_SUCCESS) {
+#ifdef CONFIG_OF_MULTI
+ if (board_is_trats2())
+ draw_thor_fail_screen();
+#else
draw_thor_fail_screen();
- else
+#endif
+ } else
lcd_clear();
#endif
return ret;
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index f0c4e255e1..2959506582 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -575,7 +575,13 @@ static int thor_rx_data(void)
data_to_rx -= dev->out_req->actual;
#ifdef CONFIG_TIZEN
downloaded_file_size += dev->out_req->actual;
+#ifdef CONFIG_OF_MULTI
+ if (board_is_trats2())
+ draw_thor_progress(total_file_size,
+ downloaded_file_size);
+#else
draw_thor_progress(total_file_size, downloaded_file_size);
+#endif
#endif
} while (data_to_rx);
@@ -721,7 +727,12 @@ int thor_init(void)
int power_key_cnt = 0;
#ifdef CONFIG_TIZEN
+#ifdef CONFIG_OF_MULTI
+ if (board_is_trats2())
+ draw_thor_screen();
+#else
draw_thor_screen();
+#endif
#endif
/* Wait for a device enumeration and configuration settings */
debug("THOR enumeration/configuration setting....\n");
@@ -738,7 +749,12 @@ int thor_init(void)
}
}
#ifdef CONFIG_TIZEN
+#ifdef CONFIG_OF_MULTI
+ if (board_is_trats2())
+ draw_thor_connected();
+#else
draw_thor_connected();
+#endif
#endif
thor_set_dma(thor_rx_data_buf, strlen("THOR"));
/* detect the download request from Host PC */
diff --git a/include/libtizen.h b/include/libtizen.h
index fc5df1f867..1ab4ac618a 100644
--- a/include/libtizen.h
+++ b/include/libtizen.h
@@ -9,6 +9,7 @@
#define _LIBTIZEN_H_
#include
+#include
#define HD_RESOLUTION 0
--
2.34.1