Skip to content

Commit ec7fc79

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 13b825670b5dbcee08f28325b614659a278365ed)
1 parent 6dc8dcd commit ec7fc79

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
@@ -613,6 +613,8 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
613613
const struct device *dev = CLOCK_DEVICE;
614614

615615
switch (event) {
616+
#if !NRF_CLOCK_HAS_XO_TUNE
617+
/* HFCLK started should be used only if tune operation is done implicitly. */
616618
case NRFX_CLOCK_EVT_HFCLK_STARTED:
617619
{
618620
struct nrf_clock_control_sub_data *data =
@@ -627,6 +629,13 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
627629

628630
break;
629631
}
632+
#endif
633+
634+
#if NRF_CLOCK_HAS_XO_TUNE
635+
case NRFX_CLOCK_EVT_XO_TUNED:
636+
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK);
637+
break;
638+
#endif
630639
#if NRF_CLOCK_HAS_HFCLK192M
631640
case NRFX_CLOCK_EVT_HFCLK192M_STARTED:
632641
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK192M);
@@ -653,7 +662,6 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
653662
break;
654663
case NRFX_CLOCK_EVT_PLL_STARTED:
655664
#if NRF_CLOCK_HAS_XO_TUNE
656-
case NRFX_CLOCK_EVT_XO_TUNED:
657665
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
658666
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
659667
#endif

0 commit comments

Comments
 (0)