aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/sa1100_generic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/pcmcia/sa1100_generic.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/pcmcia/sa1100_generic.c')
-rw-r--r--drivers/pcmcia/sa1100_generic.c131
1 files changed, 131 insertions, 0 deletions
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
new file mode 100644
index 000000000000..874990ebe147
--- /dev/null
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -0,0 +1,131 @@
1/*======================================================================
2
3 Device driver for the PCMCIA control functionality of StrongARM
4 SA-1100 microprocessors.
5
6 The contents of this file are subject to the Mozilla Public
7 License Version 1.1 (the "License"); you may not use this file
8 except in compliance with the License. You may obtain a copy of
9 the License at http://www.mozilla.org/MPL/
10
11 Software distributed under the License is distributed on an "AS
12 IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13 implied. See the License for the specific language governing
14 rights and limitations under the License.
15
16 The initial developer of the original code is John G. Dorsey
17 <john+@cs.cmu.edu>. Portions created by John G. Dorsey are
18 Copyright (C) 1999 John G. Dorsey. All Rights Reserved.
19
20 Alternatively, the contents of this file may be used under the
21 terms of the GNU Public License version 2 (the "GPL"), in which
22 case the provisions of the GPL are applicable instead of the
23 above. If you wish to allow the use of your version of this file
24 only under the terms of the GPL and not to allow others to use
25 your version of this file under the MPL, indicate your decision
26 by deleting the provisions above and replace them with the notice
27 and other provisions required by the GPL. If you do not delete
28 the provisions above, a recipient may use your version of this
29 file under either the MPL or the GPL.
30
31======================================================================*/
32
33#include <linux/module.h>
34#include <linux/init.h>
35#include <linux/config.h>
36
37#include <pcmcia/version.h>
38#include <pcmcia/cs_types.h>
39#include <pcmcia/cs.h>
40#include <pcmcia/ss.h>
41
42#include "sa1100_generic.h"
43
44static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
45#ifdef CONFIG_SA1100_ASSABET
46 pcmcia_assabet_init,
47#endif
48#ifdef CONFIG_SA1100_CERF
49 pcmcia_cerf_init,
50#endif
51#ifdef CONFIG_SA1100_H3600
52 pcmcia_h3600_init,
53#endif
54#ifdef CONFIG_SA1100_SHANNON
55 pcmcia_shannon_init,
56#endif
57#ifdef CONFIG_SA1100_SIMPAD
58 pcmcia_simpad_init,
59#endif
60};
61
62static int sa11x0_drv_pcmcia_probe(struct device *dev)
63{
64 int i, ret = -ENODEV;
65
66 /*
67 * Initialise any "on-board" PCMCIA sockets.
68 */
69 for (i = 0; i < ARRAY_SIZE(sa11x0_pcmcia_hw_init); i++) {
70 ret = sa11x0_pcmcia_hw_init[i](dev);
71 if (ret == 0)
72 break;
73 }
74
75 return ret;
76}
77
78static int sa11x0_drv_pcmcia_suspend(struct device *dev, u32 state, u32 level)
79{
80 int ret = 0;
81 if (level == SUSPEND_SAVE_STATE)
82 ret = pcmcia_socket_dev_suspend(dev, state);
83 return ret;
84}
85
86static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
87{
88 int ret = 0;
89 if (level == RESUME_RESTORE_STATE)
90 ret = pcmcia_socket_dev_resume(dev);
91 return ret;
92}
93
94static struct device_driver sa11x0_pcmcia_driver = {
95 .probe = sa11x0_drv_pcmcia_probe,
96 .remove = soc_common_drv_pcmcia_remove,
97 .name = "sa11x0-pcmcia",
98 .bus = &platform_bus_type,
99 .suspend = sa11x0_drv_pcmcia_suspend,
100 .resume = sa11x0_drv_pcmcia_resume,
101};
102
103/* sa11x0_pcmcia_init()
104 * ^^^^^^^^^^^^^^^^^^^^
105 *
106 * This routine performs low-level PCMCIA initialization and then
107 * registers this socket driver with Card Services.
108 *
109 * Returns: 0 on success, -ve error code on failure
110 */
111static int __init sa11x0_pcmcia_init(void)
112{
113 return driver_register(&sa11x0_pcmcia_driver);
114}
115
116/* sa11x0_pcmcia_exit()
117 * ^^^^^^^^^^^^^^^^^^^^
118 * Invokes the low-level kernel service to free IRQs associated with this
119 * socket controller and reset GPIO edge detection.
120 */
121static void __exit sa11x0_pcmcia_exit(void)
122{
123 driver_unregister(&sa11x0_pcmcia_driver);
124}
125
126MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
127MODULE_DESCRIPTION("Linux PCMCIA Card Services: SA-11x0 Socket Controller");
128MODULE_LICENSE("Dual MPL/GPL");
129
130module_init(sa11x0_pcmcia_init);
131module_exit(sa11x0_pcmcia_exit);