Skip to content

Commit 6be0531

Browse files
committed
[nrf fromlist] 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 9a052d8366222f6029608ce5bf81f097a6ce0f1b)
1 parent b70deaa commit 6be0531

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/clock_control/clock_control_nrf.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ 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+
/* HFCLK started should be used only if tune operation is done implicitely. */
602604
case NRFX_CLOCK_EVT_HFCLK_STARTED:
603605
{
604606
struct nrf_clock_control_sub_data *data =
@@ -613,6 +615,13 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
613615

614616
break;
615617
}
618+
#endif
619+
620+
#if NRF_CLOCK_HAS_XO_TUNE
621+
case NRFX_CLOCK_EVT_XO_TUNED:
622+
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK);
623+
break;
624+
#endif
616625
#if NRF_CLOCK_HAS_HFCLK192M
617626
case NRFX_CLOCK_EVT_HFCLK192M_STARTED:
618627
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK192M);
@@ -639,7 +648,6 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
639648
break;
640649
case NRFX_CLOCK_EVT_PLL_STARTED:
641650
#if NRF_CLOCK_HAS_XO_TUNE
642-
case NRFX_CLOCK_EVT_XO_TUNED:
643651
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
644652
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
645653
#endif

0 commit comments

Comments
 (0)