From: Hoan Nguyen An <[email protected]>

Fix setting for bit WOVFE of RWTCSRA. Keep it enable follow hardware document.

Signed-off-by: Hoan Nguyen An <[email protected]>
---
 drivers/watchdog/renesas_wdt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 565dbc1..a6aca0e 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -19,6 +19,7 @@
 
 #define RWTCNT         0
 #define RWTCSRA                4
+#define RWTCSRA_WOVFE  BIT(3)
 #define RWTCSRA_WOVF   BIT(4)
 #define RWTCSRA_WRFLG  BIT(5)
 #define RWTCSRA_TME    BIT(7)
@@ -82,13 +83,14 @@ static int rwdt_start(struct watchdog_device *wdev)
        rwdt_write(priv, val, RWTCSRA);
 
        rwdt_init_timeout(wdev);
-       rwdt_write(priv, priv->cks, RWTCSRA);
+       val |= priv->cks;
+       rwdt_write(priv, val, RWTCSRA);
        rwdt_write(priv, 0, RWTCSRB);
 
        while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG)
                cpu_relax();
-
-       rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
+       /* Enable interrupt and timer */
+       rwdt_write(priv, val | RWTCSRA_WOVFE | RWTCSRA_TME, RWTCSRA);
 
        return 0;
 }
-- 
2.7.4

Reply via email to