#include <samsung/misc.h>
#include <linux/input.h>
#include <usb.h>
+#include <thor.h>
#include "f_thor.h"
#ifdef CONFIG_TIZEN
static unsigned long long int total_file_size;
static unsigned long long int downloaded_file_size;
+static thor_notify_func thor_notify_fn = NULL;
#endif
static int alt_setting_num;
data_to_rx -= dev->out_req->actual;
#ifdef CONFIG_TIZEN
downloaded_file_size += dev->out_req->actual;
+
+ if (thor_notify_fn)
+ thor_notify_fn(THOR_NOTIFY_PROGRESS,
+ total_file_size,
+ downloaded_file_size);
+
#ifdef CONFIG_LCD /* TODO : Need to enable LCD*/
#ifdef CONFIG_OF_MULTI
if (board_is_trats2())
draw_thor_connected();
#endif
#endif
+ if (thor_notify_fn)
+ thor_notify_fn(THOR_NOTIFY_CONNECTED, 0, 0);
+
#endif /* CONFIG_TIZEN */
thor_set_dma(thor_rx_data_buf, strlen("THOR"));
/* detect the download request from Host PC */
}
DECLARE_GADGET_BIND_CALLBACK(usb_dnl_thor, thor_add);
+
+#ifdef CONFIG_TIZEN
+int thor_register_notifier(thor_notify_func fn)
+{
+ if (thor_notify_fn)
+ return -EINVAL;
+
+ thor_notify_fn = fn;
+
+ return 0;
+}
+#endif
int thor_handle(void);
int thor_init(void);
int thor_add(struct usb_configuration *c);
+
+enum thor_notify_type {
+ THOR_NOTIFY_INIT,
+ THOR_NOTIFY_CONNECTED,
+ THOR_NOTIFY_PROGRESS,
+};
+
+typedef void (*thor_notify_func)(enum thor_notify_type, unsigned long long int,
+ unsigned long long int);
+
+#ifdef CONFIG_TIZEN
+int thor_register_notifier(thor_notify_func fn);
+#else
+static inline int thor_register_notifier(thor_notify_func fn)
+{
+ return -ENOSYS;
+}
+#endif /* CONFIG_TIZEN */
+
#endif /* __THOR_H_ */