sync hh.org
[hh.org.git] / drivers / pcmcia / pxa2xx_generic.c
blobf0e4d4a8b168df12070af888d56f2cb6c8114989
1 /*======================================================================
3 Device driver for the PCMCIA control functionality of Intel PXA2xx
4 microprocessors.
6 The contents of this file may be used under the
7 terms of the GNU Public License version 2 (the "GPL")
9 (c) Ian Molton (spyro@f2s.com) 2003
10 (c) Stefan Eletzhofer (stefan.eletzhofer@inquant.de) 2003,4
12 derived from sa1100_generic.c
14 Portions created by John G. Dorsey are
15 Copyright (C) 1999 John G. Dorsey.
17 ======================================================================*/
19 #include <linux/module.h>
20 #include <linux/init.h>
22 #include <pcmcia/version.h>
23 #include <pcmcia/cs_types.h>
24 #include <pcmcia/cs.h>
25 #include <pcmcia/ss.h>
27 #include <asm/arch/pcmcia.h>
29 #include "pxa2xx.h"
30 #include "pxa2xx_generic.h"
32 static int pxa2xx_generic_drv_pcmcia_suspend(struct device *dev, u32 state, u32 level)
34 int ret = 0;
35 if (level == SUSPEND_SAVE_STATE)
36 ret = pcmcia_socket_dev_suspend(dev, state);
37 return ret;
40 static int pxa2xx_generic_drv_pcmcia_resume(struct device *dev, u32 level)
42 int ret = 0;
43 if (level == RESUME_RESTORE_STATE)
44 ret = pcmcia_socket_dev_resume(dev);
45 return ret;
48 static struct device_driver pxa2xx_generic_pcmcia_driver = {
49 .probe = pxa2xx_core_drv_pcmcia_probe,
50 .remove = pxa2xx_core_drv_pcmcia_remove,
51 .name = "pxa2xx-pcmcia",
52 .bus = &platform_bus_type,
53 .suspend = pxa2xx_generic_drv_pcmcia_suspend,
54 .resume = pxa2xx_generic_drv_pcmcia_resume,
57 /* pxa2xx_generic_pcmcia_init()
58 * ^^^^^^^^^^^^^^^^^^^^
60 * This routine performs low-level PCMCIA initialization and then
61 * registers this socket driver with Card Services.
63 * Returns: 0 on success, -ve error code on failure
65 static int __init pxa2xx_generic_pcmcia_init(void)
67 return driver_register(&pxa2xx_generic_pcmcia_driver);
70 /* pxa2xx_generic_pcmcia_exit()
71 * ^^^^^^^^^^^^^^^^^^^^
72 * Invokes the low-level kernel service to free IRQs associated with this
73 * socket controller and reset GPIO edge detection.
75 static void __exit pxa2xx_generic_pcmcia_exit(void)
77 driver_unregister(&pxa2xx_generic_pcmcia_driver);
80 MODULE_AUTHOR("Stefan Eletzhofer <stefan.eletzhofer@inquant.de> and Ian Molton <spyro@f2s.com>");
81 MODULE_DESCRIPTION("Linux PCMCIA Card Services: PXA2xx generic routines");
82 MODULE_LICENSE("GPL");
84 module_init(pxa2xx_generic_pcmcia_init);
85 module_exit(pxa2xx_generic_pcmcia_exit);