Skip to content

Commit 96e0ebe

Browse files
[nrf fromlist] drivers: timer: grtc: Add LFPRC as the source of GRTC
This commit allows to switch the GRTC clock source to an RC oscillator. Upstream PR #: 80622 Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent c8fd566 commit 96e0ebe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/timer/nrf_grtc_timer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,15 @@ static int sys_clock_driver_init(void)
501501
z_nrf_clock_control_lf_on(mode);
502502
#endif
503503

504-
#if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && \
505-
DT_NODE_HAS_STATUS(DT_NODELABEL(lfxo), okay) && NRF_GRTC_HAS_CLKSEL
504+
#if defined(CONFIG_NRF_GRTC_TIMER_CLOCK_MANAGEMENT) && NRF_GRTC_HAS_CLKSEL
505+
#if defined(CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC)
506+
/* Switch to LFPRC as the low-frequency clock source. */
507+
nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFLPRC);
508+
#elif DT_NODE_HAS_STATUS(DT_NODELABEL(lfxo), okay)
506509
/* Switch to LFXO as the low-frequency clock source. */
507510
nrfx_grtc_clock_source_set(NRF_GRTC_CLKSEL_LFXO);
508511
#endif
512+
#endif
509513

510514
#if defined(CONFIG_NRF_GRTC_ALWAYS_ON)
511515
nrfx_grtc_active_request_set(true);

0 commit comments

Comments
 (0)