diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/booke_wdt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index c3b78a76f17..225398fd504 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
@@ -42,8 +42,10 @@ u32 booke_wdt_period = WDT_PERIOD_DEFAULT; | |||
42 | 42 | ||
43 | #ifdef CONFIG_FSL_BOOKE | 43 | #ifdef CONFIG_FSL_BOOKE |
44 | #define WDTP(x) ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15)) | 44 | #define WDTP(x) ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15)) |
45 | #define WDTP_MASK (WDTP(0)) | ||
45 | #else | 46 | #else |
46 | #define WDTP(x) (TCR_WP(x)) | 47 | #define WDTP(x) (TCR_WP(x)) |
48 | #define WDTP_MASK (TCR_WP_MASK) | ||
47 | #endif | 49 | #endif |
48 | 50 | ||
49 | static DEFINE_SPINLOCK(booke_wdt_lock); | 51 | static DEFINE_SPINLOCK(booke_wdt_lock); |
@@ -65,6 +67,7 @@ static void __booke_wdt_enable(void *data) | |||
65 | /* clear status before enabling watchdog */ | 67 | /* clear status before enabling watchdog */ |
66 | __booke_wdt_ping(NULL); | 68 | __booke_wdt_ping(NULL); |
67 | val = mfspr(SPRN_TCR); | 69 | val = mfspr(SPRN_TCR); |
70 | val &= ~WDTP_MASK; | ||
68 | val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); | 71 | val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); |
69 | 72 | ||
70 | mtspr(SPRN_TCR, val); | 73 | mtspr(SPRN_TCR, val); |
@@ -114,7 +117,7 @@ static long booke_wdt_ioctl(struct file *file, | |||
114 | case WDIOC_SETTIMEOUT: | 117 | case WDIOC_SETTIMEOUT: |
115 | if (get_user(booke_wdt_period, p)) | 118 | if (get_user(booke_wdt_period, p)) |
116 | return -EFAULT; | 119 | return -EFAULT; |
117 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WDTP(0)) | | 120 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WDTP_MASK) | |
118 | WDTP(booke_wdt_period)); | 121 | WDTP(booke_wdt_period)); |
119 | return 0; | 122 | return 0; |
120 | case WDIOC_GETTIMEOUT: | 123 | case WDIOC_GETTIMEOUT: |