aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjwysocki@sisk.pl>2005-07-24 14:22:00 -0400
committerLen Brown <len.brown@intel.com>2005-07-29 22:04:26 -0400
commit90158b83204842c0108d744326868d91cc9c4dfd (patch)
tree15abc30cd06051d74a3caa935d54b1352e2a0978 /drivers
parent4b31e77455b868b43e665edceb111c9a330c8e0f (diff)
[ACPI] fix resume issues on Asus L5D
http://bugzilla.kernel.org/show_bug.cgi?id=4416 Signed-off-by: Rafael J. Wysocki <rjwysocki@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sk98lin/skge.c63
-rw-r--r--drivers/pcmcia/yenta_socket.c9
2 files changed, 72 insertions, 0 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 05b827f79f54..7bfaef9305b2 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -5134,6 +5134,67 @@ static void __devexit skge_remove_one(struct pci_dev *pdev)
5134 kfree(pAC); 5134 kfree(pAC);
5135} 5135}
5136 5136
5137#ifdef CONFIG_PM
5138static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
5139{
5140 struct net_device *dev = pci_get_drvdata(pdev);
5141 DEV_NET *pNet = netdev_priv(dev);
5142 SK_AC *pAC = pNet->pAC;
5143 struct net_device *otherdev = pAC->dev[1];
5144
5145 if (pNet->Up) {
5146 pAC->WasIfUp[0] = SK_TRUE;
5147 DoPrintInterfaceChange = SK_FALSE;
5148 SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */
5149 }
5150 if (otherdev != dev) {
5151 pNet = netdev_priv(otherdev);
5152 if (pNet->Up) {
5153 pAC->WasIfUp[1] = SK_TRUE;
5154 DoPrintInterfaceChange = SK_FALSE;
5155 SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */
5156 }
5157 }
5158
5159 pci_save_state(pdev);
5160 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
5161 if (pAC->AllocFlag & SK_ALLOC_IRQ) {
5162 free_irq(dev->irq, dev);
5163 }
5164 pci_disable_device(pdev);
5165 pci_set_power_state(pdev, pci_choose_state(pdev, state));
5166
5167 return 0;
5168}
5169
5170static int skge_resume(struct pci_dev *pdev)
5171{
5172 struct net_device *dev = pci_get_drvdata(pdev);
5173 DEV_NET *pNet = netdev_priv(dev);
5174 SK_AC *pAC = pNet->pAC;
5175
5176 pci_set_power_state(pdev, PCI_D0);
5177 pci_restore_state(pdev);
5178 pci_enable_device(pdev);
5179 pci_set_master(pdev);
5180 if (pAC->GIni.GIMacsFound == 2)
5181 request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev);
5182 else
5183 request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev);
5184
5185 if (pAC->WasIfUp[0] == SK_TRUE) {
5186 DoPrintInterfaceChange = SK_FALSE;
5187 SkDrvInitAdapter(pAC, 0); /* first device */
5188 }
5189 if (pAC->dev[1] != dev && pAC->WasIfUp[1] == SK_TRUE) {
5190 DoPrintInterfaceChange = SK_FALSE;
5191 SkDrvInitAdapter(pAC, 1); /* first device */
5192 }
5193
5194 return 0;
5195}
5196#endif
5197
5137static struct pci_device_id skge_pci_tbl[] = { 5198static struct pci_device_id skge_pci_tbl[] = {
5138 { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 5199 { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
5139 { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 5200 { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
@@ -5159,6 +5220,8 @@ static struct pci_driver skge_driver = {
5159 .id_table = skge_pci_tbl, 5220 .id_table = skge_pci_tbl,
5160 .probe = skge_probe_one, 5221 .probe = skge_probe_one,
5161 .remove = __devexit_p(skge_remove_one), 5222 .remove = __devexit_p(skge_remove_one),
5223 .suspend = skge_suspend,
5224 .resume = skge_resume,
5162}; 5225};
5163 5226
5164static int __init skge_init(void) 5227static int __init skge_init(void)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index caf7159a54be..a8a9d954bcf4 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1034,6 +1034,8 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
1034 pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); 1034 pci_read_config_dword(dev, 17*4, &socket->saved_state[1]);
1035 pci_disable_device(dev); 1035 pci_disable_device(dev);
1036 1036
1037 free_irq(dev->irq, socket);
1038
1037 /* 1039 /*
1038 * Some laptops (IBM T22) do not like us putting the Cardbus 1040 * Some laptops (IBM T22) do not like us putting the Cardbus
1039 * bridge into D3. At a guess, some other laptop will 1041 * bridge into D3. At a guess, some other laptop will
@@ -1059,6 +1061,13 @@ static int yenta_dev_resume (struct pci_dev *dev)
1059 pci_enable_device(dev); 1061 pci_enable_device(dev);
1060 pci_set_master(dev); 1062 pci_set_master(dev);
1061 1063
1064 if (socket->cb_irq)
1065 if (request_irq(socket->cb_irq, yenta_interrupt,
1066 SA_SHIRQ, "yenta", socket)) {
1067 printk(KERN_WARNING "Yenta: request_irq() failed on resume!\n");
1068 socket->cb_irq = 0;
1069 }
1070
1062 if (socket->type && socket->type->restore_state) 1071 if (socket->type && socket->type->restore_state)
1063 socket->type->restore_state(socket); 1072 socket->type->restore_state(socket);
1064 } 1073 }