/* * Read the status early, in case of an error, we haven't modified the * hardware.
*/
ret = regmap_read(wdt->regmap, wdt->offset + WDT_CTRL, &status); if (ret) return ret;
/* * Initial timeout value, may be overwritten by device tree or module * parameter in watchdog_init_timeout(). * * Reading a zero here means that either the hardware has a default * value of zero (which is very unlikely and definitely a hardware * bug) or the bootloader set it to zero. In any case, we handle * this case gracefully and set out own timeout.
*/
ret = regmap_read(wdt->regmap, wdt->offset + WDT_TIMEOUT, &val); if (ret) return ret;
if (val)
wdd->timeout = val; else
wdd->timeout = WDT_DEFAULT_TIMEOUT;
/* if the watchdog is locked, we set nowayout */ if (status & WDT_CTRL_LOCK)
nowayout = true;
watchdog_set_nowayout(wdd, nowayout);
/* * If watchdog is already running, keep it enabled, but make * sure its mode is set correctly.
*/ if (status & WDT_CTRL_EN) {
sl28cpld_wdt_start(wdd);
set_bit(WDOG_HW_RUNNING, &wdd->status);
}
ret = devm_watchdog_register_device(&pdev->dev, wdd); if (ret < 0) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.