drivers: timer: nrf: Adapt to clock_control changes

Adapted driver to clock_control changes (usage of onoff manager).
Since timer is permanenty requesting the clock, it is using API
dedicated for that: z_nrf_clock_control_lf_on().

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2020-07-07 14:12:12 +02:00 committed by Carles Cufí
parent ff089217cb
commit 2881df3d0c

View file

@ -188,17 +188,8 @@ void rtc_nrf_isr(void *arg)
int z_clock_driver_init(struct device *device)
{
struct device *clock;
ARG_UNUSED(device);
clock = device_get_binding(DT_LABEL(DT_INST(0, nordic_nrf_clock)));
if (!clock) {
return -1;
}
clock_control_on(clock, CLOCK_CONTROL_NRF_SUBSYS_LF);
/* TODO: replace with counter driver to access RTC */
nrf_rtc_prescaler_set(RTC, 0);
event_clear();
@ -215,6 +206,8 @@ int z_clock_driver_init(struct device *device)
set_comparator(counter() + CYC_PER_TICK);
}
z_nrf_clock_control_lf_on(NRF_LFCLK_START_MODE_NOWAIT);
return 0;
}