drivers: counter: nrfx_rtc: Adapt to clock control changes

Adapted nrfx_rtc counter to request clock through onoff API.

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

View file

@ -524,7 +524,6 @@ static uint32_t get_pending_int(struct device *dev)
static int init_rtc(struct device *dev, uint32_t prescaler)
{
struct device *clock;
const struct counter_nrfx_config *nrfx_config = get_nrfx_config(dev);
struct counter_top_cfg top_cfg = {
.ticks = COUNTER_MAX_TOP_VALUE
@ -532,12 +531,7 @@ static int init_rtc(struct device *dev, uint32_t prescaler)
NRF_RTC_Type *rtc = nrfx_config->rtc;
int err;
clock = device_get_binding(DT_LABEL(DT_INST(0, nordic_nrf_clock)));
if (!clock) {
return -ENODEV;
}
clock_control_on(clock, CLOCK_CONTROL_NRF_SUBSYS_LF);
z_nrf_clock_control_lf_on(NRF_LFCLK_START_MODE_NOWAIT);
nrf_rtc_prescaler_set(rtc, prescaler);