artik053: initialize timers at boot
authorJihun Ahn <jhun.ahn@samsung.com>
Mon, 8 May 2017 08:39:08 +0000 (17:39 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 23 May 2017 12:40:00 +0000 (21:40 +0900)
Now that the MCT of S5J is supported, let's initialize timers at boot so
that users may access them through /dev/timerN.

Change-Id: I48adf261e9c4358070b5992e51a3385013ffd55a
Signed-off-by: Jihun Ahn <jhun.ahn@samsung.com>
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/arch/arm/src/artik053/src/artik053_tash.c

index 25e7cf3..4f24e84 100644 (file)
@@ -66,6 +66,7 @@
 
 #include "s5j_adc.h"
 #include "s5j_rtc.h"
+#include "s5j_mct.h"
 #include "up_internal.h"
 
 #include <apps/shell/tash.h>
@@ -296,6 +297,18 @@ int board_app_initialize(void)
        }
 #endif                                                 /* CONFIG_RTC_DRIVER */
 
+#ifdef CONFIG_TIMER
+       {
+               int  i;
+               char path[CONFIG_PATH_MAX];
+
+               for (i = 0; i < CONFIG_S5J_MCT_NUM; i++) {
+                       sprintf(path, "/dev/timer%d", i);
+                       s5j_timer_initialize(path, i);
+               }
+       }
+#endif
+
        artik053_adc_setup();
 
        scsc_wpa_ctrl_iface_init();