aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pcmcia/at91_cf.c2
-rw-r--r--drivers/pcmcia/au1000_generic.c2
-rw-r--r--drivers/pcmcia/bfin_cf_pcmcia.c2
-rw-r--r--drivers/pcmcia/cs.c2
-rw-r--r--drivers/pcmcia/i82092.c2
-rw-r--r--drivers/pcmcia/i82365.c2
-rw-r--r--drivers/pcmcia/m32r_cfc.c2
-rw-r--r--drivers/pcmcia/m32r_pcc.c2
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c2
-rw-r--r--drivers/pcmcia/omap_cf.c2
-rw-r--r--drivers/pcmcia/pd6729.c2
-rw-r--r--drivers/pcmcia/pxa2xx_base.c2
-rw-r--r--drivers/pcmcia/sa1100_generic.c2
-rw-r--r--drivers/pcmcia/sa1111_generic.c2
-rw-r--r--drivers/pcmcia/tcic.c2
-rw-r--r--drivers/pcmcia/vrc4171_card.c2
-rw-r--r--drivers/pcmcia/yenta_socket.c88
-rw-r--r--include/pcmcia/ss.h2
18 files changed, 65 insertions, 57 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 9e1140f085fd..e1dccedc5960 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -363,7 +363,7 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
363 struct at91_cf_socket *cf = platform_get_drvdata(pdev); 363 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
364 struct at91_cf_data *board = cf->board; 364 struct at91_cf_data *board = cf->board;
365 365
366 pcmcia_socket_dev_suspend(&pdev->dev, mesg); 366 pcmcia_socket_dev_suspend(&pdev->dev);
367 if (device_may_wakeup(&pdev->dev)) { 367 if (device_may_wakeup(&pdev->dev)) {
368 enable_irq_wake(board->det_pin); 368 enable_irq_wake(board->det_pin);
369 if (board->irq_pin) 369 if (board->irq_pin)
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 90013341cd5f..02088704ac2c 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -515,7 +515,7 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
515static int au1x00_drv_pcmcia_suspend(struct platform_device *dev, 515static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
516 pm_message_t state) 516 pm_message_t state)
517{ 517{
518 return pcmcia_socket_dev_suspend(&dev->dev, state); 518 return pcmcia_socket_dev_suspend(&dev->dev);
519} 519}
520 520
521static int au1x00_drv_pcmcia_resume(struct platform_device *dev) 521static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index b59d4115d20f..300b368605c9 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -302,7 +302,7 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
302 302
303static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg) 303static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
304{ 304{
305 return pcmcia_socket_dev_suspend(&pdev->dev, mesg); 305 return pcmcia_socket_dev_suspend(&pdev->dev);
306} 306}
307 307
308static int bfin_cf_resume(struct platform_device *pdev) 308static int bfin_cf_resume(struct platform_device *pdev)
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 0660ad182589..934d4bee39a0 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
101static int socket_resume(struct pcmcia_socket *skt); 101static int socket_resume(struct pcmcia_socket *skt);
102static int socket_suspend(struct pcmcia_socket *skt); 102static int socket_suspend(struct pcmcia_socket *skt);
103 103
104int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state) 104int pcmcia_socket_dev_suspend(struct device *dev)
105{ 105{
106 struct pcmcia_socket *socket; 106 struct pcmcia_socket *socket;
107 107
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 46561face128..a04f21c8170f 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -42,7 +42,7 @@ MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
42#ifdef CONFIG_PM 42#ifdef CONFIG_PM
43static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state) 43static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
44{ 44{
45 return pcmcia_socket_dev_suspend(&dev->dev, state); 45 return pcmcia_socket_dev_suspend(&dev->dev);
46} 46}
47 47
48static int i82092aa_socket_resume (struct pci_dev *dev) 48static int i82092aa_socket_resume (struct pci_dev *dev)
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 40d4953e4b12..b906abe26ad0 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1241,7 +1241,7 @@ static int pcic_init(struct pcmcia_socket *s)
1241static int i82365_drv_pcmcia_suspend(struct platform_device *dev, 1241static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
1242 pm_message_t state) 1242 pm_message_t state)
1243{ 1243{
1244 return pcmcia_socket_dev_suspend(&dev->dev, state); 1244 return pcmcia_socket_dev_suspend(&dev->dev);
1245} 1245}
1246 1246
1247static int i82365_drv_pcmcia_resume(struct platform_device *dev) 1247static int i82365_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 62b4ecc97c46..d1d89c4491ad 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -699,7 +699,7 @@ static struct pccard_operations pcc_operations = {
699static int cfc_drv_pcmcia_suspend(struct platform_device *dev, 699static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
700 pm_message_t state) 700 pm_message_t state)
701{ 701{
702 return pcmcia_socket_dev_suspend(&dev->dev, state); 702 return pcmcia_socket_dev_suspend(&dev->dev);
703} 703}
704 704
705static int cfc_drv_pcmcia_resume(struct platform_device *dev) 705static int cfc_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 12034b41d196..a0655839c8d3 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -675,7 +675,7 @@ static struct pccard_operations pcc_operations = {
675static int pcc_drv_pcmcia_suspend(struct platform_device *dev, 675static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
676 pm_message_t state) 676 pm_message_t state)
677{ 677{
678 return pcmcia_socket_dev_suspend(&dev->dev, state); 678 return pcmcia_socket_dev_suspend(&dev->dev);
679} 679}
680 680
681static int pcc_drv_pcmcia_resume(struct platform_device *dev) 681static int pcc_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index d1ad0966392d..c69f2c4fe520 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -1296,7 +1296,7 @@ static int m8xx_remove(struct of_device *ofdev)
1296#ifdef CONFIG_PM 1296#ifdef CONFIG_PM
1297static int m8xx_suspend(struct platform_device *pdev, pm_message_t state) 1297static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
1298{ 1298{
1299 return pcmcia_socket_dev_suspend(&pdev->dev, state); 1299 return pcmcia_socket_dev_suspend(&pdev->dev);
1300} 1300}
1301 1301
1302static int m8xx_resume(struct platform_device *pdev) 1302static int m8xx_resume(struct platform_device *pdev)
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index f3736398900e..68570bc3ac86 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -334,7 +334,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
334 334
335static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg) 335static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
336{ 336{
337 return pcmcia_socket_dev_suspend(&pdev->dev, mesg); 337 return pcmcia_socket_dev_suspend(&pdev->dev);
338} 338}
339 339
340static int omap_cf_resume(struct platform_device *pdev) 340static int omap_cf_resume(struct platform_device *pdev)
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 8bed1dab9039..1c39d3438f20 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -758,7 +758,7 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
758#ifdef CONFIG_PM 758#ifdef CONFIG_PM
759static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state) 759static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
760{ 760{
761 return pcmcia_socket_dev_suspend(&dev->dev, state); 761 return pcmcia_socket_dev_suspend(&dev->dev);
762} 762}
763 763
764static int pd6729_socket_resume(struct pci_dev *dev) 764static int pd6729_socket_resume(struct pci_dev *dev)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 87e22ef8eb02..0e35acb1366b 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -302,7 +302,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
302 302
303static int pxa2xx_drv_pcmcia_suspend(struct device *dev) 303static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
304{ 304{
305 return pcmcia_socket_dev_suspend(dev, PMSG_SUSPEND); 305 return pcmcia_socket_dev_suspend(dev);
306} 306}
307 307
308static int pxa2xx_drv_pcmcia_resume(struct device *dev) 308static int pxa2xx_drv_pcmcia_resume(struct device *dev)
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index d8da5ac844e9..2d0e99751530 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -89,7 +89,7 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
89static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev, 89static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
90 pm_message_t state) 90 pm_message_t state)
91{ 91{
92 return pcmcia_socket_dev_suspend(&dev->dev, state); 92 return pcmcia_socket_dev_suspend(&dev->dev);
93} 93}
94 94
95static int sa11x0_drv_pcmcia_resume(struct platform_device *dev) 95static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 401052a21ce8..4be4e172ffa1 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -159,7 +159,7 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
159 159
160static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state) 160static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
161{ 161{
162 return pcmcia_socket_dev_suspend(&dev->dev, state); 162 return pcmcia_socket_dev_suspend(&dev->dev);
163} 163}
164 164
165static int pcmcia_resume(struct sa1111_dev *dev) 165static int pcmcia_resume(struct sa1111_dev *dev)
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 8eb04230fec7..582413fcb62f 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -366,7 +366,7 @@ static int __init get_tcic_id(void)
366static int tcic_drv_pcmcia_suspend(struct platform_device *dev, 366static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
367 pm_message_t state) 367 pm_message_t state)
368{ 368{
369 return pcmcia_socket_dev_suspend(&dev->dev, state); 369 return pcmcia_socket_dev_suspend(&dev->dev);
370} 370}
371 371
372static int tcic_drv_pcmcia_resume(struct platform_device *dev) 372static int tcic_drv_pcmcia_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index d4ad50d737b0..c9fcbdc164ea 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -707,7 +707,7 @@ __setup("vrc4171_card=", vrc4171_card_setup);
707static int vrc4171_card_suspend(struct platform_device *dev, 707static int vrc4171_card_suspend(struct platform_device *dev,
708 pm_message_t state) 708 pm_message_t state)
709{ 709{
710 return pcmcia_socket_dev_suspend(&dev->dev, state); 710 return pcmcia_socket_dev_suspend(&dev->dev);
711} 711}
712 712
713static int vrc4171_card_resume(struct platform_device *dev) 713static int vrc4171_card_resume(struct platform_device *dev)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index b459e87a30ac..abe0e44c6e9e 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1225,60 +1225,71 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
1225} 1225}
1226 1226
1227#ifdef CONFIG_PM 1227#ifdef CONFIG_PM
1228static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) 1228static int yenta_dev_suspend_noirq(struct device *dev)
1229{ 1229{
1230 struct yenta_socket *socket = pci_get_drvdata(dev); 1230 struct pci_dev *pdev = to_pci_dev(dev);
1231 struct yenta_socket *socket = pci_get_drvdata(pdev);
1231 int ret; 1232 int ret;
1232 1233
1233 ret = pcmcia_socket_dev_suspend(&dev->dev, state); 1234 ret = pcmcia_socket_dev_suspend(dev);
1234 1235
1235 if (socket) { 1236 if (!socket)
1236 if (socket->type && socket->type->save_state) 1237 return ret;
1237 socket->type->save_state(socket);
1238 1238
1239 /* FIXME: pci_save_state needs to have a better interface */ 1239 if (socket->type && socket->type->save_state)
1240 pci_save_state(dev); 1240 socket->type->save_state(socket);
1241 pci_read_config_dword(dev, 16*4, &socket->saved_state[0]);
1242 pci_read_config_dword(dev, 17*4, &socket->saved_state[1]);
1243 pci_disable_device(dev);
1244 1241
1245 /* 1242 pci_save_state(pdev);
1246 * Some laptops (IBM T22) do not like us putting the Cardbus 1243 pci_read_config_dword(pdev, 16*4, &socket->saved_state[0]);
1247 * bridge into D3. At a guess, some other laptop will 1244 pci_read_config_dword(pdev, 17*4, &socket->saved_state[1]);
1248 * probably require this, so leave it commented out for now. 1245 pci_disable_device(pdev);
1249 */ 1246
1250 /* pci_set_power_state(dev, 3); */ 1247 /*
1251 } 1248 * Some laptops (IBM T22) do not like us putting the Cardbus
1249 * bridge into D3. At a guess, some other laptop will
1250 * probably require this, so leave it commented out for now.
1251 */
1252 /* pci_set_power_state(dev, 3); */
1252 1253
1253 return ret; 1254 return ret;
1254} 1255}
1255 1256
1256 1257static int yenta_dev_resume_noirq(struct device *dev)
1257static int yenta_dev_resume (struct pci_dev *dev)
1258{ 1258{
1259 struct yenta_socket *socket = pci_get_drvdata(dev); 1259 struct pci_dev *pdev = to_pci_dev(dev);
1260 struct yenta_socket *socket = pci_get_drvdata(pdev);
1261 int ret;
1260 1262
1261 if (socket) { 1263 if (!socket)
1262 int rc; 1264 return 0;
1263 1265
1264 pci_set_power_state(dev, 0); 1266 pci_write_config_dword(pdev, 16*4, socket->saved_state[0]);
1265 /* FIXME: pci_restore_state needs to have a better interface */ 1267 pci_write_config_dword(pdev, 17*4, socket->saved_state[1]);
1266 pci_restore_state(dev);
1267 pci_write_config_dword(dev, 16*4, socket->saved_state[0]);
1268 pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
1269 1268
1270 rc = pci_enable_device(dev); 1269 ret = pci_enable_device(pdev);
1271 if (rc) 1270 if (ret)
1272 return rc; 1271 return ret;
1273 1272
1274 pci_set_master(dev); 1273 pci_set_master(pdev);
1275 1274
1276 if (socket->type && socket->type->restore_state) 1275 if (socket->type && socket->type->restore_state)
1277 socket->type->restore_state(socket); 1276 socket->type->restore_state(socket);
1278 }
1279 1277
1280 return pcmcia_socket_dev_resume(&dev->dev); 1278 return pcmcia_socket_dev_resume(dev);
1281} 1279}
1280
1281static struct dev_pm_ops yenta_pm_ops = {
1282 .suspend_noirq = yenta_dev_suspend_noirq,
1283 .resume_noirq = yenta_dev_resume_noirq,
1284 .freeze_noirq = yenta_dev_suspend_noirq,
1285 .thaw_noirq = yenta_dev_resume_noirq,
1286 .poweroff_noirq = yenta_dev_suspend_noirq,
1287 .restore_noirq = yenta_dev_resume_noirq,
1288};
1289
1290#define YENTA_PM_OPS (&yenta_pm_ops)
1291#else
1292#define YENTA_PM_OPS NULL
1282#endif 1293#endif
1283 1294
1284#define CB_ID(vend,dev,type) \ 1295#define CB_ID(vend,dev,type) \
@@ -1376,10 +1387,7 @@ static struct pci_driver yenta_cardbus_driver = {
1376 .id_table = yenta_table, 1387 .id_table = yenta_table,
1377 .probe = yenta_probe, 1388 .probe = yenta_probe,
1378 .remove = __devexit_p(yenta_close), 1389 .remove = __devexit_p(yenta_close),
1379#ifdef CONFIG_PM 1390 .driver.pm = YENTA_PM_OPS,
1380 .suspend = yenta_dev_suspend,
1381 .resume = yenta_dev_resume,
1382#endif
1383}; 1391};
1384 1392
1385 1393
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 9a3b49865173..d696a692d94a 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -279,7 +279,7 @@ extern struct pccard_resource_ops pccard_iodyn_ops;
279extern struct pccard_resource_ops pccard_nonstatic_ops; 279extern struct pccard_resource_ops pccard_nonstatic_ops;
280 280
281/* socket drivers are expected to use these callbacks in their .drv struct */ 281/* socket drivers are expected to use these callbacks in their .drv struct */
282extern int pcmcia_socket_dev_suspend(struct device *dev, pm_message_t state); 282extern int pcmcia_socket_dev_suspend(struct device *dev);
283extern int pcmcia_socket_dev_resume(struct device *dev); 283extern int pcmcia_socket_dev_resume(struct device *dev);
284 284
285/* socket drivers use this callback in their IRQ handler */ 285/* socket drivers use this callback in their IRQ handler */