Skip to content

Commit 1d448b5

Browse files
committed
[nrf fromtree] drivers: clock_control: Add support for XOTUNE in nRF54L
Adding support for handling XOTUNE event in clock_control. Right now XOTUNE event reflects situation when HFCLK is stable and tuned. Signed-off-by: Karol Lasończyk <[email protected]> (cherry picked from commit 364927c86c58e826fe3d615294db49019e674b73)
1 parent 4e19f54 commit 1d448b5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/clock_control/clock_control_nrf.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,17 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
599599
const struct device *dev = CLOCK_DEVICE;
600600

601601
switch (event) {
602+
#if NRF_CLOCK_HAS_XO_TUNE
603+
case NRFX_CLOCK_EVT_XO_TUNED:
604+
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK);
605+
break;
606+
case NRFX_CLOCK_EVT_HFCLK_STARTED:
607+
/* HFCLK is stable after XOTUNED event.
608+
* HFCLK_STARTED means only that clock has been started.
609+
*/
610+
break;
611+
#else
612+
/* HFCLK started should be used only if tune operation is done implicitly. */
602613
case NRFX_CLOCK_EVT_HFCLK_STARTED:
603614
{
604615
struct nrf_clock_control_sub_data *data =
@@ -613,6 +624,8 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
613624

614625
break;
615626
}
627+
#endif
628+
616629
#if NRF_CLOCK_HAS_HFCLK192M
617630
case NRFX_CLOCK_EVT_HFCLK192M_STARTED:
618631
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK192M);
@@ -643,7 +656,6 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
643656
case NRFX_CLOCK_EVT_PLL_STARTED:
644657
#endif
645658
#if NRF_CLOCK_HAS_XO_TUNE
646-
case NRFX_CLOCK_EVT_XO_TUNED:
647659
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
648660
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
649661
#endif

0 commit comments

Comments
 (0)