watchdog: max77620: Add comment to clarify set_timeout procedure
authorLuca Ceresoli <luca@lucaceresoli.net>
Wed, 23 Feb 2022 17:59:07 +0000 (18:59 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 7 Mar 2022 13:54:58 +0000 (13:54 +0000)
Clarify why we need to ping the watchdog before changing the timeout by
quoting the MAX77714 datasheet.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/watchdog/max77620_wdt.c

index cd321c7e0d5904360526eec420a5b7c6e0c85f9e..b76ad6ba0915c3336e15a52a81c7a8311b2a5a76 100644 (file)
@@ -123,6 +123,11 @@ static int max77620_wdt_set_timeout(struct watchdog_device *wdt_dev,
                break;
        }
 
+       /*
+        * "If the value of TWD needs to be changed, clear the system
+        * watchdog timer first [...], then change the value of TWD."
+        * (MAX77714 datasheet but applies to MAX77620 too)
+        */
        ret = regmap_update_bits(wdt->rmap, wdt->drv_data->reg_cnfg_glbl3,
                                 wdt->drv_data->wdtc_mask, 0x1);
        if (ret < 0)