aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/iTCO_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/watchdog/iTCO_wdt.c')
-rw-r--r--drivers/char/watchdog/iTCO_wdt.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c
index aaac94db0d8b..b6f29cb8bd39 100644
--- a/drivers/char/watchdog/iTCO_wdt.c
+++ b/drivers/char/watchdog/iTCO_wdt.c
@@ -35,6 +35,10 @@
35 * 82801GDH (ICH7DH) : document number 307013-002, 307014-009, 35 * 82801GDH (ICH7DH) : document number 307013-002, 307014-009,
36 * 82801GBM (ICH7-M) : document number 307013-002, 307014-009, 36 * 82801GBM (ICH7-M) : document number 307013-002, 307014-009,
37 * 82801GHM (ICH7-M DH) : document number 307013-002, 307014-009, 37 * 82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
38 * 82801HB (ICH8) : document number 313056-002, 313057-004,
39 * 82801HR (ICH8R) : document number 313056-002, 313057-004,
40 * 82801HH (ICH8DH) : document number 313056-002, 313057-004,
41 * 82801HO (ICH8DO) : document number 313056-002, 313057-004,
38 * 6300ESB (6300ESB) : document number 300641-003 42 * 6300ESB (6300ESB) : document number 300641-003
39 */ 43 */
40 44
@@ -45,7 +49,7 @@
45/* Module and version information */ 49/* Module and version information */
46#define DRV_NAME "iTCO_wdt" 50#define DRV_NAME "iTCO_wdt"
47#define DRV_VERSION "1.00" 51#define DRV_VERSION "1.00"
48#define DRV_RELDATE "30-Jul-2006" 52#define DRV_RELDATE "08-Oct-2006"
49#define PFX DRV_NAME ": " 53#define PFX DRV_NAME ": "
50 54
51/* Includes */ 55/* Includes */
@@ -85,6 +89,9 @@ enum iTCO_chipsets {
85 TCO_ICH7, /* ICH7 & ICH7R */ 89 TCO_ICH7, /* ICH7 & ICH7R */
86 TCO_ICH7M, /* ICH7-M */ 90 TCO_ICH7M, /* ICH7-M */
87 TCO_ICH7MDH, /* ICH7-M DH */ 91 TCO_ICH7MDH, /* ICH7-M DH */
92 TCO_ICH8, /* ICH8 & ICH8R */
93 TCO_ICH8DH, /* ICH8DH */
94 TCO_ICH8DO, /* ICH8DO */
88}; 95};
89 96
90static struct { 97static struct {
@@ -108,6 +115,9 @@ static struct {
108 {"ICH7 or ICH7R", 2}, 115 {"ICH7 or ICH7R", 2},
109 {"ICH7-M", 2}, 116 {"ICH7-M", 2},
110 {"ICH7-M DH", 2}, 117 {"ICH7-M DH", 2},
118 {"ICH8 or ICH8R", 2},
119 {"ICH8DH", 2},
120 {"ICH8DO", 2},
111 {NULL,0} 121 {NULL,0}
112}; 122};
113 123
@@ -135,6 +145,9 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
135 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7 }, 145 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7 },
136 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M }, 146 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M },
137 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH }, 147 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH },
148 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8 },
149 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH },
150 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO },
138 { 0, }, /* End of list */ 151 { 0, }, /* End of list */
139}; 152};
140MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl); 153MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
@@ -355,7 +368,8 @@ static int iTCO_wdt_get_timeleft (int *time_left)
355 spin_unlock(&iTCO_wdt_private.io_lock); 368 spin_unlock(&iTCO_wdt_private.io_lock);
356 369
357 *time_left = (val8 * 6) / 10; 370 *time_left = (val8 * 6) / 10;
358 } 371 } else
372 return -EINVAL;
359 return 0; 373 return 0;
360} 374}
361 375
@@ -426,7 +440,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
426{ 440{
427 int new_options, retval = -EINVAL; 441 int new_options, retval = -EINVAL;
428 int new_heartbeat; 442 int new_heartbeat;
429 int time_left;
430 void __user *argp = (void __user *)arg; 443 void __user *argp = (void __user *)arg;
431 int __user *p = argp; 444 int __user *p = argp;
432 static struct watchdog_info ident = { 445 static struct watchdog_info ident = {
@@ -486,6 +499,8 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
486 499
487 case WDIOC_GETTIMELEFT: 500 case WDIOC_GETTIMELEFT:
488 { 501 {
502 int time_left;
503
489 if (iTCO_wdt_get_timeleft(&time_left)) 504 if (iTCO_wdt_get_timeleft(&time_left))
490 return -EINVAL; 505 return -EINVAL;
491 506