aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/iTCO_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/iTCO_wdt.c')
-rw-r--r--drivers/watchdog/iTCO_wdt.c114
1 files changed, 66 insertions, 48 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index cd5a565bc3a0..a0e6809e369f 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -35,10 +35,12 @@
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, 38 * 82801HB (ICH8) : document number 313056-003, 313057-009,
39 * 82801HR (ICH8R) : document number 313056-002, 313057-004, 39 * 82801HR (ICH8R) : document number 313056-003, 313057-009,
40 * 82801HH (ICH8DH) : document number 313056-002, 313057-004, 40 * 82801HBM (ICH8M) : document number 313056-003, 313057-009,
41 * 82801HO (ICH8DO) : document number 313056-002, 313057-004, 41 * 82801HH (ICH8DH) : document number 313056-003, 313057-009,
42 * 82801HO (ICH8DO) : document number 313056-003, 313057-009,
43 * 82801HEM (ICH8M-E) : document number 313056-003, 313057-009,
42 * 82801IB (ICH9) : document number 316972-001, 316973-001, 44 * 82801IB (ICH9) : document number 316972-001, 316973-001,
43 * 82801IR (ICH9R) : document number 316972-001, 316973-001, 45 * 82801IR (ICH9R) : document number 316972-001, 316973-001,
44 * 82801IH (ICH9DH) : document number 316972-001, 316973-001, 46 * 82801IH (ICH9DH) : document number 316972-001, 316973-001,
@@ -95,8 +97,10 @@ enum iTCO_chipsets {
95 TCO_ICH7M, /* ICH7-M */ 97 TCO_ICH7M, /* ICH7-M */
96 TCO_ICH7MDH, /* ICH7-M DH */ 98 TCO_ICH7MDH, /* ICH7-M DH */
97 TCO_ICH8, /* ICH8 & ICH8R */ 99 TCO_ICH8, /* ICH8 & ICH8R */
100 TCO_ICH8ME, /* ICH8M-E */
98 TCO_ICH8DH, /* ICH8DH */ 101 TCO_ICH8DH, /* ICH8DH */
99 TCO_ICH8DO, /* ICH8DO */ 102 TCO_ICH8DO, /* ICH8DO */
103 TCO_ICH8M, /* ICH8M */
100 TCO_ICH9, /* ICH9 */ 104 TCO_ICH9, /* ICH9 */
101 TCO_ICH9R, /* ICH9R */ 105 TCO_ICH9R, /* ICH9R */
102 TCO_ICH9DH, /* ICH9DH */ 106 TCO_ICH9DH, /* ICH9DH */
@@ -125,8 +129,10 @@ static struct {
125 {"ICH7-M", 2}, 129 {"ICH7-M", 2},
126 {"ICH7-M DH", 2}, 130 {"ICH7-M DH", 2},
127 {"ICH8 or ICH8R", 2}, 131 {"ICH8 or ICH8R", 2},
132 {"ICH8M-E", 2},
128 {"ICH8DH", 2}, 133 {"ICH8DH", 2},
129 {"ICH8DO", 2}, 134 {"ICH8DO", 2},
135 {"ICH8M", 2},
130 {"ICH9", 2}, 136 {"ICH9", 2},
131 {"ICH9R", 2}, 137 {"ICH9R", 2},
132 {"ICH9DH", 2}, 138 {"ICH9DH", 2},
@@ -134,6 +140,15 @@ static struct {
134 {NULL,0} 140 {NULL,0}
135}; 141};
136 142
143#define ITCO_PCI_DEVICE(dev, data) \
144 .vendor = PCI_VENDOR_ID_INTEL, \
145 .device = dev, \
146 .subvendor = PCI_ANY_ID, \
147 .subdevice = PCI_ANY_ID, \
148 .class = 0, \
149 .class_mask = 0, \
150 .driver_data = data
151
137/* 152/*
138 * This data only exists for exporting the supported PCI ids 153 * This data only exists for exporting the supported PCI ids
139 * via MODULE_DEVICE_TABLE. We do not actually register a 154 * via MODULE_DEVICE_TABLE. We do not actually register a
@@ -141,45 +156,47 @@ static struct {
141 * functions that probably will be registered by other drivers. 156 * functions that probably will be registered by other drivers.
142 */ 157 */
143static struct pci_device_id iTCO_wdt_pci_tbl[] = { 158static struct pci_device_id iTCO_wdt_pci_tbl[] = {
144 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH }, 159 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AA_0, TCO_ICH )},
145 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH0 }, 160 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801AB_0, TCO_ICH0 )},
146 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2 }, 161 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_0, TCO_ICH2 )},
147 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2M }, 162 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801BA_10, TCO_ICH2M )},
148 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3 }, 163 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_0, TCO_ICH3 )},
149 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3M }, 164 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801CA_12, TCO_ICH3M )},
150 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4 }, 165 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_0, TCO_ICH4 )},
151 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4M }, 166 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801DB_12, TCO_ICH4M )},
152 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_CICH }, 167 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801E_0, TCO_CICH )},
153 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH5 }, 168 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_82801EB_0, TCO_ICH5 )},
154 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_6300ESB }, 169 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB_1, TCO_6300ESB)},
155 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6 }, 170 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_0, TCO_ICH6 )},
156 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6M }, 171 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_1, TCO_ICH6M )},
157 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6W }, 172 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH6_2, TCO_ICH6W )},
158 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7 }, 173 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_0, TCO_ICH7 )},
159 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M }, 174 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_1, TCO_ICH7M )},
160 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH }, 175 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH7_31, TCO_ICH7MDH)},
161 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8 }, 176 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_0, TCO_ICH8 )},
162 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH }, 177 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_1, TCO_ICH8ME )},
163 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO }, 178 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_2, TCO_ICH8DH )},
164 { PCI_VENDOR_ID_INTEL, 0x2918, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9 }, 179 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_3, TCO_ICH8DO )},
165 { PCI_VENDOR_ID_INTEL, 0x2916, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9R }, 180 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH8_4, TCO_ICH8M )},
166 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9DH }, 181 { ITCO_PCI_DEVICE(0x2918, TCO_ICH9 )},
167 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 182 { ITCO_PCI_DEVICE(0x2916, TCO_ICH9R )},
168 { PCI_VENDOR_ID_INTEL, 0x2671, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 183 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ICH9_2, TCO_ICH9DH )},
169 { PCI_VENDOR_ID_INTEL, 0x2672, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 184 { ITCO_PCI_DEVICE(PCI_DEVICE_ID_INTEL_ESB2_0, TCO_631XESB)},
170 { PCI_VENDOR_ID_INTEL, 0x2673, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 185 { ITCO_PCI_DEVICE(0x2671, TCO_631XESB)},
171 { PCI_VENDOR_ID_INTEL, 0x2674, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 186 { ITCO_PCI_DEVICE(0x2672, TCO_631XESB)},
172 { PCI_VENDOR_ID_INTEL, 0x2675, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 187 { ITCO_PCI_DEVICE(0x2673, TCO_631XESB)},
173 { PCI_VENDOR_ID_INTEL, 0x2676, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 188 { ITCO_PCI_DEVICE(0x2674, TCO_631XESB)},
174 { PCI_VENDOR_ID_INTEL, 0x2677, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 189 { ITCO_PCI_DEVICE(0x2675, TCO_631XESB)},
175 { PCI_VENDOR_ID_INTEL, 0x2678, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 190 { ITCO_PCI_DEVICE(0x2676, TCO_631XESB)},
176 { PCI_VENDOR_ID_INTEL, 0x2679, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 191 { ITCO_PCI_DEVICE(0x2677, TCO_631XESB)},
177 { PCI_VENDOR_ID_INTEL, 0x267a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 192 { ITCO_PCI_DEVICE(0x2678, TCO_631XESB)},
178 { PCI_VENDOR_ID_INTEL, 0x267b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 193 { ITCO_PCI_DEVICE(0x2679, TCO_631XESB)},
179 { PCI_VENDOR_ID_INTEL, 0x267c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 194 { ITCO_PCI_DEVICE(0x267a, TCO_631XESB)},
180 { PCI_VENDOR_ID_INTEL, 0x267d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 195 { ITCO_PCI_DEVICE(0x267b, TCO_631XESB)},
181 { PCI_VENDOR_ID_INTEL, 0x267e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 196 { ITCO_PCI_DEVICE(0x267c, TCO_631XESB)},
182 { PCI_VENDOR_ID_INTEL, 0x267f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB }, 197 { ITCO_PCI_DEVICE(0x267d, TCO_631XESB)},
198 { ITCO_PCI_DEVICE(0x267e, TCO_631XESB)},
199 { ITCO_PCI_DEVICE(0x267f, TCO_631XESB)},
183 { 0, }, /* End of list */ 200 { 0, }, /* End of list */
184}; 201};
185MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl); 202MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
@@ -300,6 +317,7 @@ static int iTCO_wdt_start(void)
300 317
301 /* disable chipset's NO_REBOOT bit */ 318 /* disable chipset's NO_REBOOT bit */
302 if (iTCO_wdt_unset_NO_REBOOT_bit()) { 319 if (iTCO_wdt_unset_NO_REBOOT_bit()) {
320 spin_unlock(&iTCO_wdt_private.io_lock);
303 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n"); 321 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
304 return -EIO; 322 return -EIO;
305 } 323 }
@@ -590,7 +608,7 @@ static struct miscdevice iTCO_wdt_miscdev = {
590 * Init & exit routines 608 * Init & exit routines
591 */ 609 */
592 610
593static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev) 611static int __devinit iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev)
594{ 612{
595 int ret; 613 int ret;
596 u32 base_address; 614 u32 base_address;
@@ -694,7 +712,7 @@ out:
694 return ret; 712 return ret;
695} 713}
696 714
697static void iTCO_wdt_cleanup(void) 715static void __devexit iTCO_wdt_cleanup(void)
698{ 716{
699 /* Stop the timer before we leave */ 717 /* Stop the timer before we leave */
700 if (!nowayout) 718 if (!nowayout)
@@ -709,7 +727,7 @@ static void iTCO_wdt_cleanup(void)
709 iTCO_wdt_private.ACPIBASE = 0; 727 iTCO_wdt_private.ACPIBASE = 0;
710} 728}
711 729
712static int iTCO_wdt_probe(struct platform_device *dev) 730static int __devinit iTCO_wdt_probe(struct platform_device *dev)
713{ 731{
714 int found = 0; 732 int found = 0;
715 struct pci_dev *pdev = NULL; 733 struct pci_dev *pdev = NULL;
@@ -735,7 +753,7 @@ static int iTCO_wdt_probe(struct platform_device *dev)
735 return 0; 753 return 0;
736} 754}
737 755
738static int iTCO_wdt_remove(struct platform_device *dev) 756static int __devexit iTCO_wdt_remove(struct platform_device *dev)
739{ 757{
740 if (iTCO_wdt_private.ACPIBASE) 758 if (iTCO_wdt_private.ACPIBASE)
741 iTCO_wdt_cleanup(); 759 iTCO_wdt_cleanup();
@@ -753,7 +771,7 @@ static void iTCO_wdt_shutdown(struct platform_device *dev)
753 771
754static struct platform_driver iTCO_wdt_driver = { 772static struct platform_driver iTCO_wdt_driver = {
755 .probe = iTCO_wdt_probe, 773 .probe = iTCO_wdt_probe,
756 .remove = iTCO_wdt_remove, 774 .remove = __devexit_p(iTCO_wdt_remove),
757 .shutdown = iTCO_wdt_shutdown, 775 .shutdown = iTCO_wdt_shutdown,
758 .suspend = iTCO_wdt_suspend, 776 .suspend = iTCO_wdt_suspend,
759 .resume = iTCO_wdt_resume, 777 .resume = iTCO_wdt_resume,