blob: fd7b8dadc821378bca8072927b5f5d21e3254681 [file] [log] [blame]
Alex Dubov4020f2d2006-10-04 02:15:37 -07001/*
2 * tifm_7xx1.c - TI FlashMedia driver
3 *
4 * Copyright (C) 2006 Alex Dubov <oakad@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/tifm.h>
13#include <linux/dma-mapping.h>
Alex Dubov7146f0d2006-12-18 14:20:06 +110014#include <linux/freezer.h>
Alex Dubov4020f2d2006-10-04 02:15:37 -070015
16#define DRIVER_NAME "tifm_7xx1"
Alex Dubov4552f0c2007-04-12 16:59:12 +100017#define DRIVER_VERSION "0.8"
18
19#define TIFM_IRQ_ENABLE 0x80000000
20#define TIFM_IRQ_SOCKMASK(x) (x)
21#define TIFM_IRQ_CARDMASK(x) ((x) << 8)
22#define TIFM_IRQ_FIFOMASK(x) ((x) << 16)
23#define TIFM_IRQ_SETALL 0xffffffff
Alex Dubov4020f2d2006-10-04 02:15:37 -070024
25static void tifm_7xx1_eject(struct tifm_adapter *fm, struct tifm_dev *sock)
26{
Alex Dubov4020f2d2006-10-04 02:15:37 -070027 unsigned long flags;
28
29 spin_lock_irqsave(&fm->lock, flags);
Alex Dubov7146f0d2006-12-18 14:20:06 +110030 fm->socket_change_set |= 1 << sock->socket_id;
31 wake_up_all(&fm->change_set_notify);
Alex Dubov4020f2d2006-10-04 02:15:37 -070032 spin_unlock_irqrestore(&fm->lock, flags);
33}
34
David Howells7d12e782006-10-05 14:55:46 +010035static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
Alex Dubov4020f2d2006-10-04 02:15:37 -070036{
37 struct tifm_adapter *fm = dev_id;
Alex Dubov217334d2006-12-11 01:55:31 +110038 struct tifm_dev *sock;
Alex Dubov4020f2d2006-10-04 02:15:37 -070039 unsigned int irq_status;
Alex Dubov4552f0c2007-04-12 16:59:12 +100040 unsigned int cnt;
Alex Dubov4020f2d2006-10-04 02:15:37 -070041
42 spin_lock(&fm->lock);
43 irq_status = readl(fm->addr + FM_INTERRUPT_STATUS);
44 if (irq_status == 0 || irq_status == (~0)) {
45 spin_unlock(&fm->lock);
46 return IRQ_NONE;
47 }
48
49 if (irq_status & TIFM_IRQ_ENABLE) {
50 writel(TIFM_IRQ_ENABLE, fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
51
Alex Dubov8b40ada2006-12-11 01:55:36 +110052 for (cnt = 0; cnt < fm->num_sockets; cnt++) {
Alex Dubov217334d2006-12-11 01:55:31 +110053 sock = fm->sockets[cnt];
Alex Dubov4552f0c2007-04-12 16:59:12 +100054 if (sock) {
55 if ((irq_status >> cnt) & TIFM_IRQ_FIFOMASK(1))
56 sock->data_event(sock);
57 if ((irq_status >> cnt) & TIFM_IRQ_CARDMASK(1))
58 sock->card_event(sock);
59 }
Alex Dubov4020f2d2006-10-04 02:15:37 -070060 }
Alex Dubov6412d922006-12-11 01:55:33 +110061
Alex Dubov8b40ada2006-12-11 01:55:36 +110062 fm->socket_change_set |= irq_status
63 & ((1 << fm->num_sockets) - 1);
Alex Dubov4020f2d2006-10-04 02:15:37 -070064 }
65 writel(irq_status, fm->addr + FM_INTERRUPT_STATUS);
66
Alex Dubov7146f0d2006-12-18 14:20:06 +110067 if (!fm->socket_change_set)
68 writel(TIFM_IRQ_ENABLE, fm->addr + FM_SET_INTERRUPT_ENABLE);
69 else
70 wake_up_all(&fm->change_set_notify);
Alex Dubov4020f2d2006-10-04 02:15:37 -070071
72 spin_unlock(&fm->lock);
73 return IRQ_HANDLED;
74}
75
Alex Dubove23f2b82007-04-12 16:59:14 +100076static unsigned char tifm_7xx1_toggle_sock_power(char __iomem *sock_addr,
Alex Dubov8b40ada2006-12-11 01:55:36 +110077 int is_x2)
Alex Dubov4020f2d2006-10-04 02:15:37 -070078{
79 unsigned int s_state;
80 int cnt;
81
82 writel(0x0e00, sock_addr + SOCK_CONTROL);
83
84 for (cnt = 0; cnt < 100; cnt++) {
Alex Dubov8b40ada2006-12-11 01:55:36 +110085 if (!(TIFM_SOCK_STATE_POWERED
86 & readl(sock_addr + SOCK_PRESENT_STATE)))
Alex Dubov4020f2d2006-10-04 02:15:37 -070087 break;
88 msleep(10);
89 }
90
91 s_state = readl(sock_addr + SOCK_PRESENT_STATE);
92 if (!(TIFM_SOCK_STATE_OCCUPIED & s_state))
Alex Dubove23f2b82007-04-12 16:59:14 +100093 return 0;
Alex Dubov4020f2d2006-10-04 02:15:37 -070094
95 if (is_x2) {
96 writel((s_state & 7) | 0x0c00, sock_addr + SOCK_CONTROL);
97 } else {
98 // SmartMedia cards need extra 40 msec
99 if (((readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7) == 1)
100 msleep(40);
101 writel(readl(sock_addr + SOCK_CONTROL) | TIFM_CTRL_LED,
102 sock_addr + SOCK_CONTROL);
103 msleep(10);
104 writel((s_state & 0x7) | 0x0c00 | TIFM_CTRL_LED,
105 sock_addr + SOCK_CONTROL);
106 }
107
108 for (cnt = 0; cnt < 100; cnt++) {
Alex Dubov8b40ada2006-12-11 01:55:36 +1100109 if ((TIFM_SOCK_STATE_POWERED
110 & readl(sock_addr + SOCK_PRESENT_STATE)))
Alex Dubov4020f2d2006-10-04 02:15:37 -0700111 break;
112 msleep(10);
113 }
114
115 if (!is_x2)
116 writel(readl(sock_addr + SOCK_CONTROL) & (~TIFM_CTRL_LED),
117 sock_addr + SOCK_CONTROL);
118
119 return (readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7;
120}
121
Al Viroe069d792006-10-09 20:29:43 +0100122inline static char __iomem *
123tifm_7xx1_sock_addr(char __iomem *base_addr, unsigned int sock_num)
Alex Dubov4020f2d2006-10-04 02:15:37 -0700124{
125 return base_addr + ((sock_num + 1) << 10);
126}
127
Alex Dubov7146f0d2006-12-18 14:20:06 +1100128static int tifm_7xx1_switch_media(void *data)
Alex Dubov4020f2d2006-10-04 02:15:37 -0700129{
Alex Dubov7146f0d2006-12-18 14:20:06 +1100130 struct tifm_adapter *fm = data;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700131 unsigned long flags;
Alex Dubove23f2b82007-04-12 16:59:14 +1000132 unsigned char media_id;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700133 char *card_name = "xx";
Alex Dubov7146f0d2006-12-18 14:20:06 +1100134 int cnt, rc;
Alex Dubov6412d922006-12-11 01:55:33 +1100135 struct tifm_dev *sock;
136 unsigned int socket_change_set;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700137
Alex Dubov6412d922006-12-11 01:55:33 +1100138 while (1) {
Alex Dubov7146f0d2006-12-18 14:20:06 +1100139 rc = wait_event_interruptible(fm->change_set_notify,
140 fm->socket_change_set);
141 if (rc == -ERESTARTSYS)
142 try_to_freeze();
143
Alex Dubov6412d922006-12-11 01:55:33 +1100144 spin_lock_irqsave(&fm->lock, flags);
145 socket_change_set = fm->socket_change_set;
146 fm->socket_change_set = 0;
147
148 dev_dbg(fm->dev, "checking media set %x\n",
149 socket_change_set);
150
Alex Dubov7146f0d2006-12-18 14:20:06 +1100151 if (kthread_should_stop())
Alex Dubov6412d922006-12-11 01:55:33 +1100152 socket_change_set = (1 << fm->num_sockets) - 1;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700153 spin_unlock_irqrestore(&fm->lock, flags);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700154
Alex Dubov6412d922006-12-11 01:55:33 +1100155 if (!socket_change_set)
Alex Dubov7146f0d2006-12-18 14:20:06 +1100156 continue;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700157
Alex Dubov6412d922006-12-11 01:55:33 +1100158 spin_lock_irqsave(&fm->lock, flags);
159 for (cnt = 0; cnt < fm->num_sockets; cnt++) {
160 if (!(socket_change_set & (1 << cnt)))
161 continue;
162 sock = fm->sockets[cnt];
163 if (sock) {
Alex Dubov4020f2d2006-10-04 02:15:37 -0700164 printk(KERN_INFO DRIVER_NAME
Alex Dubov6412d922006-12-11 01:55:33 +1100165 ": demand removing card from socket %d\n",
166 cnt);
167 fm->sockets[cnt] = NULL;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700168 spin_unlock_irqrestore(&fm->lock, flags);
Alex Dubov6412d922006-12-11 01:55:33 +1100169 device_unregister(&sock->dev);
170 spin_lock_irqsave(&fm->lock, flags);
171 writel(0x0e00,
172 tifm_7xx1_sock_addr(fm->addr, cnt)
173 + SOCK_CONTROL);
174 }
Alex Dubov7146f0d2006-12-18 14:20:06 +1100175 if (kthread_should_stop())
Alex Dubov6412d922006-12-11 01:55:33 +1100176 continue;
177
178 spin_unlock_irqrestore(&fm->lock, flags);
179 media_id = tifm_7xx1_toggle_sock_power(
180 tifm_7xx1_sock_addr(fm->addr, cnt),
181 fm->num_sockets == 2);
182 if (media_id) {
183 sock = tifm_alloc_device(fm);
184 if (sock) {
185 sock->addr = tifm_7xx1_sock_addr(fm->addr,
Alex Dubov8b40ada2006-12-11 01:55:36 +1100186 cnt);
Alex Dubove23f2b82007-04-12 16:59:14 +1000187 sock->type = media_id;
Alex Dubov6412d922006-12-11 01:55:33 +1100188 sock->socket_id = cnt;
189 switch (media_id) {
190 case 1:
191 card_name = "xd";
192 break;
193 case 2:
194 card_name = "ms";
195 break;
196 case 3:
197 card_name = "sd";
198 break;
199 default:
200 tifm_free_device(&sock->dev);
201 spin_lock_irqsave(&fm->lock, flags);
202 continue;
203 }
204 snprintf(sock->dev.bus_id, BUS_ID_SIZE,
Alex Dubov8b40ada2006-12-11 01:55:36 +1100205 "tifm_%s%u:%u", card_name,
206 fm->id, cnt);
Alex Dubov6412d922006-12-11 01:55:33 +1100207 printk(KERN_INFO DRIVER_NAME
Alex Dubov8b40ada2006-12-11 01:55:36 +1100208 ": %s card detected in socket %d\n",
209 card_name, cnt);
Alex Dubov6412d922006-12-11 01:55:33 +1100210 if (!device_register(&sock->dev)) {
211 spin_lock_irqsave(&fm->lock, flags);
212 if (!fm->sockets[cnt]) {
213 fm->sockets[cnt] = sock;
214 sock = NULL;
215 }
216 spin_unlock_irqrestore(&fm->lock, flags);
217 }
218 if (sock)
219 tifm_free_device(&sock->dev);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700220 }
Alex Dubov6412d922006-12-11 01:55:33 +1100221 spin_lock_irqsave(&fm->lock, flags);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700222 }
223 }
Alex Dubov4020f2d2006-10-04 02:15:37 -0700224
Alex Dubov7146f0d2006-12-18 14:20:06 +1100225 if (!kthread_should_stop()) {
Alex Dubov6412d922006-12-11 01:55:33 +1100226 writel(TIFM_IRQ_FIFOMASK(socket_change_set)
227 | TIFM_IRQ_CARDMASK(socket_change_set),
228 fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
229 writel(TIFM_IRQ_FIFOMASK(socket_change_set)
230 | TIFM_IRQ_CARDMASK(socket_change_set),
231 fm->addr + FM_SET_INTERRUPT_ENABLE);
232 writel(TIFM_IRQ_ENABLE,
233 fm->addr + FM_SET_INTERRUPT_ENABLE);
234 spin_unlock_irqrestore(&fm->lock, flags);
Alex Dubov6412d922006-12-11 01:55:33 +1100235 } else {
236 for (cnt = 0; cnt < fm->num_sockets; cnt++) {
237 if (fm->sockets[cnt])
238 fm->socket_change_set |= 1 << cnt;
239 }
240 if (!fm->socket_change_set) {
241 spin_unlock_irqrestore(&fm->lock, flags);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100242 return 0;
Alex Dubov6412d922006-12-11 01:55:33 +1100243 } else {
244 spin_unlock_irqrestore(&fm->lock, flags);
245 }
246 }
247 }
Alex Dubov7146f0d2006-12-18 14:20:06 +1100248 return 0;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700249}
250
Alex Dubov7146f0d2006-12-18 14:20:06 +1100251#ifdef CONFIG_PM
252
Alex Dubov4020f2d2006-10-04 02:15:37 -0700253static int tifm_7xx1_suspend(struct pci_dev *dev, pm_message_t state)
254{
Alex Dubov7146f0d2006-12-18 14:20:06 +1100255 dev_dbg(&dev->dev, "suspending host\n");
Alex Dubov4020f2d2006-10-04 02:15:37 -0700256
Alex Dubov7146f0d2006-12-18 14:20:06 +1100257 pci_save_state(dev);
258 pci_enable_wake(dev, pci_choose_state(dev, state), 0);
259 pci_disable_device(dev);
260 pci_set_power_state(dev, pci_choose_state(dev, state));
Alex Dubov4020f2d2006-10-04 02:15:37 -0700261 return 0;
262}
263
264static int tifm_7xx1_resume(struct pci_dev *dev)
265{
266 struct tifm_adapter *fm = pci_get_drvdata(dev);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100267 int cnt, rc;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700268 unsigned long flags;
Alex Dubove23f2b82007-04-12 16:59:14 +1000269 unsigned char new_ids[fm->num_sockets];
Alex Dubov4020f2d2006-10-04 02:15:37 -0700270
Alex Dubov7146f0d2006-12-18 14:20:06 +1100271 pci_set_power_state(dev, PCI_D0);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700272 pci_restore_state(dev);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100273 rc = pci_enable_device(dev);
274 if (rc)
275 return rc;
276 pci_set_master(dev);
277
278 dev_dbg(&dev->dev, "resuming host\n");
279
280 for (cnt = 0; cnt < fm->num_sockets; cnt++)
281 new_ids[cnt] = tifm_7xx1_toggle_sock_power(
282 tifm_7xx1_sock_addr(fm->addr, cnt),
283 fm->num_sockets == 2);
284 spin_lock_irqsave(&fm->lock, flags);
285 fm->socket_change_set = 0;
286 for (cnt = 0; cnt < fm->num_sockets; cnt++) {
287 if (fm->sockets[cnt]) {
Alex Dubove23f2b82007-04-12 16:59:14 +1000288 if (fm->sockets[cnt]->type == new_ids[cnt])
Alex Dubov7146f0d2006-12-18 14:20:06 +1100289 fm->socket_change_set |= 1 << cnt;
290
Alex Dubove23f2b82007-04-12 16:59:14 +1000291 fm->sockets[cnt]->type = new_ids[cnt];
Alex Dubov7146f0d2006-12-18 14:20:06 +1100292 }
293 }
294
295 writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SOCKMASK((1 << fm->num_sockets) - 1),
296 fm->addr + FM_SET_INTERRUPT_ENABLE);
297 if (!fm->socket_change_set) {
298 spin_unlock_irqrestore(&fm->lock, flags);
299 return 0;
300 } else {
301 fm->socket_change_set = 0;
302 spin_unlock_irqrestore(&fm->lock, flags);
303 }
304
305 wait_event_timeout(fm->change_set_notify, fm->socket_change_set, HZ);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700306
307 spin_lock_irqsave(&fm->lock, flags);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100308 writel(TIFM_IRQ_FIFOMASK(fm->socket_change_set)
309 | TIFM_IRQ_CARDMASK(fm->socket_change_set),
310 fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
311 writel(TIFM_IRQ_FIFOMASK(fm->socket_change_set)
312 | TIFM_IRQ_CARDMASK(fm->socket_change_set),
313 fm->addr + FM_SET_INTERRUPT_ENABLE);
314 writel(TIFM_IRQ_ENABLE,
315 fm->addr + FM_SET_INTERRUPT_ENABLE);
316 fm->socket_change_set = 0;
317
Alex Dubov4020f2d2006-10-04 02:15:37 -0700318 spin_unlock_irqrestore(&fm->lock, flags);
319 return 0;
320}
321
Alex Dubov7146f0d2006-12-18 14:20:06 +1100322#else
323
324#define tifm_7xx1_suspend NULL
325#define tifm_7xx1_resume NULL
326
327#endif /* CONFIG_PM */
328
Alex Dubov4020f2d2006-10-04 02:15:37 -0700329static int tifm_7xx1_probe(struct pci_dev *dev,
Alex Dubov8b40ada2006-12-11 01:55:36 +1100330 const struct pci_device_id *dev_id)
Alex Dubov4020f2d2006-10-04 02:15:37 -0700331{
332 struct tifm_adapter *fm;
333 int pci_dev_busy = 0;
334 int rc;
335
336 rc = pci_set_dma_mask(dev, DMA_32BIT_MASK);
337 if (rc)
338 return rc;
339
340 rc = pci_enable_device(dev);
341 if (rc)
342 return rc;
343
344 pci_set_master(dev);
345
346 rc = pci_request_regions(dev, DRIVER_NAME);
347 if (rc) {
348 pci_dev_busy = 1;
349 goto err_out;
350 }
351
352 pci_intx(dev, 1);
353
354 fm = tifm_alloc_adapter();
355 if (!fm) {
356 rc = -ENOMEM;
357 goto err_out_int;
358 }
359
360 fm->dev = &dev->dev;
Alex Dubovb5ad6762006-12-11 01:55:35 +1100361 fm->num_sockets = (dev->device == PCI_DEVICE_ID_TI_XX21_XX11_FM)
362 ? 4 : 2;
Alex Dubov6412d922006-12-11 01:55:33 +1100363 fm->sockets = kzalloc(sizeof(struct tifm_dev*) * fm->num_sockets,
Alex Dubov8b40ada2006-12-11 01:55:36 +1100364 GFP_KERNEL);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700365 if (!fm->sockets)
366 goto err_out_free;
367
Alex Dubov4020f2d2006-10-04 02:15:37 -0700368 fm->eject = tifm_7xx1_eject;
369 pci_set_drvdata(dev, fm);
370
371 fm->addr = ioremap(pci_resource_start(dev, 0),
Alex Dubov8b40ada2006-12-11 01:55:36 +1100372 pci_resource_len(dev, 0));
Alex Dubov4020f2d2006-10-04 02:15:37 -0700373 if (!fm->addr)
374 goto err_out_free;
375
Thomas Gleixner38515e92007-02-14 00:33:16 -0800376 rc = request_irq(dev->irq, tifm_7xx1_isr, IRQF_SHARED, DRIVER_NAME, fm);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700377 if (rc)
378 goto err_out_unmap;
379
Alex Dubov7146f0d2006-12-18 14:20:06 +1100380 init_waitqueue_head(&fm->change_set_notify);
381 rc = tifm_add_adapter(fm, tifm_7xx1_switch_media);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700382 if (rc)
383 goto err_out_irq;
384
385 writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
Alex Dubov6412d922006-12-11 01:55:33 +1100386 writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SOCKMASK((1 << fm->num_sockets) - 1),
Alex Dubov8b40ada2006-12-11 01:55:36 +1100387 fm->addr + FM_SET_INTERRUPT_ENABLE);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100388 wake_up_process(fm->media_switcher);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700389 return 0;
390
391err_out_irq:
392 free_irq(dev->irq, fm);
393err_out_unmap:
394 iounmap(fm->addr);
395err_out_free:
396 pci_set_drvdata(dev, NULL);
397 tifm_free_adapter(fm);
398err_out_int:
399 pci_intx(dev, 0);
400 pci_release_regions(dev);
401err_out:
402 if (!pci_dev_busy)
403 pci_disable_device(dev);
404 return rc;
405}
406
407static void tifm_7xx1_remove(struct pci_dev *dev)
408{
409 struct tifm_adapter *fm = pci_get_drvdata(dev);
410 unsigned long flags;
411
Alex Dubov7146f0d2006-12-18 14:20:06 +1100412 writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE);
413 mmiowb();
414 free_irq(dev->irq, fm);
415
Alex Dubov4020f2d2006-10-04 02:15:37 -0700416 spin_lock_irqsave(&fm->lock, flags);
Alex Dubov7146f0d2006-12-18 14:20:06 +1100417 fm->socket_change_set = (1 << fm->num_sockets) - 1;
Alex Dubov4020f2d2006-10-04 02:15:37 -0700418 spin_unlock_irqrestore(&fm->lock, flags);
419
Alex Dubov7146f0d2006-12-18 14:20:06 +1100420 kthread_stop(fm->media_switcher);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700421
422 tifm_remove_adapter(fm);
423
Al Viroe069d792006-10-09 20:29:43 +0100424 pci_set_drvdata(dev, NULL);
Alex Dubov4020f2d2006-10-04 02:15:37 -0700425
426 iounmap(fm->addr);
427 pci_intx(dev, 0);
428 pci_release_regions(dev);
429
430 pci_disable_device(dev);
431 tifm_free_adapter(fm);
432}
433
434static struct pci_device_id tifm_7xx1_pci_tbl [] = {
Alex Dubovb5ad6762006-12-11 01:55:35 +1100435 { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX21_XX11_FM, PCI_ANY_ID,
436 PCI_ANY_ID, 0, 0, 0 }, /* xx21 - the one I have */
437 { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX12_FM, PCI_ANY_ID,
438 PCI_ANY_ID, 0, 0, 0 },
439 { PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_XX20_FM, PCI_ANY_ID,
440 PCI_ANY_ID, 0, 0, 0 },
Alex Dubov4020f2d2006-10-04 02:15:37 -0700441 { }
442};
443
444static struct pci_driver tifm_7xx1_driver = {
445 .name = DRIVER_NAME,
446 .id_table = tifm_7xx1_pci_tbl,
447 .probe = tifm_7xx1_probe,
448 .remove = tifm_7xx1_remove,
449 .suspend = tifm_7xx1_suspend,
450 .resume = tifm_7xx1_resume,
451};
452
453static int __init tifm_7xx1_init(void)
454{
455 return pci_register_driver(&tifm_7xx1_driver);
456}
457
458static void __exit tifm_7xx1_exit(void)
459{
460 pci_unregister_driver(&tifm_7xx1_driver);
461}
462
463MODULE_AUTHOR("Alex Dubov");
464MODULE_DESCRIPTION("TI FlashMedia host driver");
465MODULE_LICENSE("GPL");
466MODULE_DEVICE_TABLE(pci, tifm_7xx1_pci_tbl);
467MODULE_VERSION(DRIVER_VERSION);
468
469module_init(tifm_7xx1_init);
470module_exit(tifm_7xx1_exit);