Skip to content

Commit

Permalink
drivers: wdog_cmsdk_apb: Get clock frequency from DTS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pizi-nordic authored and carlescufi committed Jul 24, 2019
1 parent 08f8abc commit a901e32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/watchdog/wdt_cmsdk_apb.c
Expand Up @@ -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;
Expand Down

0 comments on commit a901e32

Please sign in to comment.