Skip to content

Commit 9dbc113

Browse files
committed
[nrf fromlist] drivers: timer: nrf_grtc: Add app-defined post-init function
Upstream PR #: 98505 When CONFIG_NRF_GRTC_TIMER_APP_DEFINED_INIT=y, the compiler would warn that `grtc_post_init()` was unused, because this feature was not updated to account for the fact that clock init has been split into two stages. Signed-off-by: Grzegorz Swiderski <[email protected]> (cherry picked from commit c161040a28871438dc92b977c37f7df9794f1a40)
1 parent be5d777 commit 9dbc113

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/timer/nrf_grtc_timer.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ int nrf_grtc_timer_clock_driver_init(void)
589589
{
590590
return sys_clock_driver_init();
591591
}
592+
593+
int nrf_grtc_timer_post_init(void)
594+
{
595+
return grtc_post_init();
596+
}
592597
#else
593598
SYS_INIT(sys_clock_driver_init, EARLY, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
594599
SYS_INIT(grtc_post_init, PRE_KERNEL_2, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);

include/zephyr/drivers/timer/nrf_grtc_timer.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ uint64_t z_nrf_grtc_timer_startup_value_get(void);
209209
*/
210210
int nrf_grtc_timer_clock_driver_init(void);
211211

212+
/**
213+
* @brief Perform second-stage initialization of the GRTC from an application-
214+
* defined function.
215+
*
216+
* @retval 0 on success.
217+
* @retval -errno Negative error code on failure.
218+
*/
219+
int nrf_grtc_timer_post_init(void);
220+
212221
#ifdef __cplusplus
213222
}
214223
#endif

0 commit comments

Comments
 (0)