1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#include <linux/module.h>
34#include <linux/init.h>
35#include <linux/slab.h>
36#include <linux/platform_device.h>
37
38#include <pcmcia/ss.h>
39
40#include <asm/hardware/scoop.h>
41
42#include "sa1100_generic.h"
43
44int __init pcmcia_collie_init(struct device *dev);
45
46static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
47#ifdef CONFIG_SA1100_ASSABET
48 pcmcia_assabet_init,
49#endif
50#ifdef CONFIG_SA1100_CERF
51 pcmcia_cerf_init,
52#endif
53#if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600)
54 pcmcia_h3600_init,
55#endif
56#ifdef CONFIG_SA1100_NANOENGINE
57 pcmcia_nanoengine_init,
58#endif
59#ifdef CONFIG_SA1100_SHANNON
60 pcmcia_shannon_init,
61#endif
62#ifdef CONFIG_SA1100_SIMPAD
63 pcmcia_simpad_init,
64#endif
65#ifdef CONFIG_SA1100_COLLIE
66 pcmcia_collie_init,
67#endif
68};
69
70static int sa11x0_drv_pcmcia_probe(struct platform_device *dev)
71{
72 int i, ret = -ENODEV;
73
74
75
76
77 for (i = 0; i < ARRAY_SIZE(sa11x0_pcmcia_hw_init); i++) {
78 ret = sa11x0_pcmcia_hw_init[i](&dev->dev);
79 if (ret == 0)
80 break;
81 }
82
83 return ret;
84}
85
86static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
87{
88 struct skt_dev_info *sinfo = platform_get_drvdata(dev);
89 int i;
90
91 platform_set_drvdata(dev, NULL);
92
93 for (i = 0; i < sinfo->nskt; i++)
94 soc_pcmcia_remove_one(&sinfo->skt[i]);
95
96 kfree(sinfo);
97 return 0;
98}
99
100static struct platform_driver sa11x0_pcmcia_driver = {
101 .driver = {
102 .name = "sa11x0-pcmcia",
103 .owner = THIS_MODULE,
104 },
105 .probe = sa11x0_drv_pcmcia_probe,
106 .remove = sa11x0_drv_pcmcia_remove,
107};
108
109
110
111
112
113
114
115
116
117static int __init sa11x0_pcmcia_init(void)
118{
119 return platform_driver_register(&sa11x0_pcmcia_driver);
120}
121
122
123
124
125
126
127static void __exit sa11x0_pcmcia_exit(void)
128{
129 platform_driver_unregister(&sa11x0_pcmcia_driver);
130}
131
132MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
133MODULE_DESCRIPTION("Linux PCMCIA Card Services: SA-11x0 Socket Controller");
134MODULE_LICENSE("Dual MPL/GPL");
135
136fs_initcall(sa11x0_pcmcia_init);
137module_exit(sa11x0_pcmcia_exit);
138