drivers: wdog_cmsdk_apb: Get clock frequency from DTS
The wdog_cmsdk_apb driver used system clock frequency as a base for timeout calculation. This commit corrects that by obtaining the needed value from DTS. Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
parent
08f8abcfe4
commit
a901e32a38
1 changed files with 2 additions and 1 deletions
|
@ -110,7 +110,8 @@ static int wdog_cmsdk_apb_install_timeout(struct device *dev,
|
|||
ARG_UNUSED(dev);
|
||||
|
||||
/* Reload value */
|
||||
reload_s = config->window.max * CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
|
||||
reload_s = config->window.max *
|
||||
DT_INST_0_ARM_CMSDK_WATCHDOG_CLOCKS_CLOCK_FREQUENCY;
|
||||
flags = config->flags;
|
||||
|
||||
wdog->load = reload_s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue