diff --git a/drivers/timer/sam0_rtc_timer.c b/drivers/timer/sam0_rtc_timer.c index e3f2a779db0..cc35b5e3fa0 100644 --- a/drivers/timer/sam0_rtc_timer.c +++ b/drivers/timer/sam0_rtc_timer.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* RTC registers. */ @@ -78,6 +79,9 @@ static volatile uint32_t rtc_counter; /* Tick value of the next timeout. */ static volatile uint32_t rtc_timeout; +PINCTRL_DT_INST_DEFINE(0); +static const struct pinctrl_dev_config *pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0); + #endif /* CONFIG_TICKLESS_KERNEL */ /* @@ -242,6 +246,8 @@ uint32_t sys_clock_cycle_get_32(void) static int sys_clock_driver_init(const struct device *dev) { + int retval; + ARG_UNUSED(dev); #ifdef MCLK @@ -258,6 +264,11 @@ static int sys_clock_driver_init(const struct device *dev) } #endif + retval = pinctrl_apply_state(pcfg, PINCTRL_STATE_DEFAULT); + if (retval < 0) { + return retval; + } + /* Reset module to hardware defaults. */ rtc_reset(); diff --git a/dts/bindings/rtc/atmel,sam0-rtc.yaml b/dts/bindings/rtc/atmel,sam0-rtc.yaml index 8e3d7047393..edea478dd3f 100644 --- a/dts/bindings/rtc/atmel,sam0-rtc.yaml +++ b/dts/bindings/rtc/atmel,sam0-rtc.yaml @@ -5,7 +5,9 @@ description: Atmel SAM0 RTC compatible: "atmel,sam0-rtc" -include: rtc.yaml +include: + - name: rtc.yaml + - name: pinctrl-device.yaml properties: reg: