From abb2591abd47019a807a15ef236a6690cd038ad9 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 23 Aug 2018 10:22:51 +0200 Subject: [PATCH] platform: refactor: unify */platform/timer.h functions and variables For cnl&apl removed platform_timer_register from public api and made it static. For byt&hsw moved platform_timer to platform.h (just like it is for cnl&apl). Signed-off-by: Janusz Jankowski --- src/platform/apollolake/include/platform/timer.h | 2 -- src/platform/baytrail/include/platform/platform.h | 3 +++ src/platform/baytrail/include/platform/timer.h | 2 -- src/platform/cannonlake/include/platform/timer.h | 2 -- src/platform/haswell/include/platform/platform.h | 3 +++ src/platform/haswell/include/platform/timer.h | 2 -- src/platform/intel/cavs/timer.c | 4 ++-- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/platform/apollolake/include/platform/timer.h b/src/platform/apollolake/include/platform/timer.h index e4977e4d4..347ddc5d8 100644 --- a/src/platform/apollolake/include/platform/timer.h +++ b/src/platform/apollolake/include/platform/timer.h @@ -53,8 +53,6 @@ void platform_timer_clear(struct timer *timer); uint64_t platform_timer_get(struct timer *timer); void platform_timer_start(struct timer *timer); void platform_timer_stop(struct timer *timer); -int platform_timer_register(struct timer *timer, - void (*handler)(void *arg), void *arg); /* get timestamp for host stream DMA position */ void platform_host_timestamp(struct comp_dev *host, diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 4cd7c5083..c1230e7f6 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -112,4 +112,7 @@ static inline void platform_panic(uint32_t p) /* Platform defined trace code */ #define platform_trace_point(__x) \ shim_write(SHIM_IPCXL, (__x & 0x3fffffff)) + +extern struct timer *platform_timer; + #endif diff --git a/src/platform/baytrail/include/platform/timer.h b/src/platform/baytrail/include/platform/timer.h index 2801bb5b5..38c046093 100644 --- a/src/platform/baytrail/include/platform/timer.h +++ b/src/platform/baytrail/include/platform/timer.h @@ -47,8 +47,6 @@ struct comp_dev; struct sof_ipc_stream_posn; -extern struct timer *platform_timer; - int platform_timer_set(struct timer *timer, uint64_t ticks); void platform_timer_clear(struct timer *timer); uint64_t platform_timer_get(struct timer *timer); diff --git a/src/platform/cannonlake/include/platform/timer.h b/src/platform/cannonlake/include/platform/timer.h index 02b7c6e0d..25043b9fd 100644 --- a/src/platform/cannonlake/include/platform/timer.h +++ b/src/platform/cannonlake/include/platform/timer.h @@ -54,8 +54,6 @@ void platform_timer_clear(struct timer *timer); uint64_t platform_timer_get(struct timer *timer); void platform_timer_start(struct timer *timer); void platform_timer_stop(struct timer *timer); -int platform_timer_register(struct timer *timer, - void (*handler)(void *arg), void *arg); /* get timestamp for host stream DMA position */ void platform_host_timestamp(struct comp_dev *host, diff --git a/src/platform/haswell/include/platform/platform.h b/src/platform/haswell/include/platform/platform.h index 4a7f9b336..fd2a5230a 100644 --- a/src/platform/haswell/include/platform/platform.h +++ b/src/platform/haswell/include/platform/platform.h @@ -111,4 +111,7 @@ static inline void platform_panic(uint32_t p) /* Platform defined trace code */ #define platform_trace_point(__x) \ shim_write(SHIM_IPCX, ((__x) & 0x3fffffff)) + +extern struct timer *platform_timer; + #endif diff --git a/src/platform/haswell/include/platform/timer.h b/src/platform/haswell/include/platform/timer.h index c51e0e6d5..91627cb10 100644 --- a/src/platform/haswell/include/platform/timer.h +++ b/src/platform/haswell/include/platform/timer.h @@ -46,8 +46,6 @@ struct comp_dev; struct sof_ipc_stream_posn; -extern struct timer *platform_timer; - int platform_timer_set(struct timer *timer, uint64_t ticks); void platform_timer_clear(struct timer *timer); uint64_t platform_timer_get(struct timer *timer); diff --git a/src/platform/intel/cavs/timer.c b/src/platform/intel/cavs/timer.c index de745c4f7..f6e721508 100644 --- a/src/platform/intel/cavs/timer.c +++ b/src/platform/intel/cavs/timer.c @@ -114,8 +114,8 @@ void platform_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock) *wallclock = shim_read64(SHIM_DSPWC); } -int platform_timer_register(struct timer *timer, - void (*handler)(void *arg), void *arg) +static int platform_timer_register(struct timer *timer, + void (*handler)(void *arg), void *arg) { return interrupt_register(timer->irq, handler, arg); }