aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/mpc8xx_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/watchdog/mpc8xx_wdt.c')
-rw-r--r--drivers/char/watchdog/mpc8xx_wdt.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/watchdog/mpc8xx_wdt.c b/drivers/char/watchdog/mpc8xx_wdt.c
index 56d62ba7c6ce..ac6fbace4724 100644
--- a/drivers/char/watchdog/mpc8xx_wdt.c
+++ b/drivers/char/watchdog/mpc8xx_wdt.c
@@ -27,7 +27,10 @@ static void mpc8xx_wdt_handler_disable(void)
27{ 27{
28 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 28 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
29 29
30 imap->im_sit.sit_piscr &= ~(PISCR_PIE | PISCR_PTE); 30 if (!m8xx_has_internal_rtc)
31 m8xx_wdt_stop_timer();
32 else
33 out_be32(imap->im_sit.sit_piscr, in_be32(&imap->im_sit.sit_piscr) & ~(PISCR_PIE | PISCR_PTE));
31 34
32 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n"); 35 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
33} 36}
@@ -36,7 +39,10 @@ static void mpc8xx_wdt_handler_enable(void)
36{ 39{
37 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR; 40 volatile immap_t *imap = (volatile immap_t *)IMAP_ADDR;
38 41
39 imap->im_sit.sit_piscr |= PISCR_PIE | PISCR_PTE; 42 if (!m8xx_has_internal_rtc)
43 m8xx_wdt_install_timer();
44 else
45 out_be32(&imap->im_sit.sit_piscr, in_be32(&imap->im_sit.sit_piscr) | PISCR_PIE | PISCR_PTE);
40 46
41 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n"); 47 printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
42} 48}
@@ -68,9 +74,6 @@ static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
68static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len, 74static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len,
69 loff_t * ppos) 75 loff_t * ppos)
70{ 76{
71 if (ppos != &file->f_pos)
72 return -ESPIPE;
73
74 if (len) 77 if (len)
75 m8xx_wdt_reset(); 78 m8xx_wdt_reset();
76 79