13 #include <linux/slab.h>
16 #include <linux/module.h>
18 #define DRIVER_NAME "tifm_core"
19 #define DRIVER_VERSION "0.8"
25 static const char *tifm_media_type_name(
unsigned char type,
unsigned char nt)
27 const char *card_type_name[3][3] = {
28 {
"SmartMedia/xD",
"MemoryStick",
"MMC/SD" },
35 return card_type_name[nt][type - 1];
54 if (tifm_dev_match(sock, ids))
72 static int tifm_device_probe(
struct device *dev)
81 rc = drv->
probe(sock);
89 static void tifm_dummy_event(
struct tifm_dev *sock)
94 static int tifm_device_remove(
struct device *dev)
120 return drv->
suspend(sock, state);
137 #define tifm_device_suspend NULL
138 #define tifm_device_resume NULL
154 static struct bus_type tifm_bus_type = {
156 .dev_attrs = tifm_dev_attrs,
157 .match = tifm_bus_match,
158 .uevent = tifm_uevent,
159 .probe = tifm_device_probe,
160 .remove = tifm_device_remove,
165 static void tifm_free(
struct device *dev)
172 static struct class tifm_adapter_class = {
173 .name =
"tifm_adapter",
174 .dev_release = tifm_free
185 fm->
dev.class = &tifm_adapter_class;
202 spin_lock(&tifm_adapter_lock);
204 spin_unlock(&tifm_adapter_lock);
211 spin_lock(&tifm_adapter_lock);
213 spin_unlock(&tifm_adapter_lock);
230 spin_lock(&tifm_adapter_lock);
232 spin_unlock(&tifm_adapter_lock);
255 if (!tifm_media_type_name(type, 0))
266 sock->
dev.parent = fm->
dev.parent;
267 sock->
dev.bus = &tifm_bus_type;
268 sock->
dev.dma_mask = fm->
dev.parent->dma_mask;
272 tifm_media_type_name(type, 2), fm->
id,
id);
274 ": %s card detected in socket %u:%u\n",
275 tifm_media_type_name(type, 0), fm->
id,
id);
298 return pci_map_sg(
to_pci_dev(sock->
dev.parent), sg, nents, direction);
305 pci_unmap_sg(
to_pci_dev(sock->
dev.parent), sg, nents, direction);
317 drv->
driver.bus = &tifm_bus_type;
329 static int __init tifm_init(
void)
354 static void __exit tifm_exit(
void)