Skip to content

Commit 36d6c19

Browse files
kl-cruzrlubos
authored andcommitted
[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. Upstream PR #: 86354 Signed-off-by: Karol Lasończyk <[email protected]>
1 parent 8dbca43 commit 36d6c19

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/clock_control/clock_control_nrf.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,17 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
681681
const struct device *dev = CLOCK_DEVICE;
682682

683683
switch (event) {
684+
#if NRF_CLOCK_HAS_XO_TUNE
685+
case NRFX_CLOCK_EVT_XO_TUNED:
686+
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK);
687+
break;
688+
case NRFX_CLOCK_EVT_HFCLK_STARTED:
689+
/* HFCLK is stable after XOTUNED event.
690+
* HFCLK_STARTED means only that clock has been started.
691+
*/
692+
break;
693+
#else
694+
/* HFCLK started should be used only if tune operation is done implicitly. */
684695
case NRFX_CLOCK_EVT_HFCLK_STARTED:
685696
{
686697
struct nrf_clock_control_sub_data *data =
@@ -695,6 +706,8 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
695706

696707
break;
697708
}
709+
#endif
710+
698711
#if NRF_CLOCK_HAS_HFCLK192M
699712
case NRFX_CLOCK_EVT_HFCLK192M_STARTED:
700713
clkstarted_handle(dev, CLOCK_CONTROL_NRF_TYPE_HFCLK192M);
@@ -725,7 +738,6 @@ static void clock_event_handler(nrfx_clock_evt_type_t event)
725738
case NRFX_CLOCK_EVT_PLL_STARTED:
726739
#endif
727740
#if NRF_CLOCK_HAS_XO_TUNE
728-
case NRFX_CLOCK_EVT_XO_TUNED:
729741
case NRFX_CLOCK_EVT_XO_TUNE_ERROR:
730742
case NRFX_CLOCK_EVT_XO_TUNE_FAILED:
731743
#endif

0 commit comments

Comments
 (0)