diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-30 21:37:12 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-30 21:37:12 -0500 |
commit | 23fd07750a789a66fe88cf173d52a18f1a387da4 (patch) | |
tree | 06fdd6df35fdb835abdaa9b754d62f6b84b97250 /drivers/pcmcia | |
parent | bd787d438a59266af3c9f6351644c85ef1dd21fe (diff) | |
parent | ed28f96ac1960f30f818374d65be71d2fdf811b0 (diff) |
Merge ../linux-2.6 by hand
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/Makefile | 3 | ||||
-rw-r--r-- | drivers/pcmcia/au1000_db1x00.c | 21 | ||||
-rw-r--r-- | drivers/pcmcia/au1000_generic.c | 29 | ||||
-rw-r--r-- | drivers/pcmcia/au1000_generic.h | 4 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 6 | ||||
-rw-r--r-- | drivers/pcmcia/hd64465_ss.c | 20 | ||||
-rw-r--r-- | drivers/pcmcia/i82365.c | 20 | ||||
-rw-r--r-- | drivers/pcmcia/m32r_cfc.c | 21 | ||||
-rw-r--r-- | drivers/pcmcia/m32r_pcc.c | 21 | ||||
-rw-r--r-- | drivers/pcmcia/omap_cf.c | 18 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_base.c | 26 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_sharpsl.c | 31 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 8 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.c | 27 | ||||
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/socket_sysfs.c | 6 | ||||
-rw-r--r-- | drivers/pcmcia/tcic.c | 20 | ||||
-rw-r--r-- | drivers/pcmcia/vrc4171_card.c | 24 | ||||
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 42 |
19 files changed, 142 insertions, 207 deletions
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index cb4861d9cb80..fe37541abbfe 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -43,9 +43,11 @@ pxa2xx_core-y += soc_common.o pxa2xx_base.o | |||
43 | au1x00_ss-y += au1000_generic.o | 43 | au1x00_ss-y += au1000_generic.o |
44 | au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o | 44 | au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o |
45 | au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o | 45 | au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o |
46 | au1x00_ss-$(CONFIG_MIPS_PB1200) += au1000_db1x00.o | ||
46 | au1x00_ss-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o | 47 | au1x00_ss-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o |
47 | au1x00_ss-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o | 48 | au1x00_ss-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o |
48 | au1x00_ss-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o | 49 | au1x00_ss-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o |
50 | au1x00_ss-$(CONFIG_MIPS_DB1200) += au1000_db1x00.o | ||
49 | au1x00_ss-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o | 51 | au1x00_ss-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o |
50 | au1x00_ss-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o | 52 | au1x00_ss-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o |
51 | au1x00_ss-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o | 53 | au1x00_ss-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o |
@@ -58,6 +60,7 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o | |||
58 | sa1100_cs-y += sa1100_generic.o | 60 | sa1100_cs-y += sa1100_generic.o |
59 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o | 61 | sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o |
60 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o | 62 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o |
63 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o | ||
61 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o | 64 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o |
62 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o | 65 | sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o |
63 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o | 66 | sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o |
diff --git a/drivers/pcmcia/au1000_db1x00.c b/drivers/pcmcia/au1000_db1x00.c index 42cf8bfbcc98..24cfee1a412c 100644 --- a/drivers/pcmcia/au1000_db1x00.c +++ b/drivers/pcmcia/au1000_db1x00.c | |||
@@ -40,7 +40,15 @@ | |||
40 | #include <asm/irq.h> | 40 | #include <asm/irq.h> |
41 | #include <asm/signal.h> | 41 | #include <asm/signal.h> |
42 | #include <asm/mach-au1x00/au1000.h> | 42 | #include <asm/mach-au1x00/au1000.h> |
43 | #include <asm/mach-db1x00/db1x00.h> | 43 | |
44 | #if defined(CONFIG_MIPS_DB1200) | ||
45 | #include <db1200.h> | ||
46 | #elif defined(CONFIG_MIPS_PB1200) | ||
47 | #include <pb1200.h> | ||
48 | #else | ||
49 | #include <asm/mach-db1x00/db1x00.h> | ||
50 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
51 | #endif | ||
44 | 52 | ||
45 | #include "au1000_generic.h" | 53 | #include "au1000_generic.h" |
46 | 54 | ||
@@ -50,7 +58,6 @@ | |||
50 | #define debug(x,args...) | 58 | #define debug(x,args...) |
51 | #endif | 59 | #endif |
52 | 60 | ||
53 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
54 | 61 | ||
55 | struct au1000_pcmcia_socket au1000_pcmcia_socket[PCMCIA_NUM_SOCKS]; | 62 | struct au1000_pcmcia_socket au1000_pcmcia_socket[PCMCIA_NUM_SOCKS]; |
56 | extern int au1x00_pcmcia_socket_probe(struct device *, struct pcmcia_low_level *, int, int); | 63 | extern int au1x00_pcmcia_socket_probe(struct device *, struct pcmcia_low_level *, int, int); |
@@ -59,6 +66,8 @@ static int db1x00_pcmcia_hw_init(struct au1000_pcmcia_socket *skt) | |||
59 | { | 66 | { |
60 | #ifdef CONFIG_MIPS_DB1550 | 67 | #ifdef CONFIG_MIPS_DB1550 |
61 | skt->irq = skt->nr ? AU1000_GPIO_5 : AU1000_GPIO_3; | 68 | skt->irq = skt->nr ? AU1000_GPIO_5 : AU1000_GPIO_3; |
69 | #elif defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200) | ||
70 | skt->irq = skt->nr ? BOARD_PC1_INT : BOARD_PC0_INT; | ||
62 | #else | 71 | #else |
63 | skt->irq = skt->nr ? AU1000_GPIO_5 : AU1000_GPIO_2; | 72 | skt->irq = skt->nr ? AU1000_GPIO_5 : AU1000_GPIO_2; |
64 | #endif | 73 | #endif |
@@ -85,11 +94,19 @@ db1x00_pcmcia_socket_state(struct au1000_pcmcia_socket *skt, struct pcmcia_state | |||
85 | switch (skt->nr) { | 94 | switch (skt->nr) { |
86 | case 0: | 95 | case 0: |
87 | vs = bcsr->status & 0x3; | 96 | vs = bcsr->status & 0x3; |
97 | #if defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200) | ||
98 | inserted = BOARD_CARD_INSERTED(0); | ||
99 | #else | ||
88 | inserted = !(bcsr->status & (1<<4)); | 100 | inserted = !(bcsr->status & (1<<4)); |
101 | #endif | ||
89 | break; | 102 | break; |
90 | case 1: | 103 | case 1: |
91 | vs = (bcsr->status & 0xC)>>2; | 104 | vs = (bcsr->status & 0xC)>>2; |
105 | #if defined(CONFIG_MIPS_DB1200) || defined(CONFIG_MIPS_PB1200) | ||
106 | inserted = BOARD_CARD_INSERTED(1); | ||
107 | #else | ||
92 | inserted = !(bcsr->status & (1<<5)); | 108 | inserted = !(bcsr->status & (1<<5)); |
109 | #endif | ||
93 | break; | 110 | break; |
94 | default:/* should never happen */ | 111 | default:/* should never happen */ |
95 | return; | 112 | return; |
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index 470ef756252e..ba48cef3a9dc 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c | |||
@@ -490,7 +490,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) | |||
490 | flush_scheduled_work(); | 490 | flush_scheduled_work(); |
491 | skt->ops->hw_shutdown(skt); | 491 | skt->ops->hw_shutdown(skt); |
492 | au1x00_pcmcia_config_skt(skt, &dead_socket); | 492 | au1x00_pcmcia_config_skt(skt, &dead_socket); |
493 | iounmap(skt->virt_io); | 493 | iounmap(skt->virt_io + (u32)mips_io_port_base); |
494 | skt->virt_io = NULL; | 494 | skt->virt_io = NULL; |
495 | } | 495 | } |
496 | 496 | ||
@@ -519,36 +519,15 @@ static int au1x00_drv_pcmcia_probe(struct device *dev) | |||
519 | } | 519 | } |
520 | 520 | ||
521 | 521 | ||
522 | static int au1x00_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | ||
523 | { | ||
524 | int ret = 0; | ||
525 | if (level == SUSPEND_SAVE_STATE) | ||
526 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
527 | return ret; | ||
528 | } | ||
529 | |||
530 | static int au1x00_drv_pcmcia_resume(struct device *dev, u32 level) | ||
531 | { | ||
532 | int ret = 0; | ||
533 | if (level == RESUME_RESTORE_STATE) | ||
534 | ret = pcmcia_socket_dev_resume(dev); | ||
535 | return ret; | ||
536 | } | ||
537 | |||
538 | |||
539 | static struct device_driver au1x00_pcmcia_driver = { | 522 | static struct device_driver au1x00_pcmcia_driver = { |
540 | .probe = au1x00_drv_pcmcia_probe, | 523 | .probe = au1x00_drv_pcmcia_probe, |
541 | .remove = au1x00_drv_pcmcia_remove, | 524 | .remove = au1x00_drv_pcmcia_remove, |
542 | .name = "au1x00-pcmcia", | 525 | .name = "au1x00-pcmcia", |
543 | .bus = &platform_bus_type, | 526 | .bus = &platform_bus_type, |
544 | .suspend = au1x00_drv_pcmcia_suspend, | 527 | .suspend = pcmcia_socket_dev_suspend, |
545 | .resume = au1x00_drv_pcmcia_resume | 528 | .resume = pcmcia_socket_dev_resume, |
546 | }; | 529 | }; |
547 | 530 | ||
548 | static struct platform_device au1x00_device = { | ||
549 | .name = "au1x00-pcmcia", | ||
550 | .id = 0, | ||
551 | }; | ||
552 | 531 | ||
553 | /* au1x00_pcmcia_init() | 532 | /* au1x00_pcmcia_init() |
554 | * | 533 | * |
@@ -562,7 +541,6 @@ static int __init au1x00_pcmcia_init(void) | |||
562 | int error = 0; | 541 | int error = 0; |
563 | if ((error = driver_register(&au1x00_pcmcia_driver))) | 542 | if ((error = driver_register(&au1x00_pcmcia_driver))) |
564 | return error; | 543 | return error; |
565 | platform_device_register(&au1x00_device); | ||
566 | return error; | 544 | return error; |
567 | } | 545 | } |
568 | 546 | ||
@@ -573,7 +551,6 @@ static int __init au1x00_pcmcia_init(void) | |||
573 | static void __exit au1x00_pcmcia_exit(void) | 551 | static void __exit au1x00_pcmcia_exit(void) |
574 | { | 552 | { |
575 | driver_unregister(&au1x00_pcmcia_driver); | 553 | driver_unregister(&au1x00_pcmcia_driver); |
576 | platform_device_unregister(&au1x00_device); | ||
577 | } | 554 | } |
578 | 555 | ||
579 | module_init(au1x00_pcmcia_init); | 556 | module_init(au1x00_pcmcia_init); |
diff --git a/drivers/pcmcia/au1000_generic.h b/drivers/pcmcia/au1000_generic.h index d5122b1ea94b..b0e7908392a7 100644 --- a/drivers/pcmcia/au1000_generic.h +++ b/drivers/pcmcia/au1000_generic.h | |||
@@ -44,13 +44,13 @@ | |||
44 | /* pcmcia socket 1 needs external glue logic so the memory map | 44 | /* pcmcia socket 1 needs external glue logic so the memory map |
45 | * differs from board to board. | 45 | * differs from board to board. |
46 | */ | 46 | */ |
47 | #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) | 47 | #if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_PB1200) |
48 | #define AU1X_SOCK1_IO 0xF08000000 | 48 | #define AU1X_SOCK1_IO 0xF08000000 |
49 | #define AU1X_SOCK1_PHYS_ATTR 0xF48000000 | 49 | #define AU1X_SOCK1_PHYS_ATTR 0xF48000000 |
50 | #define AU1X_SOCK1_PHYS_MEM 0xF88000000 | 50 | #define AU1X_SOCK1_PHYS_MEM 0xF88000000 |
51 | #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000 | 51 | #define AU1X_SOCK1_PSEUDO_PHYS_ATTR 0xF4800000 |
52 | #define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8800000 | 52 | #define AU1X_SOCK1_PSEUDO_PHYS_MEM 0xF8800000 |
53 | #elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) | 53 | #elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) || defined(CONFIG_MIPS_DB1200) |
54 | #define AU1X_SOCK1_IO 0xF04000000 | 54 | #define AU1X_SOCK1_IO 0xF04000000 |
55 | #define AU1X_SOCK1_PHYS_ATTR 0xF44000000 | 55 | #define AU1X_SOCK1_PHYS_ATTR 0xF44000000 |
56 | #define AU1X_SOCK1_PHYS_MEM 0xF84000000 | 56 | #define AU1X_SOCK1_PHYS_MEM 0xF84000000 |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 080608c7381a..39d096b52926 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -1157,7 +1157,8 @@ static struct pcmcia_callback pcmcia_bus_callback = { | |||
1157 | .requery = pcmcia_bus_rescan, | 1157 | .requery = pcmcia_bus_rescan, |
1158 | }; | 1158 | }; |
1159 | 1159 | ||
1160 | static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev) | 1160 | static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev, |
1161 | struct class_interface *class_intf) | ||
1161 | { | 1162 | { |
1162 | struct pcmcia_socket *socket = class_get_devdata(class_dev); | 1163 | struct pcmcia_socket *socket = class_get_devdata(class_dev); |
1163 | int ret; | 1164 | int ret; |
@@ -1192,7 +1193,8 @@ static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev) | |||
1192 | return 0; | 1193 | return 0; |
1193 | } | 1194 | } |
1194 | 1195 | ||
1195 | static void pcmcia_bus_remove_socket(struct class_device *class_dev) | 1196 | static void pcmcia_bus_remove_socket(struct class_device *class_dev, |
1197 | struct class_interface *class_intf) | ||
1196 | { | 1198 | { |
1197 | struct pcmcia_socket *socket = class_get_devdata(class_dev); | 1199 | struct pcmcia_socket *socket = class_get_devdata(class_dev); |
1198 | 1200 | ||
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index 316f8bcc878b..b57a0b98b4d6 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c | |||
@@ -844,27 +844,11 @@ static void hs_exit_socket(hs_socket_t *sp) | |||
844 | local_irq_restore(flags); | 844 | local_irq_restore(flags); |
845 | } | 845 | } |
846 | 846 | ||
847 | static int hd64465_suspend(struct device *dev, pm_message_t state, u32 level) | ||
848 | { | ||
849 | int ret = 0; | ||
850 | if (level == SUSPEND_SAVE_STATE) | ||
851 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
852 | return ret; | ||
853 | } | ||
854 | |||
855 | static int hd64465_resume(struct device *dev, u32 level) | ||
856 | { | ||
857 | int ret = 0; | ||
858 | if (level == RESUME_RESTORE_STATE) | ||
859 | ret = pcmcia_socket_dev_resume(dev); | ||
860 | return ret; | ||
861 | } | ||
862 | |||
863 | static struct device_driver hd64465_driver = { | 847 | static struct device_driver hd64465_driver = { |
864 | .name = "hd64465-pcmcia", | 848 | .name = "hd64465-pcmcia", |
865 | .bus = &platform_bus_type, | 849 | .bus = &platform_bus_type, |
866 | .suspend = hd64465_suspend, | 850 | .suspend = pcmcia_socket_dev_suspend, |
867 | .resume = hd64465_resume, | 851 | .resume = pcmcia_socket_dev_resume, |
868 | }; | 852 | }; |
869 | 853 | ||
870 | static struct platform_device hd64465_device = { | 854 | static struct platform_device hd64465_device = { |
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index a713015e8228..4a41f67d185d 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c | |||
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = { | |||
1332 | 1332 | ||
1333 | /*====================================================================*/ | 1333 | /*====================================================================*/ |
1334 | 1334 | ||
1335 | static int i82365_suspend(struct device *dev, pm_message_t state, u32 level) | ||
1336 | { | ||
1337 | int ret = 0; | ||
1338 | if (level == SUSPEND_SAVE_STATE) | ||
1339 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
1340 | return ret; | ||
1341 | } | ||
1342 | |||
1343 | static int i82365_resume(struct device *dev, u32 level) | ||
1344 | { | ||
1345 | int ret = 0; | ||
1346 | if (level == RESUME_RESTORE_STATE) | ||
1347 | ret = pcmcia_socket_dev_resume(dev); | ||
1348 | return ret; | ||
1349 | } | ||
1350 | |||
1351 | static struct device_driver i82365_driver = { | 1335 | static struct device_driver i82365_driver = { |
1352 | .name = "i82365", | 1336 | .name = "i82365", |
1353 | .bus = &platform_bus_type, | 1337 | .bus = &platform_bus_type, |
1354 | .suspend = i82365_suspend, | 1338 | .suspend = pcmcia_socket_dev_suspend, |
1355 | .resume = i82365_resume, | 1339 | .resume = pcmcia_socket_dev_resume, |
1356 | }; | 1340 | }; |
1357 | 1341 | ||
1358 | static struct platform_device i82365_device = { | 1342 | static struct platform_device i82365_device = { |
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c index 65f3ee3d4d3c..c6ed70ea4812 100644 --- a/drivers/pcmcia/m32r_cfc.c +++ b/drivers/pcmcia/m32r_cfc.c | |||
@@ -731,28 +731,11 @@ static struct pccard_operations pcc_operations = { | |||
731 | 731 | ||
732 | /*====================================================================*/ | 732 | /*====================================================================*/ |
733 | 733 | ||
734 | static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level) | ||
735 | { | ||
736 | int ret = 0; | ||
737 | if (level == SUSPEND_SAVE_STATE) | ||
738 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
739 | return ret; | ||
740 | } | ||
741 | |||
742 | static int m32r_pcc_resume(struct device *dev, u32 level) | ||
743 | { | ||
744 | int ret = 0; | ||
745 | if (level == RESUME_RESTORE_STATE) | ||
746 | ret = pcmcia_socket_dev_resume(dev); | ||
747 | return ret; | ||
748 | } | ||
749 | |||
750 | |||
751 | static struct device_driver pcc_driver = { | 734 | static struct device_driver pcc_driver = { |
752 | .name = "cfc", | 735 | .name = "cfc", |
753 | .bus = &platform_bus_type, | 736 | .bus = &platform_bus_type, |
754 | .suspend = m32r_pcc_suspend, | 737 | .suspend = pcmcia_socket_dev_suspend, |
755 | .resume = m32r_pcc_resume, | 738 | .resume = pcmcia_socket_dev_resume, |
756 | }; | 739 | }; |
757 | 740 | ||
758 | static struct platform_device pcc_device = { | 741 | static struct platform_device pcc_device = { |
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 7b14d7efd68c..3397ff28de6a 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c | |||
@@ -695,28 +695,11 @@ static struct pccard_operations pcc_operations = { | |||
695 | 695 | ||
696 | /*====================================================================*/ | 696 | /*====================================================================*/ |
697 | 697 | ||
698 | static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level) | ||
699 | { | ||
700 | int ret = 0; | ||
701 | if (level == SUSPEND_SAVE_STATE) | ||
702 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
703 | return ret; | ||
704 | } | ||
705 | |||
706 | static int m32r_pcc_resume(struct device *dev, u32 level) | ||
707 | { | ||
708 | int ret = 0; | ||
709 | if (level == RESUME_RESTORE_STATE) | ||
710 | ret = pcmcia_socket_dev_resume(dev); | ||
711 | return ret; | ||
712 | } | ||
713 | |||
714 | |||
715 | static struct device_driver pcc_driver = { | 698 | static struct device_driver pcc_driver = { |
716 | .name = "pcc", | 699 | .name = "pcc", |
717 | .bus = &platform_bus_type, | 700 | .bus = &platform_bus_type, |
718 | .suspend = m32r_pcc_suspend, | 701 | .suspend = pcmcia_socket_dev_suspend, |
719 | .resume = m32r_pcc_resume, | 702 | .resume = pcmcia_socket_dev_resume, |
720 | }; | 703 | }; |
721 | 704 | ||
722 | static struct platform_device pcc_device = { | 705 | static struct platform_device pcc_device = { |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 94be9e51654e..2558c3cc91ec 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -329,27 +329,13 @@ static int __devexit omap_cf_remove(struct device *dev) | |||
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | static int omap_cf_suspend(struct device *dev, pm_message_t mesg, u32 level) | ||
333 | { | ||
334 | if (level != SUSPEND_SAVE_STATE) | ||
335 | return 0; | ||
336 | return pcmcia_socket_dev_suspend(dev, mesg); | ||
337 | } | ||
338 | |||
339 | static int omap_cf_resume(struct device *dev, u32 level) | ||
340 | { | ||
341 | if (level != RESUME_RESTORE_STATE) | ||
342 | return 0; | ||
343 | return pcmcia_socket_dev_resume(dev); | ||
344 | } | ||
345 | |||
346 | static struct device_driver omap_cf_driver = { | 332 | static struct device_driver omap_cf_driver = { |
347 | .name = (char *) driver_name, | 333 | .name = (char *) driver_name, |
348 | .bus = &platform_bus_type, | 334 | .bus = &platform_bus_type, |
349 | .probe = omap_cf_probe, | 335 | .probe = omap_cf_probe, |
350 | .remove = __devexit_p(omap_cf_remove), | 336 | .remove = __devexit_p(omap_cf_remove), |
351 | .suspend = omap_cf_suspend, | 337 | .suspend = pcmcia_socket_dev_suspend, |
352 | .resume = omap_cf_resume, | 338 | .resume = pcmcia_socket_dev_resume, |
353 | }; | 339 | }; |
354 | 340 | ||
355 | static int __init omap_cf_init(void) | 341 | static int __init omap_cf_init(void) |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 325c992f7d8f..c2a12d53f6c7 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -205,32 +205,20 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev) | |||
205 | } | 205 | } |
206 | EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe); | 206 | EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe); |
207 | 207 | ||
208 | static int pxa2xx_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | 208 | static int pxa2xx_drv_pcmcia_resume(struct device *dev) |
209 | { | 209 | { |
210 | int ret = 0; | 210 | struct pcmcia_low_level *ops = dev->platform_data; |
211 | if (level == SUSPEND_SAVE_STATE) | 211 | int nr = ops ? ops->nr : 0; |
212 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
213 | return ret; | ||
214 | } | ||
215 | 212 | ||
216 | static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level) | 213 | MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0); |
217 | { | 214 | |
218 | int ret = 0; | 215 | return pcmcia_socket_dev_resume(dev); |
219 | if (level == RESUME_RESTORE_STATE) | ||
220 | { | ||
221 | struct pcmcia_low_level *ops = dev->platform_data; | ||
222 | int nr = ops ? ops->nr : 0; | ||
223 | |||
224 | MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0); | ||
225 | ret = pcmcia_socket_dev_resume(dev); | ||
226 | } | ||
227 | return ret; | ||
228 | } | 216 | } |
229 | 217 | ||
230 | static struct device_driver pxa2xx_pcmcia_driver = { | 218 | static struct device_driver pxa2xx_pcmcia_driver = { |
231 | .probe = pxa2xx_drv_pcmcia_probe, | 219 | .probe = pxa2xx_drv_pcmcia_probe, |
232 | .remove = soc_common_drv_pcmcia_remove, | 220 | .remove = soc_common_drv_pcmcia_remove, |
233 | .suspend = pxa2xx_drv_pcmcia_suspend, | 221 | .suspend = pcmcia_socket_dev_suspend, |
234 | .resume = pxa2xx_drv_pcmcia_resume, | 222 | .resume = pxa2xx_drv_pcmcia_resume, |
235 | .name = "pxa2xx-pcmcia", | 223 | .name = "pxa2xx-pcmcia", |
236 | .bus = &platform_bus_type, | 224 | .bus = &platform_bus_type, |
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index a1178a600e3c..bd924336a49f 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c | |||
@@ -18,10 +18,15 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | 20 | ||
21 | #include <asm/mach-types.h> | ||
21 | #include <asm/hardware.h> | 22 | #include <asm/hardware.h> |
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
23 | #include <asm/hardware/scoop.h> | 24 | #include <asm/hardware/scoop.h> |
24 | #include <asm/arch/pxa-regs.h> | 25 | #ifdef CONFIG_SA1100_COLLIE |
26 | #include <asm/arch-sa1100/collie.h> | ||
27 | #else | ||
28 | #include <asm/arch-pxa/pxa-regs.h> | ||
29 | #endif | ||
25 | 30 | ||
26 | #include "soc_common.h" | 31 | #include "soc_common.h" |
27 | 32 | ||
@@ -38,6 +43,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
38 | { | 43 | { |
39 | int ret; | 44 | int ret; |
40 | 45 | ||
46 | #ifndef CONFIG_SA1100_COLLIE | ||
41 | /* | 47 | /* |
42 | * Setup default state of GPIO outputs | 48 | * Setup default state of GPIO outputs |
43 | * before we enable them as outputs. | 49 | * before we enable them as outputs. |
@@ -60,6 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
60 | pxa_gpio_mode(GPIO55_nPREG_MD); | 66 | pxa_gpio_mode(GPIO55_nPREG_MD); |
61 | pxa_gpio_mode(GPIO56_nPWAIT_MD); | 67 | pxa_gpio_mode(GPIO56_nPWAIT_MD); |
62 | pxa_gpio_mode(GPIO57_nIOIS16_MD); | 68 | pxa_gpio_mode(GPIO57_nIOIS16_MD); |
69 | #endif | ||
63 | 70 | ||
64 | /* Register interrupts */ | 71 | /* Register interrupts */ |
65 | if (scoop_devs[skt->nr].cd_irq >= 0) { | 72 | if (scoop_devs[skt->nr].cd_irq >= 0) { |
@@ -213,12 +220,20 @@ static void sharpsl_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | |||
213 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); | 220 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); |
214 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); | 221 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); |
215 | scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; | 222 | scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; |
223 | |||
224 | if (machine_is_collie()) | ||
225 | /* We need to disable SS_OUTPUT_ENA here. */ | ||
226 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080); | ||
216 | } | 227 | } |
217 | 228 | ||
218 | static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | 229 | static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) |
219 | { | 230 | { |
220 | /* CF_BUS_OFF */ | 231 | /* CF_BUS_OFF */ |
221 | sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); | 232 | sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); |
233 | |||
234 | if (machine_is_collie()) | ||
235 | /* We need to disable SS_OUTPUT_ENA here. */ | ||
236 | write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080); | ||
222 | } | 237 | } |
223 | 238 | ||
224 | static struct pcmcia_low_level sharpsl_pcmcia_ops = { | 239 | static struct pcmcia_low_level sharpsl_pcmcia_ops = { |
@@ -235,6 +250,19 @@ static struct pcmcia_low_level sharpsl_pcmcia_ops = { | |||
235 | 250 | ||
236 | static struct platform_device *sharpsl_pcmcia_device; | 251 | static struct platform_device *sharpsl_pcmcia_device; |
237 | 252 | ||
253 | #ifdef CONFIG_SA1100_COLLIE | ||
254 | int __init pcmcia_collie_init(struct device *dev) | ||
255 | { | ||
256 | int ret = -ENODEV; | ||
257 | |||
258 | if (machine_is_collie()) | ||
259 | ret = sa11xx_drv_pcmcia_probe(dev, &sharpsl_pcmcia_ops, 0, 1); | ||
260 | |||
261 | return ret; | ||
262 | } | ||
263 | |||
264 | #else | ||
265 | |||
238 | static int __init sharpsl_pcmcia_init(void) | 266 | static int __init sharpsl_pcmcia_init(void) |
239 | { | 267 | { |
240 | int ret; | 268 | int ret; |
@@ -269,6 +297,7 @@ static void __exit sharpsl_pcmcia_exit(void) | |||
269 | 297 | ||
270 | fs_initcall(sharpsl_pcmcia_init); | 298 | fs_initcall(sharpsl_pcmcia_init); |
271 | module_exit(sharpsl_pcmcia_exit); | 299 | module_exit(sharpsl_pcmcia_exit); |
300 | #endif | ||
272 | 301 | ||
273 | MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); | 302 | MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); |
274 | MODULE_LICENSE("GPL"); | 303 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index f9a5c70284b5..00960a379b9c 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -779,7 +779,7 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s) | |||
779 | if (!s->cb_dev || !s->cb_dev->bus) | 779 | if (!s->cb_dev || !s->cb_dev->bus) |
780 | return -ENODEV; | 780 | return -ENODEV; |
781 | 781 | ||
782 | #if defined(CONFIG_X86) || defined(CONFIG_X86_64) | 782 | #if defined(CONFIG_X86) |
783 | /* If this is the root bus, the risk of hitting | 783 | /* If this is the root bus, the risk of hitting |
784 | * some strange system devices which aren't protected | 784 | * some strange system devices which aren't protected |
785 | * by either ACPI resource tables or properly requested | 785 | * by either ACPI resource tables or properly requested |
@@ -994,7 +994,8 @@ static struct class_device_attribute *pccard_rsrc_attributes[] = { | |||
994 | NULL, | 994 | NULL, |
995 | }; | 995 | }; |
996 | 996 | ||
997 | static int __devinit pccard_sysfs_add_rsrc(struct class_device *class_dev) | 997 | static int __devinit pccard_sysfs_add_rsrc(struct class_device *class_dev, |
998 | struct class_interface *class_intf) | ||
998 | { | 999 | { |
999 | struct pcmcia_socket *s = class_get_devdata(class_dev); | 1000 | struct pcmcia_socket *s = class_get_devdata(class_dev); |
1000 | struct class_device_attribute **attr; | 1001 | struct class_device_attribute **attr; |
@@ -1011,7 +1012,8 @@ static int __devinit pccard_sysfs_add_rsrc(struct class_device *class_dev) | |||
1011 | return ret; | 1012 | return ret; |
1012 | } | 1013 | } |
1013 | 1014 | ||
1014 | static void __devexit pccard_sysfs_remove_rsrc(struct class_device *class_dev) | 1015 | static void __devexit pccard_sysfs_remove_rsrc(struct class_device *class_dev, |
1016 | struct class_interface *class_intf) | ||
1015 | { | 1017 | { |
1016 | struct pcmcia_socket *s = class_get_devdata(class_dev); | 1018 | struct pcmcia_socket *s = class_get_devdata(class_dev); |
1017 | struct class_device_attribute **attr; | 1019 | struct class_device_attribute **attr; |
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index d4ed508b38be..acf60ffc8a12 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -38,8 +38,12 @@ | |||
38 | #include <pcmcia/cs.h> | 38 | #include <pcmcia/cs.h> |
39 | #include <pcmcia/ss.h> | 39 | #include <pcmcia/ss.h> |
40 | 40 | ||
41 | #include <asm/hardware/scoop.h> | ||
42 | |||
41 | #include "sa1100_generic.h" | 43 | #include "sa1100_generic.h" |
42 | 44 | ||
45 | int __init pcmcia_collie_init(struct device *dev); | ||
46 | |||
43 | static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | 47 | static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { |
44 | #ifdef CONFIG_SA1100_ASSABET | 48 | #ifdef CONFIG_SA1100_ASSABET |
45 | pcmcia_assabet_init, | 49 | pcmcia_assabet_init, |
@@ -56,6 +60,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | |||
56 | #ifdef CONFIG_SA1100_SIMPAD | 60 | #ifdef CONFIG_SA1100_SIMPAD |
57 | pcmcia_simpad_init, | 61 | pcmcia_simpad_init, |
58 | #endif | 62 | #endif |
63 | #ifdef CONFIG_SA1100_COLLIE | ||
64 | pcmcia_collie_init, | ||
65 | #endif | ||
59 | }; | 66 | }; |
60 | 67 | ||
61 | static int sa11x0_drv_pcmcia_probe(struct device *dev) | 68 | static int sa11x0_drv_pcmcia_probe(struct device *dev) |
@@ -74,29 +81,13 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev) | |||
74 | return ret; | 81 | return ret; |
75 | } | 82 | } |
76 | 83 | ||
77 | static int sa11x0_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) | ||
78 | { | ||
79 | int ret = 0; | ||
80 | if (level == SUSPEND_SAVE_STATE) | ||
81 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
82 | return ret; | ||
83 | } | ||
84 | |||
85 | static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level) | ||
86 | { | ||
87 | int ret = 0; | ||
88 | if (level == RESUME_RESTORE_STATE) | ||
89 | ret = pcmcia_socket_dev_resume(dev); | ||
90 | return ret; | ||
91 | } | ||
92 | |||
93 | static struct device_driver sa11x0_pcmcia_driver = { | 84 | static struct device_driver sa11x0_pcmcia_driver = { |
94 | .probe = sa11x0_drv_pcmcia_probe, | 85 | .probe = sa11x0_drv_pcmcia_probe, |
95 | .remove = soc_common_drv_pcmcia_remove, | 86 | .remove = soc_common_drv_pcmcia_remove, |
96 | .name = "sa11x0-pcmcia", | 87 | .name = "sa11x0-pcmcia", |
97 | .bus = &platform_bus_type, | 88 | .bus = &platform_bus_type, |
98 | .suspend = sa11x0_drv_pcmcia_suspend, | 89 | .suspend = pcmcia_socket_dev_suspend, |
99 | .resume = sa11x0_drv_pcmcia_resume, | 90 | .resume = pcmcia_socket_dev_resume, |
100 | }; | 91 | }; |
101 | 92 | ||
102 | /* sa11x0_pcmcia_init() | 93 | /* sa11x0_pcmcia_init() |
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index bb90a1448a53..81ded52c8959 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -122,7 +122,7 @@ void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | |||
122 | 122 | ||
123 | static int pcmcia_probe(struct sa1111_dev *dev) | 123 | static int pcmcia_probe(struct sa1111_dev *dev) |
124 | { | 124 | { |
125 | char *base; | 125 | void __iomem *base; |
126 | 126 | ||
127 | if (!request_mem_region(dev->res.start, 512, | 127 | if (!request_mem_region(dev->res.start, 512, |
128 | SA1111_DRIVER_NAME(dev))) | 128 | SA1111_DRIVER_NAME(dev))) |
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index 1040a6c1a8a4..4a3150a7854c 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c | |||
@@ -341,7 +341,8 @@ static struct bin_attribute pccard_cis_attr = { | |||
341 | .write = pccard_store_cis, | 341 | .write = pccard_store_cis, |
342 | }; | 342 | }; |
343 | 343 | ||
344 | static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev) | 344 | static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev, |
345 | struct class_interface *class_intf) | ||
345 | { | 346 | { |
346 | struct class_device_attribute **attr; | 347 | struct class_device_attribute **attr; |
347 | int ret = 0; | 348 | int ret = 0; |
@@ -357,7 +358,8 @@ static int __devinit pccard_sysfs_add_socket(struct class_device *class_dev) | |||
357 | return ret; | 358 | return ret; |
358 | } | 359 | } |
359 | 360 | ||
360 | static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev) | 361 | static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev, |
362 | struct class_interface *class_intf) | ||
361 | { | 363 | { |
362 | struct class_device_attribute **attr; | 364 | struct class_device_attribute **attr; |
363 | 365 | ||
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index d5a61eae6119..f158b67f6610 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c | |||
@@ -372,27 +372,11 @@ static int __init get_tcic_id(void) | |||
372 | 372 | ||
373 | /*====================================================================*/ | 373 | /*====================================================================*/ |
374 | 374 | ||
375 | static int tcic_drv_suspend(struct device *dev, pm_message_t state, u32 level) | ||
376 | { | ||
377 | int ret = 0; | ||
378 | if (level == SUSPEND_SAVE_STATE) | ||
379 | ret = pcmcia_socket_dev_suspend(dev, state); | ||
380 | return ret; | ||
381 | } | ||
382 | |||
383 | static int tcic_drv_resume(struct device *dev, u32 level) | ||
384 | { | ||
385 | int ret = 0; | ||
386 | if (level == RESUME_RESTORE_STATE) | ||
387 | ret = pcmcia_socket_dev_resume(dev); | ||
388 | return ret; | ||
389 | } | ||
390 | |||
391 | static struct device_driver tcic_driver = { | 375 | static struct device_driver tcic_driver = { |
392 | .name = "tcic-pcmcia", | 376 | .name = "tcic-pcmcia", |
393 | .bus = &platform_bus_type, | 377 | .bus = &platform_bus_type, |
394 | .suspend = tcic_drv_suspend, | 378 | .suspend = pcmcia_socket_dev_suspend, |
395 | .resume = tcic_drv_resume, | 379 | .resume = pcmcia_socket_dev_resume, |
396 | }; | 380 | }; |
397 | 381 | ||
398 | static struct platform_device tcic_device = { | 382 | static struct platform_device tcic_device = { |
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c index 17bb2da6752b..3d2dca675e02 100644 --- a/drivers/pcmcia/vrc4171_card.c +++ b/drivers/pcmcia/vrc4171_card.c | |||
@@ -774,31 +774,11 @@ static int __devinit vrc4171_card_setup(char *options) | |||
774 | 774 | ||
775 | __setup("vrc4171_card=", vrc4171_card_setup); | 775 | __setup("vrc4171_card=", vrc4171_card_setup); |
776 | 776 | ||
777 | static int vrc4171_card_suspend(struct device *dev, pm_message_t state, u32 level) | ||
778 | { | ||
779 | int retval = 0; | ||
780 | |||
781 | if (level == SUSPEND_SAVE_STATE) | ||
782 | retval = pcmcia_socket_dev_suspend(dev, state); | ||
783 | |||
784 | return retval; | ||
785 | } | ||
786 | |||
787 | static int vrc4171_card_resume(struct device *dev, u32 level) | ||
788 | { | ||
789 | int retval = 0; | ||
790 | |||
791 | if (level == RESUME_RESTORE_STATE) | ||
792 | retval = pcmcia_socket_dev_resume(dev); | ||
793 | |||
794 | return retval; | ||
795 | } | ||
796 | |||
797 | static struct device_driver vrc4171_card_driver = { | 777 | static struct device_driver vrc4171_card_driver = { |
798 | .name = vrc4171_card_name, | 778 | .name = vrc4171_card_name, |
799 | .bus = &platform_bus_type, | 779 | .bus = &platform_bus_type, |
800 | .suspend = vrc4171_card_suspend, | 780 | .suspend = pcmcia_socket_dev_suspend, |
801 | .resume = vrc4171_card_resume, | 781 | .resume = pcmcia_socket_dev_resume, |
802 | }; | 782 | }; |
803 | 783 | ||
804 | static int __devinit vrc4171_card_init(void) | 784 | static int __devinit vrc4171_card_init(void) |
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index db9f952f9e3c..ec6ab65f0872 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -151,6 +151,40 @@ static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) | |||
151 | readb(socket->base + 0x800 + reg + 1); | 151 | readb(socket->base + 0x800 + reg + 1); |
152 | } | 152 | } |
153 | 153 | ||
154 | static ssize_t show_yenta_registers(struct device *yentadev, struct device_attribute *attr, char *buf) | ||
155 | { | ||
156 | struct pci_dev *dev = to_pci_dev(yentadev); | ||
157 | struct yenta_socket *socket = pci_get_drvdata(dev); | ||
158 | int offset = 0, i; | ||
159 | |||
160 | offset = snprintf(buf, PAGE_SIZE, "CB registers:"); | ||
161 | for (i = 0; i < 0x24; i += 4) { | ||
162 | unsigned val; | ||
163 | if (!(i & 15)) | ||
164 | offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); | ||
165 | val = cb_readl(socket, i); | ||
166 | offset += snprintf(buf + offset, PAGE_SIZE - offset, " %08x", val); | ||
167 | } | ||
168 | |||
169 | offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:"); | ||
170 | for (i = 0; i < 0x45; i++) { | ||
171 | unsigned char val; | ||
172 | if (!(i & 7)) { | ||
173 | if (i & 8) { | ||
174 | memcpy(buf + offset, " -", 2); | ||
175 | offset += 2; | ||
176 | } else | ||
177 | offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); | ||
178 | } | ||
179 | val = exca_readb(socket, i); | ||
180 | offset += snprintf(buf + offset, PAGE_SIZE - offset, " %02x", val); | ||
181 | } | ||
182 | buf[offset++] = '\n'; | ||
183 | return offset; | ||
184 | } | ||
185 | |||
186 | static DEVICE_ATTR(yenta_registers, S_IRUSR, show_yenta_registers, NULL); | ||
187 | |||
154 | /* | 188 | /* |
155 | * Ugh, mixed-mode cardbus and 16-bit pccard state: things depend | 189 | * Ugh, mixed-mode cardbus and 16-bit pccard state: things depend |
156 | * on what kind of card is inserted.. | 190 | * on what kind of card is inserted.. |
@@ -765,6 +799,9 @@ static void yenta_close(struct pci_dev *dev) | |||
765 | { | 799 | { |
766 | struct yenta_socket *sock = pci_get_drvdata(dev); | 800 | struct yenta_socket *sock = pci_get_drvdata(dev); |
767 | 801 | ||
802 | /* Remove the register attributes */ | ||
803 | device_remove_file(&dev->dev, &dev_attr_yenta_registers); | ||
804 | |||
768 | /* we don't want a dying socket registered */ | 805 | /* we don't want a dying socket registered */ |
769 | pcmcia_unregister_socket(&sock->socket); | 806 | pcmcia_unregister_socket(&sock->socket); |
770 | 807 | ||
@@ -1138,8 +1175,11 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1138 | 1175 | ||
1139 | /* Register it with the pcmcia layer.. */ | 1176 | /* Register it with the pcmcia layer.. */ |
1140 | ret = pcmcia_register_socket(&socket->socket); | 1177 | ret = pcmcia_register_socket(&socket->socket); |
1141 | if (ret == 0) | 1178 | if (ret == 0) { |
1179 | /* Add the yenta register attributes */ | ||
1180 | device_create_file(&dev->dev, &dev_attr_yenta_registers); | ||
1142 | goto out; | 1181 | goto out; |
1182 | } | ||
1143 | 1183 | ||
1144 | unmap: | 1184 | unmap: |
1145 | iounmap(socket->base); | 1185 | iounmap(socket->base); |