drivers: clock_control_nrf: Align LF clock sources symbols to new nrfx
New nrfx release brings change of Low frequency sources symbols in nrf_clock hal to uppercase. This commit aligns all occurrences. Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
This commit is contained in:
parent
5da98e9d56
commit
beb7313fc4
4 changed files with 15 additions and 15 deletions
|
@ -476,17 +476,17 @@ static void lfclk_spinwait(enum nrf_lfclk_start_mode mode)
|
||||||
static const nrf_clock_domain_t d = NRF_CLOCK_DOMAIN_LFCLK;
|
static const nrf_clock_domain_t d = NRF_CLOCK_DOMAIN_LFCLK;
|
||||||
static const nrf_clock_lfclk_t target_type =
|
static const nrf_clock_lfclk_t target_type =
|
||||||
/* For sources XTAL, EXT_LOW_SWING, and EXT_FULL_SWING,
|
/* For sources XTAL, EXT_LOW_SWING, and EXT_FULL_SWING,
|
||||||
* NRF_CLOCK_LFCLK_Xtal is returned as the type of running clock.
|
* NRF_CLOCK_LFCLK_XTAL is returned as the type of running clock.
|
||||||
*/
|
*/
|
||||||
(IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL) ||
|
(IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL) ||
|
||||||
IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING) ||
|
IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING) ||
|
||||||
IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING))
|
IS_ENABLED(CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING))
|
||||||
? NRF_CLOCK_LFCLK_Xtal
|
? NRF_CLOCK_LFCLK_XTAL
|
||||||
: CLOCK_CONTROL_NRF_K32SRC;
|
: CLOCK_CONTROL_NRF_K32SRC;
|
||||||
nrf_clock_lfclk_t type;
|
nrf_clock_lfclk_t type;
|
||||||
|
|
||||||
if ((mode == CLOCK_CONTROL_NRF_LF_START_AVAILABLE) &&
|
if ((mode == CLOCK_CONTROL_NRF_LF_START_AVAILABLE) &&
|
||||||
(target_type == NRF_CLOCK_LFCLK_Xtal) &&
|
(target_type == NRF_CLOCK_LFCLK_XTAL) &&
|
||||||
(nrf_clock_lf_srccopy_get(NRF_CLOCK) == CLOCK_CONTROL_NRF_K32SRC)) {
|
(nrf_clock_lf_srccopy_get(NRF_CLOCK) == CLOCK_CONTROL_NRF_K32SRC)) {
|
||||||
/* If target clock source is using XTAL then due to two-stage
|
/* If target clock source is using XTAL then due to two-stage
|
||||||
* clock startup sequence, RC might already be running.
|
* clock startup sequence, RC might already be running.
|
||||||
|
@ -519,7 +519,7 @@ static void lfclk_spinwait(enum nrf_lfclk_start_mode mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clock interrupt is locked, LFCLKSTARTED is handled here. */
|
/* Clock interrupt is locked, LFCLKSTARTED is handled here. */
|
||||||
if ((target_type == NRF_CLOCK_LFCLK_Xtal)
|
if ((target_type == NRF_CLOCK_LFCLK_XTAL)
|
||||||
&& (nrf_clock_lf_src_get(NRF_CLOCK) == NRF_CLOCK_LFCLK_RC)
|
&& (nrf_clock_lf_src_get(NRF_CLOCK) == NRF_CLOCK_LFCLK_RC)
|
||||||
&& nrf_clock_event_check(NRF_CLOCK,
|
&& nrf_clock_event_check(NRF_CLOCK,
|
||||||
NRF_CLOCK_EVENT_LFCLKSTARTED)) {
|
NRF_CLOCK_EVENT_LFCLKSTARTED)) {
|
||||||
|
|
|
@ -56,16 +56,16 @@ enum nrf_lfclk_start_mode {
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_RC
|
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_RC
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL
|
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_Xtal
|
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_XTAL
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH
|
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_Synth
|
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_SYNTH
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING
|
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_Xtal_Low_Swing
|
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_XTAL_LOW_SWING
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING
|
#ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_Xtal_Full_Swing
|
#define CLOCK_CONTROL_NRF_K32SRC NRF_CLOCK_LFCLK_XTAL_FULL_SWING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define 32KHz clock accuracy */
|
/* Define 32KHz clock accuracy */
|
||||||
|
|
|
@ -79,8 +79,8 @@ static void show_clocks(const char *tag)
|
||||||
[NRF_CLOCK_LFCLK_LFULP] = "LFULP",
|
[NRF_CLOCK_LFCLK_LFULP] = "LFULP",
|
||||||
#endif
|
#endif
|
||||||
[NRF_CLOCK_LFCLK_RC] = "LFRC",
|
[NRF_CLOCK_LFCLK_RC] = "LFRC",
|
||||||
[NRF_CLOCK_LFCLK_Xtal] = "LFXO",
|
[NRF_CLOCK_LFCLK_XTAL] = "LFXO",
|
||||||
[NRF_CLOCK_LFCLK_Synth] = "LFSYNT",
|
[NRF_CLOCK_LFCLK_SYNTH] = "LFSYNT",
|
||||||
};
|
};
|
||||||
static const char *const hfsrc_s[] = {
|
static const char *const hfsrc_s[] = {
|
||||||
[NRF_CLOCK_HFCLK_LOW_ACCURACY] = "HFINT",
|
[NRF_CLOCK_HFCLK_LOW_ACCURACY] = "HFINT",
|
||||||
|
|
|
@ -22,7 +22,7 @@ static void xtal_check(bool on, nrf_clock_lfclk_t type)
|
||||||
zassert_true(is_running, "Clock should be on");
|
zassert_true(is_running, "Clock should be on");
|
||||||
} else {
|
} else {
|
||||||
zassert_true(on, "Clock should be on");
|
zassert_true(on, "Clock should be on");
|
||||||
zassert_equal(type, NRF_CLOCK_LFCLK_Xtal);
|
zassert_equal(type, NRF_CLOCK_LFCLK_XTAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ static void synth_check(bool on, nrf_clock_lfclk_t type)
|
||||||
{
|
{
|
||||||
#if !defined(CLOCK_LFCLKSRC_SRC_Synth) && \
|
#if !defined(CLOCK_LFCLKSRC_SRC_Synth) && \
|
||||||
!defined(CLOCK_LFCLKSRC_SRC_LFSYNT)
|
!defined(CLOCK_LFCLKSRC_SRC_LFSYNT)
|
||||||
#define NRF_CLOCK_LFCLK_Synth 0
|
#define NRF_CLOCK_LFCLK_SYNTH 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!IS_ENABLED(CONFIG_SYSTEM_CLOCK_NO_WAIT)) {
|
if (!IS_ENABLED(CONFIG_SYSTEM_CLOCK_NO_WAIT)) {
|
||||||
zassert_true(on, "Clock should be on");
|
zassert_true(on, "Clock should be on");
|
||||||
zassert_equal(type, NRF_CLOCK_LFCLK_Synth);
|
zassert_equal(type, NRF_CLOCK_LFCLK_SYNTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,13 +78,13 @@ ZTEST(nrf_lf_clock_start, test_wait_in_thread)
|
||||||
|
|
||||||
z_nrf_clock_control_lf_on(CLOCK_CONTROL_NRF_LF_START_AVAILABLE);
|
z_nrf_clock_control_lf_on(CLOCK_CONTROL_NRF_LF_START_AVAILABLE);
|
||||||
o = nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &t);
|
o = nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &t);
|
||||||
zassert_false((t == NRF_CLOCK_LFCLK_Xtal) && o);
|
zassert_false((t == NRF_CLOCK_LFCLK_XTAL) && o);
|
||||||
k_busy_wait(35);
|
k_busy_wait(35);
|
||||||
zassert_true(k_cycle_get_32() > 0);
|
zassert_true(k_cycle_get_32() > 0);
|
||||||
|
|
||||||
z_nrf_clock_control_lf_on(CLOCK_CONTROL_NRF_LF_START_STABLE);
|
z_nrf_clock_control_lf_on(CLOCK_CONTROL_NRF_LF_START_STABLE);
|
||||||
o = nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &t);
|
o = nrf_clock_is_running(NRF_CLOCK, NRF_CLOCK_DOMAIN_LFCLK, &t);
|
||||||
zassert_true((t == NRF_CLOCK_LFCLK_Xtal) && o);
|
zassert_true((t == NRF_CLOCK_LFCLK_XTAL) && o);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *test_init(void)
|
void *test_init(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue