asm9260_wdt.c (fcc6da076a38f53d6df374fe5c9f1325eea25a00) | asm9260_wdt.c (d94fa4655ed79784388cb49c17c5e9967ddfb4b9) |
---|---|
1/* 2 * Watchdog driver for Alphascale ASM9260. 3 * 4 * Copyright (c) 2014 Oleksij Rempel <linux@rempel-privat.de> 5 * 6 * Licensed under GPLv2 or later. 7 */ 8 --- 68 unchanged lines hidden (view full) --- 77 78static unsigned int asm9260_wdt_gettimeleft(struct watchdog_device *wdd) 79{ 80 struct asm9260_wdt_priv *priv = watchdog_get_drvdata(wdd); 81 u32 counter; 82 83 counter = ioread32(priv->iobase + HW_WDTV); 84 | 1/* 2 * Watchdog driver for Alphascale ASM9260. 3 * 4 * Copyright (c) 2014 Oleksij Rempel <linux@rempel-privat.de> 5 * 6 * Licensed under GPLv2 or later. 7 */ 8 --- 68 unchanged lines hidden (view full) --- 77 78static unsigned int asm9260_wdt_gettimeleft(struct watchdog_device *wdd) 79{ 80 struct asm9260_wdt_priv *priv = watchdog_get_drvdata(wdd); 81 u32 counter; 82 83 counter = ioread32(priv->iobase + HW_WDTV); 84 |
85 return DIV_ROUND_CLOSEST(counter, priv->wdt_freq); | 85 return counter / priv->wdt_freq; |
86} 87 88static int asm9260_wdt_updatetimeout(struct watchdog_device *wdd) 89{ 90 struct asm9260_wdt_priv *priv = watchdog_get_drvdata(wdd); 91 u32 counter; 92 93 counter = wdd->timeout * priv->wdt_freq; --- 301 unchanged lines hidden --- | 86} 87 88static int asm9260_wdt_updatetimeout(struct watchdog_device *wdd) 89{ 90 struct asm9260_wdt_priv *priv = watchdog_get_drvdata(wdd); 91 u32 counter; 92 93 counter = wdd->timeout * priv->wdt_freq; --- 301 unchanged lines hidden --- |