aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sa1100_wdt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:36:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:36:49 -0500
commit14a3c4ab0e58d143c7928c9eb2f2610205e13bf2 (patch)
tree885992999d7a1a2fd3586efcf32ebcbcbc3a72aa /drivers/watchdog/sa1100_wdt.c
parent1af237a099a3b8ff56aa384f605c6a68af7bf288 (diff)
parent47992cbdaef2f18a47871b2ed01ad27f568c8b73 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (407 commits) [ARM] pxafb: add support for overlay1 and overlay2 as framebuffer devices [ARM] pxafb: cleanup of the timing checking code [ARM] pxafb: cleanup of the color format manipulation code [ARM] pxafb: add palette format support for LCCR4_PAL_FOR_3 [ARM] pxafb: add support for FBIOPAN_DISPLAY by dma braching [ARM] pxafb: allow pxafb_set_par() to start from arbitrary yoffset [ARM] pxafb: allow video memory size to be configurable [ARM] pxa: add document on the MFP design and how to use it [ARM] sa1100_wdt: don't assume CLOCK_TICK_RATE to be a constant [ARM] rtc-sa1100: don't assume CLOCK_TICK_RATE to be a constant [ARM] pxa/tavorevb: update board support (smartpanel LCD + keypad) [ARM] pxa: Update eseries defconfig [ARM] 5352/1: add w90p910-plat config file [ARM] s3c: S3C options should depend on PLAT_S3C [ARM] mv78xx0: implement GPIO and GPIO interrupt support [ARM] Kirkwood: implement GPIO and GPIO interrupt support [ARM] Orion: share GPIO IRQ handling code [ARM] Orion: share GPIO handling code [ARM] s3c: define __io using the typesafe version [ARM] S3C64XX: Ensure CPU_V6 is selected ...
Diffstat (limited to 'drivers/watchdog/sa1100_wdt.c')
-rw-r--r--drivers/watchdog/sa1100_wdt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index ed01e4c2beff..e19b45794717 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -27,6 +27,7 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29#include <linux/uaccess.h> 29#include <linux/uaccess.h>
30#include <linux/timex.h>
30 31
31#ifdef CONFIG_ARCH_PXA 32#ifdef CONFIG_ARCH_PXA
32#include <mach/pxa-regs.h> 33#include <mach/pxa-regs.h>
@@ -35,8 +36,7 @@
35#include <mach/reset.h> 36#include <mach/reset.h>
36#include <mach/hardware.h> 37#include <mach/hardware.h>
37 38
38#define OSCR_FREQ CLOCK_TICK_RATE 39static unsigned long oscr_freq;
39
40static unsigned long sa1100wdt_users; 40static unsigned long sa1100wdt_users;
41static int pre_margin; 41static int pre_margin;
42static int boot_status; 42static int boot_status;
@@ -123,12 +123,12 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
123 break; 123 break;
124 } 124 }
125 125
126 pre_margin = OSCR_FREQ * time; 126 pre_margin = oscr_freq * time;
127 OSMR3 = OSCR + pre_margin; 127 OSMR3 = OSCR + pre_margin;
128 /*fall through*/ 128 /*fall through*/
129 129
130 case WDIOC_GETTIMEOUT: 130 case WDIOC_GETTIMEOUT:
131 ret = put_user(pre_margin / OSCR_FREQ, p); 131 ret = put_user(pre_margin / oscr_freq, p);
132 break; 132 break;
133 } 133 }
134 return ret; 134 return ret;
@@ -155,6 +155,8 @@ static int __init sa1100dog_init(void)
155{ 155{
156 int ret; 156 int ret;
157 157
158 oscr_freq = get_clock_tick_rate();
159
158 /* 160 /*
159 * Read the reset status, and save it for later. If 161 * Read the reset status, and save it for later. If
160 * we suspend, RCSR will be cleared, and the watchdog 162 * we suspend, RCSR will be cleared, and the watchdog
@@ -162,7 +164,7 @@ static int __init sa1100dog_init(void)
162 */ 164 */
163 boot_status = (reset_status & RESET_STATUS_WATCHDOG) ? 165 boot_status = (reset_status & RESET_STATUS_WATCHDOG) ?
164 WDIOF_CARDRESET : 0; 166 WDIOF_CARDRESET : 0;
165 pre_margin = OSCR_FREQ * margin; 167 pre_margin = oscr_freq * margin;
166 168
167 ret = misc_register(&sa1100dog_miscdev); 169 ret = misc_register(&sa1100dog_miscdev);
168 if (ret == 0) 170 if (ret == 0)