Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: rzg2l_wdt: Add set_timeout callback

This patch adds support for set_timeout callback.

Once WDT is started, the WDT cycle setting register(WDTSET) can be updated
only after issuing a module reset. Otherwise, it will ignore the writes
and will hold the previous value. This patch updates the WDTSET register
if it is active.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220225175320.11041-8-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Biju Das and committed by
Wim Van Sebroeck
4055ee81 f43e6ddb

+20
+20
drivers/watchdog/rzg2l_wdt.c
··· 115 115 return 0; 116 116 } 117 117 118 + static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout) 119 + { 120 + struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); 121 + 122 + wdev->timeout = timeout; 123 + 124 + /* 125 + * If the watchdog is active, reset the module for updating the WDTSET 126 + * register so that it is updated with new timeout values. 127 + */ 128 + if (watchdog_active(wdev)) { 129 + pm_runtime_put(wdev->parent); 130 + reset_control_reset(priv->rstc); 131 + rzg2l_wdt_start(wdev); 132 + } 133 + 134 + return 0; 135 + } 136 + 118 137 static int rzg2l_wdt_restart(struct watchdog_device *wdev, 119 138 unsigned long action, void *data) 120 139 { ··· 170 151 .start = rzg2l_wdt_start, 171 152 .stop = rzg2l_wdt_stop, 172 153 .ping = rzg2l_wdt_ping, 154 + .set_timeout = rzg2l_wdt_set_timeout, 173 155 .restart = rzg2l_wdt_restart, 174 156 }; 175 157