GNU Linux-libre 4.19.286-gnu1
[releases.git] / drivers / ipack / carriers / tpci200.c
1 /**
2  * tpci200.c
3  *
4  * driver for the TEWS TPCI-200 device
5  *
6  * Copyright (C) 2009-2012 CERN (www.cern.ch)
7  * Author: Nicolas Serafini, EIC2 SA
8  * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU General Public License as published by the Free
12  * Software Foundation; version 2 of the License.
13  */
14
15 #include <linux/module.h>
16 #include <linux/slab.h>
17 #include "tpci200.h"
18
19 static const u16 tpci200_status_timeout[] = {
20         TPCI200_A_TIMEOUT,
21         TPCI200_B_TIMEOUT,
22         TPCI200_C_TIMEOUT,
23         TPCI200_D_TIMEOUT,
24 };
25
26 static const u16 tpci200_status_error[] = {
27         TPCI200_A_ERROR,
28         TPCI200_B_ERROR,
29         TPCI200_C_ERROR,
30         TPCI200_D_ERROR,
31 };
32
33 static const size_t tpci200_space_size[IPACK_SPACE_COUNT] = {
34         [IPACK_IO_SPACE]    = TPCI200_IO_SPACE_SIZE,
35         [IPACK_ID_SPACE]    = TPCI200_ID_SPACE_SIZE,
36         [IPACK_INT_SPACE]   = TPCI200_INT_SPACE_SIZE,
37         [IPACK_MEM8_SPACE]  = TPCI200_MEM8_SPACE_SIZE,
38         [IPACK_MEM16_SPACE] = TPCI200_MEM16_SPACE_SIZE,
39 };
40
41 static const size_t tpci200_space_interval[IPACK_SPACE_COUNT] = {
42         [IPACK_IO_SPACE]    = TPCI200_IO_SPACE_INTERVAL,
43         [IPACK_ID_SPACE]    = TPCI200_ID_SPACE_INTERVAL,
44         [IPACK_INT_SPACE]   = TPCI200_INT_SPACE_INTERVAL,
45         [IPACK_MEM8_SPACE]  = TPCI200_MEM8_SPACE_INTERVAL,
46         [IPACK_MEM16_SPACE] = TPCI200_MEM16_SPACE_INTERVAL,
47 };
48
49 static struct tpci200_board *check_slot(struct ipack_device *dev)
50 {
51         struct tpci200_board *tpci200;
52
53         if (dev == NULL)
54                 return NULL;
55
56
57         tpci200 = dev_get_drvdata(dev->bus->parent);
58
59         if (tpci200 == NULL) {
60                 dev_info(&dev->dev, "carrier board not found\n");
61                 return NULL;
62         }
63
64         if (dev->slot >= TPCI200_NB_SLOT) {
65                 dev_info(&dev->dev,
66                          "Slot [%d:%d] doesn't exist! Last tpci200 slot is %d.\n",
67                          dev->bus->bus_nr, dev->slot, TPCI200_NB_SLOT-1);
68                 return NULL;
69         }
70
71         return tpci200;
72 }
73
74 static void tpci200_clear_mask(struct tpci200_board *tpci200,
75                                __le16 __iomem *addr, u16 mask)
76 {
77         unsigned long flags;
78         spin_lock_irqsave(&tpci200->regs_lock, flags);
79         iowrite16(ioread16(addr) & (~mask), addr);
80         spin_unlock_irqrestore(&tpci200->regs_lock, flags);
81 }
82
83 static void tpci200_set_mask(struct tpci200_board *tpci200,
84                              __le16 __iomem *addr, u16 mask)
85 {
86         unsigned long flags;
87         spin_lock_irqsave(&tpci200->regs_lock, flags);
88         iowrite16(ioread16(addr) | mask, addr);
89         spin_unlock_irqrestore(&tpci200->regs_lock, flags);
90 }
91
92 static void tpci200_unregister(struct tpci200_board *tpci200)
93 {
94         free_irq(tpci200->info->pdev->irq, (void *) tpci200);
95
96         pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
97
98         pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
99         pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
100         pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
101         pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
102
103         pci_disable_device(tpci200->info->pdev);
104 }
105
106 static void tpci200_enable_irq(struct tpci200_board *tpci200,
107                                int islot)
108 {
109         tpci200_set_mask(tpci200,
110                         &tpci200->info->interface_regs->control[islot],
111                         TPCI200_INT0_EN | TPCI200_INT1_EN);
112 }
113
114 static void tpci200_disable_irq(struct tpci200_board *tpci200,
115                                 int islot)
116 {
117         tpci200_clear_mask(tpci200,
118                         &tpci200->info->interface_regs->control[islot],
119                         TPCI200_INT0_EN | TPCI200_INT1_EN);
120 }
121
122 static irqreturn_t tpci200_slot_irq(struct slot_irq *slot_irq)
123 {
124         irqreturn_t ret;
125
126         if (!slot_irq)
127                 return -ENODEV;
128         ret = slot_irq->handler(slot_irq->arg);
129
130         return ret;
131 }
132
133 static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
134 {
135         struct tpci200_board *tpci200 = (struct tpci200_board *) dev_id;
136         struct slot_irq *slot_irq;
137         irqreturn_t ret;
138         u16 status_reg;
139         int i;
140
141         /* Read status register */
142         status_reg = ioread16(&tpci200->info->interface_regs->status);
143
144         /* Did we cause the interrupt? */
145         if (!(status_reg & TPCI200_SLOT_INT_MASK))
146                 return IRQ_NONE;
147
148         /* callback to the IRQ handler for the corresponding slot */
149         rcu_read_lock();
150         for (i = 0; i < TPCI200_NB_SLOT; i++) {
151                 if (!(status_reg & ((TPCI200_A_INT0 | TPCI200_A_INT1) << (2 * i))))
152                         continue;
153                 slot_irq = rcu_dereference(tpci200->slots[i].irq);
154                 ret = tpci200_slot_irq(slot_irq);
155                 if (ret == -ENODEV) {
156                         dev_info(&tpci200->info->pdev->dev,
157                                  "No registered ISR for slot [%d:%d]!. IRQ will be disabled.\n",
158                                  tpci200->number, i);
159                         tpci200_disable_irq(tpci200, i);
160                 }
161         }
162         rcu_read_unlock();
163
164         return IRQ_HANDLED;
165 }
166
167 static int tpci200_free_irq(struct ipack_device *dev)
168 {
169         struct slot_irq *slot_irq;
170         struct tpci200_board *tpci200;
171
172         tpci200 = check_slot(dev);
173         if (tpci200 == NULL)
174                 return -EINVAL;
175
176         if (mutex_lock_interruptible(&tpci200->mutex))
177                 return -ERESTARTSYS;
178
179         if (tpci200->slots[dev->slot].irq == NULL) {
180                 mutex_unlock(&tpci200->mutex);
181                 return -EINVAL;
182         }
183
184         tpci200_disable_irq(tpci200, dev->slot);
185         slot_irq = tpci200->slots[dev->slot].irq;
186         /* uninstall handler */
187         RCU_INIT_POINTER(tpci200->slots[dev->slot].irq, NULL);
188         synchronize_rcu();
189         kfree(slot_irq);
190         mutex_unlock(&tpci200->mutex);
191         return 0;
192 }
193
194 static int tpci200_request_irq(struct ipack_device *dev,
195                                irqreturn_t (*handler)(void *), void *arg)
196 {
197         int res = 0;
198         struct slot_irq *slot_irq;
199         struct tpci200_board *tpci200;
200
201         tpci200 = check_slot(dev);
202         if (tpci200 == NULL)
203                 return -EINVAL;
204
205         if (mutex_lock_interruptible(&tpci200->mutex))
206                 return -ERESTARTSYS;
207
208         if (tpci200->slots[dev->slot].irq != NULL) {
209                 dev_err(&dev->dev,
210                         "Slot [%d:%d] IRQ already registered !\n",
211                         dev->bus->bus_nr,
212                         dev->slot);
213                 res = -EINVAL;
214                 goto out_unlock;
215         }
216
217         slot_irq = kzalloc(sizeof(struct slot_irq), GFP_KERNEL);
218         if (slot_irq == NULL) {
219                 dev_err(&dev->dev,
220                         "Slot [%d:%d] unable to allocate memory for IRQ !\n",
221                         dev->bus->bus_nr, dev->slot);
222                 res = -ENOMEM;
223                 goto out_unlock;
224         }
225
226         /*
227          * WARNING: Setup Interrupt Vector in the IndustryPack device
228          * before an IRQ request.
229          * Read the User Manual of your IndustryPack device to know
230          * where to write the vector in memory.
231          */
232         slot_irq->handler = handler;
233         slot_irq->arg = arg;
234         slot_irq->holder = dev;
235
236         rcu_assign_pointer(tpci200->slots[dev->slot].irq, slot_irq);
237         tpci200_enable_irq(tpci200, dev->slot);
238
239 out_unlock:
240         mutex_unlock(&tpci200->mutex);
241         return res;
242 }
243
244 static int tpci200_register(struct tpci200_board *tpci200)
245 {
246         int i;
247         int res;
248         phys_addr_t ioidint_base;
249         unsigned short slot_ctrl;
250
251         if (pci_enable_device(tpci200->info->pdev) < 0)
252                 return -ENODEV;
253
254         /* Request IP interface register (Bar 2) */
255         res = pci_request_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR,
256                                  "Carrier IP interface registers");
257         if (res) {
258                 dev_err(&tpci200->info->pdev->dev,
259                         "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 2 !",
260                         tpci200->info->pdev->bus->number,
261                         tpci200->info->pdev->devfn);
262                 goto err_disable_device;
263         }
264
265         /* Request IO ID INT space (Bar 3) */
266         res = pci_request_region(tpci200->info->pdev,
267                                  TPCI200_IO_ID_INT_SPACES_BAR,
268                                  "Carrier IO ID INT space");
269         if (res) {
270                 dev_err(&tpci200->info->pdev->dev,
271                         "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 3 !",
272                         tpci200->info->pdev->bus->number,
273                         tpci200->info->pdev->devfn);
274                 goto err_ip_interface_bar;
275         }
276
277         /* Request MEM8 space (Bar 5) */
278         res = pci_request_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR,
279                                  "Carrier MEM8 space");
280         if (res) {
281                 dev_err(&tpci200->info->pdev->dev,
282                         "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 5!",
283                         tpci200->info->pdev->bus->number,
284                         tpci200->info->pdev->devfn);
285                 goto err_io_id_int_spaces_bar;
286         }
287
288         /* Request MEM16 space (Bar 4) */
289         res = pci_request_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR,
290                                  "Carrier MEM16 space");
291         if (res) {
292                 dev_err(&tpci200->info->pdev->dev,
293                         "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 4!",
294                         tpci200->info->pdev->bus->number,
295                         tpci200->info->pdev->devfn);
296                 goto err_mem8_space_bar;
297         }
298
299         /* Map internal tpci200 driver user space */
300         tpci200->info->interface_regs =
301                 ioremap_nocache(pci_resource_start(tpci200->info->pdev,
302                                            TPCI200_IP_INTERFACE_BAR),
303                         TPCI200_IFACE_SIZE);
304         if (!tpci200->info->interface_regs) {
305                 dev_err(&tpci200->info->pdev->dev,
306                         "(bn 0x%X, sn 0x%X) failed to map driver user space!",
307                         tpci200->info->pdev->bus->number,
308                         tpci200->info->pdev->devfn);
309                 res = -ENOMEM;
310                 goto err_mem16_space_bar;
311         }
312
313         /* Initialize lock that protects interface_regs */
314         spin_lock_init(&tpci200->regs_lock);
315
316         ioidint_base = pci_resource_start(tpci200->info->pdev,
317                                           TPCI200_IO_ID_INT_SPACES_BAR);
318         tpci200->mod_mem[IPACK_IO_SPACE] = ioidint_base + TPCI200_IO_SPACE_OFF;
319         tpci200->mod_mem[IPACK_ID_SPACE] = ioidint_base + TPCI200_ID_SPACE_OFF;
320         tpci200->mod_mem[IPACK_INT_SPACE] =
321                 ioidint_base + TPCI200_INT_SPACE_OFF;
322         tpci200->mod_mem[IPACK_MEM8_SPACE] =
323                 pci_resource_start(tpci200->info->pdev,
324                                    TPCI200_MEM8_SPACE_BAR);
325         tpci200->mod_mem[IPACK_MEM16_SPACE] =
326                 pci_resource_start(tpci200->info->pdev,
327                                    TPCI200_MEM16_SPACE_BAR);
328
329         /* Set the default parameters of the slot
330          * INT0 disabled, level sensitive
331          * INT1 disabled, level sensitive
332          * error interrupt disabled
333          * timeout interrupt disabled
334          * recover time disabled
335          * clock rate 8 MHz
336          */
337         slot_ctrl = 0;
338         for (i = 0; i < TPCI200_NB_SLOT; i++)
339                 writew(slot_ctrl, &tpci200->info->interface_regs->control[i]);
340
341         res = request_irq(tpci200->info->pdev->irq,
342                           tpci200_interrupt, IRQF_SHARED,
343                           KBUILD_MODNAME, (void *) tpci200);
344         if (res) {
345                 dev_err(&tpci200->info->pdev->dev,
346                         "(bn 0x%X, sn 0x%X) unable to register IRQ !",
347                         tpci200->info->pdev->bus->number,
348                         tpci200->info->pdev->devfn);
349                 goto err_interface_regs;
350         }
351
352         return 0;
353
354 err_interface_regs:
355         pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
356 err_mem16_space_bar:
357         pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
358 err_mem8_space_bar:
359         pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
360 err_io_id_int_spaces_bar:
361         pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
362 err_ip_interface_bar:
363         pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
364 err_disable_device:
365         pci_disable_device(tpci200->info->pdev);
366         return res;
367 }
368
369 static int tpci200_get_clockrate(struct ipack_device *dev)
370 {
371         struct tpci200_board *tpci200 = check_slot(dev);
372         __le16 __iomem *addr;
373
374         if (!tpci200)
375                 return -ENODEV;
376
377         addr = &tpci200->info->interface_regs->control[dev->slot];
378         return (ioread16(addr) & TPCI200_CLK32) ? 32 : 8;
379 }
380
381 static int tpci200_set_clockrate(struct ipack_device *dev, int mherz)
382 {
383         struct tpci200_board *tpci200 = check_slot(dev);
384         __le16 __iomem *addr;
385
386         if (!tpci200)
387                 return -ENODEV;
388
389         addr = &tpci200->info->interface_regs->control[dev->slot];
390
391         switch (mherz) {
392         case 8:
393                 tpci200_clear_mask(tpci200, addr, TPCI200_CLK32);
394                 break;
395         case 32:
396                 tpci200_set_mask(tpci200, addr, TPCI200_CLK32);
397                 break;
398         default:
399                 return -EINVAL;
400         }
401         return 0;
402 }
403
404 static int tpci200_get_error(struct ipack_device *dev)
405 {
406         struct tpci200_board *tpci200 = check_slot(dev);
407         __le16 __iomem *addr;
408         u16 mask;
409
410         if (!tpci200)
411                 return -ENODEV;
412
413         addr = &tpci200->info->interface_regs->status;
414         mask = tpci200_status_error[dev->slot];
415         return (ioread16(addr) & mask) ? 1 : 0;
416 }
417
418 static int tpci200_get_timeout(struct ipack_device *dev)
419 {
420         struct tpci200_board *tpci200 = check_slot(dev);
421         __le16 __iomem *addr;
422         u16 mask;
423
424         if (!tpci200)
425                 return -ENODEV;
426
427         addr = &tpci200->info->interface_regs->status;
428         mask = tpci200_status_timeout[dev->slot];
429
430         return (ioread16(addr) & mask) ? 1 : 0;
431 }
432
433 static int tpci200_reset_timeout(struct ipack_device *dev)
434 {
435         struct tpci200_board *tpci200 = check_slot(dev);
436         __le16 __iomem *addr;
437         u16 mask;
438
439         if (!tpci200)
440                 return -ENODEV;
441
442         addr = &tpci200->info->interface_regs->status;
443         mask = tpci200_status_timeout[dev->slot];
444
445         iowrite16(mask, addr);
446         return 0;
447 }
448
449 static void tpci200_uninstall(struct tpci200_board *tpci200)
450 {
451         tpci200_unregister(tpci200);
452         kfree(tpci200->slots);
453 }
454
455 static const struct ipack_bus_ops tpci200_bus_ops = {
456         .request_irq = tpci200_request_irq,
457         .free_irq = tpci200_free_irq,
458         .get_clockrate = tpci200_get_clockrate,
459         .set_clockrate = tpci200_set_clockrate,
460         .get_error     = tpci200_get_error,
461         .get_timeout   = tpci200_get_timeout,
462         .reset_timeout = tpci200_reset_timeout,
463 };
464
465 static int tpci200_install(struct tpci200_board *tpci200)
466 {
467         int res;
468
469         tpci200->slots = kcalloc(TPCI200_NB_SLOT, sizeof(struct tpci200_slot),
470                                  GFP_KERNEL);
471         if (tpci200->slots == NULL)
472                 return -ENOMEM;
473
474         res = tpci200_register(tpci200);
475         if (res) {
476                 kfree(tpci200->slots);
477                 tpci200->slots = NULL;
478                 return res;
479         }
480
481         mutex_init(&tpci200->mutex);
482         return 0;
483 }
484
485 static void tpci200_release_device(struct ipack_device *dev)
486 {
487         kfree(dev);
488 }
489
490 static int tpci200_create_device(struct tpci200_board *tpci200, int i)
491 {
492         int ret;
493         enum ipack_space space;
494         struct ipack_device *dev =
495                 kzalloc(sizeof(struct ipack_device), GFP_KERNEL);
496         if (!dev)
497                 return -ENOMEM;
498         dev->slot = i;
499         dev->bus = tpci200->info->ipack_bus;
500         dev->release = tpci200_release_device;
501
502         for (space = 0; space < IPACK_SPACE_COUNT; space++) {
503                 dev->region[space].start =
504                         tpci200->mod_mem[space]
505                         + tpci200_space_interval[space] * i;
506                 dev->region[space].size = tpci200_space_size[space];
507         }
508
509         ret = ipack_device_init(dev);
510         if (ret < 0) {
511                 ipack_put_device(dev);
512                 return ret;
513         }
514
515         ret = ipack_device_add(dev);
516         if (ret < 0)
517                 ipack_put_device(dev);
518
519         return ret;
520 }
521
522 static int tpci200_pci_probe(struct pci_dev *pdev,
523                              const struct pci_device_id *id)
524 {
525         int ret, i;
526         struct tpci200_board *tpci200;
527         u32 reg32;
528
529         tpci200 = kzalloc(sizeof(struct tpci200_board), GFP_KERNEL);
530         if (!tpci200)
531                 return -ENOMEM;
532
533         tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL);
534         if (!tpci200->info) {
535                 ret = -ENOMEM;
536                 goto err_tpci200;
537         }
538
539         pci_dev_get(pdev);
540
541         /* Obtain a mapping of the carrier's PCI configuration registers */
542         ret = pci_request_region(pdev, TPCI200_CFG_MEM_BAR,
543                                  KBUILD_MODNAME " Configuration Memory");
544         if (ret) {
545                 dev_err(&pdev->dev, "Failed to allocate PCI Configuration Memory");
546                 ret = -EBUSY;
547                 goto err_tpci200_info;
548         }
549         tpci200->info->cfg_regs = ioremap_nocache(
550                         pci_resource_start(pdev, TPCI200_CFG_MEM_BAR),
551                         pci_resource_len(pdev, TPCI200_CFG_MEM_BAR));
552         if (!tpci200->info->cfg_regs) {
553                 dev_err(&pdev->dev, "Failed to map PCI Configuration Memory");
554                 ret = -EFAULT;
555                 goto err_request_region;
556         }
557
558         /* Disable byte swapping for 16 bit IP module access. This will ensure
559          * that the Industrypack big endian byte order is preserved by the
560          * carrier. */
561         reg32 = ioread32(tpci200->info->cfg_regs + LAS1_DESC);
562         reg32 |= 1 << LAS_BIT_BIGENDIAN;
563         iowrite32(reg32, tpci200->info->cfg_regs + LAS1_DESC);
564
565         reg32 = ioread32(tpci200->info->cfg_regs + LAS2_DESC);
566         reg32 |= 1 << LAS_BIT_BIGENDIAN;
567         iowrite32(reg32, tpci200->info->cfg_regs + LAS2_DESC);
568
569         /* Save struct pci_dev pointer */
570         tpci200->info->pdev = pdev;
571         tpci200->info->id_table = (struct pci_device_id *)id;
572
573         /* register the device and initialize it */
574         ret = tpci200_install(tpci200);
575         if (ret) {
576                 dev_err(&pdev->dev, "error during tpci200 install\n");
577                 ret = -ENODEV;
578                 goto err_cfg_regs;
579         }
580
581         /* Register the carrier in the industry pack bus driver */
582         tpci200->info->ipack_bus = ipack_bus_register(&pdev->dev,
583                                                       TPCI200_NB_SLOT,
584                                                       &tpci200_bus_ops,
585                                                       THIS_MODULE);
586         if (!tpci200->info->ipack_bus) {
587                 dev_err(&pdev->dev,
588                         "error registering the carrier on ipack driver\n");
589                 ret = -EFAULT;
590                 goto err_tpci200_install;
591         }
592
593         /* save the bus number given by ipack to logging purpose */
594         tpci200->number = tpci200->info->ipack_bus->bus_nr;
595         dev_set_drvdata(&pdev->dev, tpci200);
596
597         for (i = 0; i < TPCI200_NB_SLOT; i++)
598                 tpci200_create_device(tpci200, i);
599         return 0;
600
601 err_tpci200_install:
602         tpci200_uninstall(tpci200);
603 err_cfg_regs:
604         pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
605 err_request_region:
606         pci_release_region(pdev, TPCI200_CFG_MEM_BAR);
607 err_tpci200_info:
608         kfree(tpci200->info);
609         pci_dev_put(pdev);
610 err_tpci200:
611         kfree(tpci200);
612         return ret;
613 }
614
615 static void __tpci200_pci_remove(struct tpci200_board *tpci200)
616 {
617         ipack_bus_unregister(tpci200->info->ipack_bus);
618         tpci200_uninstall(tpci200);
619
620         pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);
621
622         pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR);
623
624         pci_dev_put(tpci200->info->pdev);
625
626         kfree(tpci200->info);
627         kfree(tpci200);
628 }
629
630 static void tpci200_pci_remove(struct pci_dev *dev)
631 {
632         struct tpci200_board *tpci200 = pci_get_drvdata(dev);
633
634         __tpci200_pci_remove(tpci200);
635 }
636
637 static const struct pci_device_id tpci200_idtable[] = {
638         { TPCI200_VENDOR_ID, TPCI200_DEVICE_ID, TPCI200_SUBVENDOR_ID,
639           TPCI200_SUBDEVICE_ID },
640         { 0, },
641 };
642
643 MODULE_DEVICE_TABLE(pci, tpci200_idtable);
644
645 static struct pci_driver tpci200_pci_drv = {
646         .name = "tpci200",
647         .id_table = tpci200_idtable,
648         .probe = tpci200_pci_probe,
649         .remove = tpci200_pci_remove,
650 };
651
652 module_pci_driver(tpci200_pci_drv);
653
654 MODULE_DESCRIPTION("TEWS TPCI-200 device driver");
655 MODULE_LICENSE("GPL");