Skip to content

Commit f37b306

Browse files
drivers: clock_control: z_nrf_clock: add get_startup_time API
Implement vendor specific z_nrf_clock_bt_ctlr_hf_get_startup_time_us() which gets the startup time of the high frequency clock used for Bluetooth. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
1 parent f5db14e commit f37b306

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/clock_control/clock_control_nrf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,13 @@ void z_nrf_clock_bt_ctlr_hf_release(void)
436436
irq_unlock(key);
437437
}
438438

439+
#if DT_NODE_EXISTS(DT_NODELABEL(hfxo))
440+
uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void)
441+
{
442+
return DT_PROP(DT_NODELABEL(hfxo), startup_time_us);
443+
}
444+
#endif
445+
439446
static int stop(const struct device *dev, clock_control_subsys_t subsys,
440447
uint32_t ctx)
441448
{

include/zephyr/drivers/clock_control/nrf_clock_control.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ void z_nrf_clock_bt_ctlr_hf_request(void);
162162
*/
163163
void z_nrf_clock_bt_ctlr_hf_release(void);
164164

165+
/**
166+
* @brief Get clock startup time
167+
*
168+
* @retval HFCLK startup time in microseconds
169+
*/
170+
uint32_t z_nrf_clock_bt_ctlr_hf_get_startup_time_us(void);
171+
165172
#endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */
166173

167174

0 commit comments

Comments
 (0)