Lines 110-115
static unsigned short i801_smba;
Link Here
|
110 |
static struct pci_driver i801_driver; |
110 |
static struct pci_driver i801_driver; |
111 |
static struct pci_dev *I801_dev; |
111 |
static struct pci_dev *I801_dev; |
112 |
static int isich4; |
112 |
static int isich4; |
|
|
113 |
static u8 saved_auxctl; |
113 |
|
114 |
|
114 |
static int i801_setup(struct pci_dev *dev) |
115 |
static int i801_setup(struct pci_dev *dev) |
115 |
{ |
116 |
{ |
Lines 551-567
static int __devinit i801_probe(struct p
Link Here
|
551 |
return i2c_add_adapter(&i801_adapter); |
552 |
return i2c_add_adapter(&i801_adapter); |
552 |
} |
553 |
} |
553 |
|
554 |
|
|
|
555 |
static void i801_shutdown(struct pci_dev *dev) |
556 |
{ |
557 |
if (isich4) { |
558 |
/* Reset the AUXCTL register on remove, as some |
559 |
BIOSes seem to need PEC to be disabled to restart. */ |
560 |
outb_p(0, SMBAUXCTL); |
561 |
} |
562 |
} |
563 |
|
554 |
static void __devexit i801_remove(struct pci_dev *dev) |
564 |
static void __devexit i801_remove(struct pci_dev *dev) |
555 |
{ |
565 |
{ |
|
|
566 |
i801_shutdown(dev); |
556 |
i2c_del_adapter(&i801_adapter); |
567 |
i2c_del_adapter(&i801_adapter); |
557 |
release_region(i801_smba, (isich4 ? 16 : 8)); |
568 |
release_region(i801_smba, (isich4 ? 16 : 8)); |
558 |
} |
569 |
} |
559 |
|
570 |
|
|
|
571 |
static int i801_suspend(struct pci_dev *dev, pm_message_t state) |
572 |
{ |
573 |
if (isich4) { |
574 |
/* Save and reset the AUXCTL register on suspend, as some |
575 |
BIOSes seem to need PEC to be disabled to resume. */ |
576 |
saved_auxctl = inb_p(SMBAUXCTL); |
577 |
outb_p(0, SMBAUXCTL); |
578 |
} |
579 |
|
580 |
return pci_save_state(dev); |
581 |
} |
582 |
|
583 |
static int i801_resume(struct pci_dev *dev) |
584 |
{ |
585 |
pci_restore_state(dev); |
586 |
|
587 |
if (isich4) |
588 |
outb_p(saved_auxctl, SMBAUXCTL); |
589 |
return 0; |
590 |
} |
591 |
|
560 |
static struct pci_driver i801_driver = { |
592 |
static struct pci_driver i801_driver = { |
561 |
.name = "i801_smbus", |
593 |
.name = "i801_smbus", |
562 |
.id_table = i801_ids, |
594 |
.id_table = i801_ids, |
563 |
.probe = i801_probe, |
595 |
.probe = i801_probe, |
564 |
.remove = __devexit_p(i801_remove), |
596 |
.remove = __devexit_p(i801_remove), |
|
|
597 |
.suspend = i801_suspend, |
598 |
.resume = i801_resume, |
599 |
.shutdown = i801_shutdown, |
565 |
}; |
600 |
}; |
566 |
|
601 |
|
567 |
static int __init i2c_i801_init(void) |
602 |
static int __init i2c_i801_init(void) |