drivers: wdt_gecko: select clock source explicitly

At present wdt_gecko driver supports ULFRCO as its only clock source.
Select the clock explicitly, do not rely on the default configuration
provided by the SiLabs header files. The default configuration is
changing between different SiLabs HAL versions.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
Piotr Mienkowski 2020-04-02 00:19:44 +02:00 committed by Kumar Gala
commit 71c41e5024

View file

@ -137,7 +137,7 @@ static int wdt_gecko_install_timeout(struct device *dev,
const struct wdt_timeout_cfg *cfg)
{
struct wdt_gecko_data *data = DEV_DATA(dev);
WDOG_Init_TypeDef init_defaults = WDOG_INIT_DEFAULT;
data->wdog_config = (WDOG_Init_TypeDef)WDOG_INIT_DEFAULT;
u32_t installed_timeout;
if (data->timeout_installed) {
@ -152,7 +152,9 @@ static int wdt_gecko_install_timeout(struct device *dev,
return -EINVAL;
}
data->wdog_config = init_defaults;
#if defined(_WDOG_CTRL_CLKSEL_MASK)
data->wdog_config.clkSel = wdogClkSelULFRCO;
#endif
data->wdog_config.perSel = (WDOG_PeriodSel_TypeDef)
wdt_gecko_get_persel_from_timeout(cfg->window.max);