diff options
Diffstat (limited to 'drivers/watchdog/pc87413_wdt.c')
-rw-r--r-- | drivers/watchdog/pc87413_wdt.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index 5fc7f1349950..e91ada72da1d 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | /* #define DEBUG 1 */ | 39 | /* #define DEBUG 1 */ |
40 | 40 | ||
41 | #define DEFAULT_TIMEOUT 1 /* 1 minute */ | 41 | #define DEFAULT_TIMEOUT 1 /* 1 minute */ |
42 | #define MAX_TIMEOUT 255 | 42 | #define MAX_TIMEOUT 255 |
43 | 43 | ||
44 | #define VERSION "1.1" | 44 | #define VERSION "1.1" |
@@ -46,17 +46,17 @@ | |||
46 | #define PFX MODNAME ": " | 46 | #define PFX MODNAME ": " |
47 | #define DPFX MODNAME " - DEBUG: " | 47 | #define DPFX MODNAME " - DEBUG: " |
48 | 48 | ||
49 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ | 49 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ |
50 | #define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1) | 50 | #define WDT_DATA_IO_PORT (WDT_INDEX_IO_PORT+1) |
51 | #define SWC_LDN 0x04 | 51 | #define SWC_LDN 0x04 |
52 | #define SIOCFG2 0x22 /* Serial IO register */ | 52 | #define SIOCFG2 0x22 /* Serial IO register */ |
53 | #define WDCTL 0x10 /* Watchdog-Timer-Controll-Register */ | 53 | #define WDCTL 0x10 /* Watchdog-Timer-Controll-Register */ |
54 | #define WDTO 0x11 /* Watchdog timeout register */ | 54 | #define WDTO 0x11 /* Watchdog timeout register */ |
55 | #define WDCFG 0x12 /* Watchdog config register */ | 55 | #define WDCFG 0x12 /* Watchdog config register */ |
56 | 56 | ||
57 | static int io = 0x2E; /* Address used on Portwell Boards */ | 57 | static int io = 0x2E; /* Address used on Portwell Boards */ |
58 | 58 | ||
59 | static int timeout = DEFAULT_TIMEOUT; /* timeout value */ | 59 | static int timeout = DEFAULT_TIMEOUT; /* timeout value */ |
60 | static unsigned long timer_enabled; /* is the timer enabled? */ | 60 | static unsigned long timer_enabled; /* is the timer enabled? */ |
61 | 61 | ||
62 | static char expect_close; /* is the close expected? */ | 62 | static char expect_close; /* is the close expected? */ |
@@ -99,14 +99,14 @@ static inline void pc87413_enable_swc(void) | |||
99 | 99 | ||
100 | /* Step 2: Enable SWC functions */ | 100 | /* Step 2: Enable SWC functions */ |
101 | 101 | ||
102 | outb_p(0x07, WDT_INDEX_IO_PORT); /* Point SWC_LDN (LDN=4) */ | 102 | outb_p(0x07, WDT_INDEX_IO_PORT); /* Point SWC_LDN (LDN=4) */ |
103 | outb_p(SWC_LDN, WDT_DATA_IO_PORT); | 103 | outb_p(SWC_LDN, WDT_DATA_IO_PORT); |
104 | 104 | ||
105 | outb_p(0x30, WDT_INDEX_IO_PORT); /* Read Index 0x30 First */ | 105 | outb_p(0x30, WDT_INDEX_IO_PORT); /* Read Index 0x30 First */ |
106 | cr_data = inb(WDT_DATA_IO_PORT); | 106 | cr_data = inb(WDT_DATA_IO_PORT); |
107 | cr_data |= 0x01; /* Set Bit0 to 1 */ | 107 | cr_data |= 0x01; /* Set Bit0 to 1 */ |
108 | outb_p(0x30, WDT_INDEX_IO_PORT); | 108 | outb_p(0x30, WDT_INDEX_IO_PORT); |
109 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ | 109 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ |
110 | 110 | ||
111 | #ifdef DEBUG | 111 | #ifdef DEBUG |
112 | printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); | 112 | printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); |
@@ -122,10 +122,10 @@ static inline unsigned int pc87413_get_swc_base(void) | |||
122 | 122 | ||
123 | /* Step 3: Read SWC I/O Base Address */ | 123 | /* Step 3: Read SWC I/O Base Address */ |
124 | 124 | ||
125 | outb_p(0x60, WDT_INDEX_IO_PORT); /* Read Index 0x60 */ | 125 | outb_p(0x60, WDT_INDEX_IO_PORT); /* Read Index 0x60 */ |
126 | addr_h = inb(WDT_DATA_IO_PORT); | 126 | addr_h = inb(WDT_DATA_IO_PORT); |
127 | 127 | ||
128 | outb_p(0x61, WDT_INDEX_IO_PORT); /* Read Index 0x61 */ | 128 | outb_p(0x61, WDT_INDEX_IO_PORT); /* Read Index 0x61 */ |
129 | 129 | ||
130 | addr_l = inb(WDT_DATA_IO_PORT); | 130 | addr_l = inb(WDT_DATA_IO_PORT); |
131 | 131 | ||
@@ -374,7 +374,7 @@ static ssize_t pc87413_write(struct file *file, const char __user *data, | |||
374 | magic character */ | 374 | magic character */ |
375 | for (i = 0; i != len; i++) { | 375 | for (i = 0; i != len; i++) { |
376 | char c; | 376 | char c; |
377 | if (get_user(c, data+i)) | 377 | if (get_user(c, data + i)) |
378 | return -EFAULT; | 378 | return -EFAULT; |
379 | if (c == 'V') | 379 | if (c == 'V') |
380 | expect_close = 42; | 380 | expect_close = 42; |
@@ -413,7 +413,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd, | |||
413 | WDIOF_SETTIMEOUT | | 413 | WDIOF_SETTIMEOUT | |
414 | WDIOF_MAGICCLOSE, | 414 | WDIOF_MAGICCLOSE, |
415 | .firmware_version = 1, | 415 | .firmware_version = 1, |
416 | .identity = "PC87413(HF/F) watchdog" | 416 | .identity = "PC87413(HF/F) watchdog", |
417 | }; | 417 | }; |
418 | 418 | ||
419 | uarg.i = (int __user *)arg; | 419 | uarg.i = (int __user *)arg; |
@@ -507,7 +507,7 @@ static struct notifier_block pc87413_notifier = { | |||
507 | static struct miscdevice pc87413_miscdev = { | 507 | static struct miscdevice pc87413_miscdev = { |
508 | .minor = WATCHDOG_MINOR, | 508 | .minor = WATCHDOG_MINOR, |
509 | .name = "watchdog", | 509 | .name = "watchdog", |
510 | .fops = &pc87413_fops | 510 | .fops = &pc87413_fops, |
511 | }; | 511 | }; |
512 | 512 | ||
513 | /* -- Module init functions -------------------------------------*/ | 513 | /* -- Module init functions -------------------------------------*/ |
@@ -567,9 +567,9 @@ static void __exit pc87413_exit(void) | |||
567 | 567 | ||
568 | misc_deregister(&pc87413_miscdev); | 568 | misc_deregister(&pc87413_miscdev); |
569 | unregister_reboot_notifier(&pc87413_notifier); | 569 | unregister_reboot_notifier(&pc87413_notifier); |
570 | /* release_region(io,2); */ | 570 | /* release_region(io, 2); */ |
571 | 571 | ||
572 | printk(MODNAME " watchdog component driver removed.\n"); | 572 | printk(KERN_INFO MODNAME " watchdog component driver removed.\n"); |
573 | } | 573 | } |
574 | 574 | ||
575 | module_init(pc87413_init); | 575 | module_init(pc87413_init); |