Merge branch 'drm-radeon-sun-hainan' of git://people.freedesktop.org/~airlied/linux
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / comedi / drivers / skel.c
1 /*
2 comedi/drivers/skel.c
3 Skeleton code for a Comedi driver
4
5 COMEDI - Linux Control and Measurement Device Interface
6 Copyright (C) 2000 David A. Schleef <ds@schleef.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 */
23 /*
24 Driver: skel
25 Description: Skeleton driver, an example for driver writers
26 Devices:
27 Author: ds
28 Updated: Mon, 18 Mar 2002 15:34:01 -0800
29 Status: works
30
31 This driver is a documented example on how Comedi drivers are
32 written.
33
34 Configuration Options:
35 none
36 */
37
38 /*
39 * The previous block comment is used to automatically generate
40 * documentation in Comedi and Comedilib. The fields:
41 *
42 * Driver: the name of the driver
43 * Description: a short phrase describing the driver. Don't list boards.
44 * Devices: a full list of the boards that attempt to be supported by
45 * the driver. Format is "(manufacturer) board name [comedi name]",
46 * where comedi_name is the name that is used to configure the board.
47 * See the comment near board_name: in the struct comedi_driver structure
48 * below. If (manufacturer) or [comedi name] is missing, the previous
49 * value is used.
50 * Author: you
51 * Updated: date when the _documentation_ was last updated. Use 'date -R'
52 * to get a value for this.
53 * Status: a one-word description of the status. Valid values are:
54 * works - driver works correctly on most boards supported, and
55 * passes comedi_test.
56 * unknown - unknown. Usually put there by ds.
57 * experimental - may not work in any particular release. Author
58 * probably wants assistance testing it.
59 * bitrotten - driver has not been update in a long time, probably
60 * doesn't work, and probably is missing support for significant
61 * Comedi interface features.
62 * untested - author probably wrote it "blind", and is believed to
63 * work, but no confirmation.
64 *
65 * These headers should be followed by a blank line, and any comments
66 * you wish to say about the driver. The comment area is the place
67 * to put any known bugs, limitations, unsupported features, supported
68 * command triggers, whether or not commands are supported on particular
69 * subdevices, etc.
70 *
71 * Somewhere in the comment should be information about configuration
72 * options that are used with comedi_config.
73 */
74
75 #include <linux/pci.h>
76
77 #include "../comedidev.h"
78
79 #include "comedi_fc.h"
80
81 /* Imaginary registers for the imaginary board */
82
83 #define SKEL_SIZE 0
84
85 #define SKEL_START_AI_CONV 0
86 #define SKEL_AI_READ 0
87
88 /*
89 * Board descriptions for two imaginary boards. Describing the
90 * boards in this way is optional, and completely driver-dependent.
91 * Some drivers use arrays such as this, other do not.
92 */
93 enum skel_boardid {
94 BOARD_SKEL100,
95 BOARD_SKEL200,
96 };
97
98 struct skel_board {
99 const char *name;
100 int ai_chans;
101 int ai_bits;
102 int have_dio;
103 };
104
105 static const struct skel_board skel_boards[] = {
106 [BOARD_SKEL100] = {
107 .name = "skel-100",
108 .ai_chans = 16,
109 .ai_bits = 12,
110 .have_dio = 1,
111 },
112 [BOARD_SKEL200] = {
113 .name = "skel-200",
114 .ai_chans = 8,
115 .ai_bits = 16,
116 },
117 };
118
119 /* this structure is for data unique to this hardware driver. If
120 several hardware drivers keep similar information in this structure,
121 feel free to suggest moving the variable to the struct comedi_device struct.
122 */
123 struct skel_private {
124
125 int data;
126
127 /* Used for AO readback */
128 unsigned int ao_readback[2];
129 };
130
131 /* This function doesn't require a particular form, this is just
132 * what happens to be used in some of the drivers. It should
133 * convert ns nanoseconds to a counter value suitable for programming
134 * the device. Also, it should adjust ns so that it cooresponds to
135 * the actual time that the device will use. */
136 static int skel_ns_to_timer(unsigned int *ns, int round)
137 {
138 /* trivial timer */
139 /* if your timing is done through two cascaded timers, the
140 * i8253_cascade_ns_to_timer() function in 8253.h can be
141 * very helpful. There are also i8254_load() and i8254_mm_load()
142 * which can be used to load values into the ubiquitous 8254 counters
143 */
144
145 return *ns;
146 }
147
148 /*
149 * "instructions" read/write data in "one-shot" or "software-triggered"
150 * mode.
151 */
152 static int skel_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
153 struct comedi_insn *insn, unsigned int *data)
154 {
155 const struct skel_board *thisboard = comedi_board(dev);
156 int n, i;
157 unsigned int d;
158 unsigned int status;
159
160 /* a typical programming sequence */
161
162 /* write channel to multiplexer */
163 /* outw(chan,dev->iobase + SKEL_MUX); */
164
165 /* don't wait for mux to settle */
166
167 /* convert n samples */
168 for (n = 0; n < insn->n; n++) {
169 /* trigger conversion */
170 /* outw(0,dev->iobase + SKEL_CONVERT); */
171
172 #define TIMEOUT 100
173 /* wait for conversion to end */
174 for (i = 0; i < TIMEOUT; i++) {
175 status = 1;
176 /* status = inb(dev->iobase + SKEL_STATUS); */
177 if (status)
178 break;
179 }
180 if (i == TIMEOUT) {
181 dev_warn(dev->class_dev, "ai timeout\n");
182 return -ETIMEDOUT;
183 }
184
185 /* read data */
186 /* d = inw(dev->iobase + SKEL_AI_DATA); */
187 d = 0;
188
189 /* mangle the data as necessary */
190 d ^= 1 << (thisboard->ai_bits - 1);
191
192 data[n] = d;
193 }
194
195 /* return the number of samples read/written */
196 return n;
197 }
198
199 /*
200 * cmdtest tests a particular command to see if it is valid.
201 * Using the cmdtest ioctl, a user can create a valid cmd
202 * and then have it executes by the cmd ioctl.
203 *
204 * cmdtest returns 1,2,3,4 or 0, depending on which tests
205 * the command passes.
206 */
207 static int skel_ai_cmdtest(struct comedi_device *dev,
208 struct comedi_subdevice *s,
209 struct comedi_cmd *cmd)
210 {
211 int err = 0;
212 int tmp;
213
214 /* Step 1 : check if triggers are trivially valid */
215
216 err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
217 err |= cfc_check_trigger_src(&cmd->scan_begin_src,
218 TRIG_TIMER | TRIG_EXT);
219 err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_TIMER | TRIG_EXT);
220 err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
221 err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);
222
223 if (err)
224 return 1;
225
226 /* Step 2a : make sure trigger sources are unique */
227
228 err |= cfc_check_trigger_is_unique(cmd->scan_begin_src);
229 err |= cfc_check_trigger_is_unique(cmd->convert_src);
230 err |= cfc_check_trigger_is_unique(cmd->stop_src);
231
232 /* Step 2b : and mutually compatible */
233
234 if (err)
235 return 2;
236
237 /* Step 3: check if arguments are trivially valid */
238
239 err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
240
241 #define MAX_SPEED 10000 /* in nanoseconds */
242 #define MIN_SPEED 1000000000 /* in nanoseconds */
243
244 if (cmd->scan_begin_src == TRIG_TIMER) {
245 err |= cfc_check_trigger_arg_min(&cmd->scan_begin_arg,
246 MAX_SPEED);
247 err |= cfc_check_trigger_arg_max(&cmd->scan_begin_arg,
248 MIN_SPEED);
249 } else {
250 /* external trigger */
251 /* should be level/edge, hi/lo specification here */
252 /* should specify multiple external triggers */
253 err |= cfc_check_trigger_arg_max(&cmd->scan_begin_arg, 9);
254 }
255
256 if (cmd->convert_src == TRIG_TIMER) {
257 err |= cfc_check_trigger_arg_min(&cmd->convert_arg, MAX_SPEED);
258 err |= cfc_check_trigger_arg_max(&cmd->convert_arg, MIN_SPEED);
259 } else {
260 /* external trigger */
261 /* see above */
262 err |= cfc_check_trigger_arg_max(&cmd->scan_begin_arg, 9);
263 }
264
265 err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);
266
267 if (cmd->stop_src == TRIG_COUNT)
268 err |= cfc_check_trigger_arg_max(&cmd->stop_arg, 0x00ffffff);
269 else /* TRIG_NONE */
270 err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
271
272 if (err)
273 return 3;
274
275 /* step 4: fix up any arguments */
276
277 if (cmd->scan_begin_src == TRIG_TIMER) {
278 tmp = cmd->scan_begin_arg;
279 skel_ns_to_timer(&cmd->scan_begin_arg,
280 cmd->flags & TRIG_ROUND_MASK);
281 if (tmp != cmd->scan_begin_arg)
282 err++;
283 }
284 if (cmd->convert_src == TRIG_TIMER) {
285 tmp = cmd->convert_arg;
286 skel_ns_to_timer(&cmd->convert_arg,
287 cmd->flags & TRIG_ROUND_MASK);
288 if (tmp != cmd->convert_arg)
289 err++;
290 if (cmd->scan_begin_src == TRIG_TIMER &&
291 cmd->scan_begin_arg <
292 cmd->convert_arg * cmd->scan_end_arg) {
293 cmd->scan_begin_arg =
294 cmd->convert_arg * cmd->scan_end_arg;
295 err++;
296 }
297 }
298
299 if (err)
300 return 4;
301
302 return 0;
303 }
304
305 static int skel_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
306 struct comedi_insn *insn, unsigned int *data)
307 {
308 struct skel_private *devpriv = dev->private;
309 int i;
310 int chan = CR_CHAN(insn->chanspec);
311
312 /* Writing a list of values to an AO channel is probably not
313 * very useful, but that's how the interface is defined. */
314 for (i = 0; i < insn->n; i++) {
315 /* a typical programming sequence */
316 /* outw(data[i],dev->iobase + SKEL_DA0 + chan); */
317 devpriv->ao_readback[chan] = data[i];
318 }
319
320 /* return the number of samples read/written */
321 return i;
322 }
323
324 /* AO subdevices should have a read insn as well as a write insn.
325 * Usually this means copying a value stored in devpriv. */
326 static int skel_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
327 struct comedi_insn *insn, unsigned int *data)
328 {
329 struct skel_private *devpriv = dev->private;
330 int i;
331 int chan = CR_CHAN(insn->chanspec);
332
333 for (i = 0; i < insn->n; i++)
334 data[i] = devpriv->ao_readback[chan];
335
336 return i;
337 }
338
339 /* DIO devices are slightly special. Although it is possible to
340 * implement the insn_read/insn_write interface, it is much more
341 * useful to applications if you implement the insn_bits interface.
342 * This allows packed reading/writing of the DIO channels. The
343 * comedi core can convert between insn_bits and insn_read/write */
344 static int skel_dio_insn_bits(struct comedi_device *dev,
345 struct comedi_subdevice *s,
346 struct comedi_insn *insn, unsigned int *data)
347 {
348 /* The insn data is a mask in data[0] and the new data
349 * in data[1], each channel cooresponding to a bit. */
350 if (data[0]) {
351 s->state &= ~data[0];
352 s->state |= data[0] & data[1];
353 /* Write out the new digital output lines */
354 /* outw(s->state,dev->iobase + SKEL_DIO); */
355 }
356
357 /* on return, data[1] contains the value of the digital
358 * input and output lines. */
359 /* data[1]=inw(dev->iobase + SKEL_DIO); */
360 /* or we could just return the software copy of the output values if
361 * it was a purely digital output subdevice */
362 /* data[1]=s->state; */
363
364 return insn->n;
365 }
366
367 static int skel_dio_insn_config(struct comedi_device *dev,
368 struct comedi_subdevice *s,
369 struct comedi_insn *insn, unsigned int *data)
370 {
371 int chan = CR_CHAN(insn->chanspec);
372
373 /* The input or output configuration of each digital line is
374 * configured by a special insn_config instruction. chanspec
375 * contains the channel to be changed, and data[0] contains the
376 * value COMEDI_INPUT or COMEDI_OUTPUT. */
377 switch (data[0]) {
378 case INSN_CONFIG_DIO_OUTPUT:
379 s->io_bits |= 1 << chan;
380 break;
381 case INSN_CONFIG_DIO_INPUT:
382 s->io_bits &= ~(1 << chan);
383 break;
384 case INSN_CONFIG_DIO_QUERY:
385 data[1] =
386 (s->io_bits & (1 << chan)) ? COMEDI_OUTPUT : COMEDI_INPUT;
387 return insn->n;
388 break;
389 default:
390 return -EINVAL;
391 break;
392 }
393 /* outw(s->io_bits,dev->iobase + SKEL_DIO_CONFIG); */
394
395 return insn->n;
396 }
397
398 /*
399 * Handle common part of skel_attach() and skel_auto_attach().
400 */
401 static int skel_common_attach(struct comedi_device *dev)
402 {
403 const struct skel_board *thisboard = comedi_board(dev);
404 struct comedi_subdevice *s;
405 int ret;
406
407 ret = comedi_alloc_subdevices(dev, 3);
408 if (ret)
409 return ret;
410
411 s = &dev->subdevices[0];
412 /* dev->read_subdev=s; */
413 /* analog input subdevice */
414 s->type = COMEDI_SUBD_AI;
415 /* we support single-ended (ground) and differential */
416 s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
417 s->n_chan = thisboard->ai_chans;
418 s->maxdata = (1 << thisboard->ai_bits) - 1;
419 s->range_table = &range_bipolar10;
420 s->len_chanlist = 16; /* This is the maximum chanlist length that
421 the board can handle */
422 s->insn_read = skel_ai_rinsn;
423 /*
424 * s->subdev_flags |= SDF_CMD_READ;
425 * s->do_cmd = skel_ai_cmd;
426 */
427 s->do_cmdtest = skel_ai_cmdtest;
428
429 s = &dev->subdevices[1];
430 /* analog output subdevice */
431 s->type = COMEDI_SUBD_AO;
432 s->subdev_flags = SDF_WRITABLE;
433 s->n_chan = 1;
434 s->maxdata = 0xffff;
435 s->range_table = &range_bipolar5;
436 s->insn_write = skel_ao_winsn;
437 s->insn_read = skel_ao_rinsn;
438
439 s = &dev->subdevices[2];
440 /* digital i/o subdevice */
441 if (thisboard->have_dio) {
442 s->type = COMEDI_SUBD_DIO;
443 s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
444 s->n_chan = 16;
445 s->maxdata = 1;
446 s->range_table = &range_digital;
447 s->insn_bits = skel_dio_insn_bits;
448 s->insn_config = skel_dio_insn_config;
449 } else {
450 s->type = COMEDI_SUBD_UNUSED;
451 }
452
453 dev_info(dev->class_dev, "skel: attached\n");
454
455 return 0;
456 }
457
458 /*
459 * _attach is called by the Comedi core to configure the driver
460 * for a particular board in response to the COMEDI_DEVCONFIG ioctl for
461 * a matching board or driver name. If you specified a board_name array
462 * in the driver structure, dev->board_ptr contains that address.
463 *
464 * Drivers that handle only PCI or USB devices do not usually support
465 * manual attachment of those devices via the COMEDI_DEVCONFIG ioctl, so
466 * those drivers do not have an _attach function; they just have an
467 * _auto_attach function instead. (See skel_auto_attach() for an example
468 * of such a function.)
469 */
470 static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
471 {
472 const struct skel_board *thisboard;
473 struct skel_private *devpriv;
474
475 /*
476 * If you can probe the device to determine what device in a series
477 * it is, this is the place to do it. Otherwise, dev->board_ptr
478 * should already be initialized.
479 */
480 /* dev->board_ptr = skel_probe(dev, it); */
481
482 thisboard = comedi_board(dev);
483
484 /*
485 * The dev->board_name is initialized by the comedi core before
486 * calling the (*attach) function. It can be optionally set by
487 * the driver if additional probing has been done.
488 */
489 /* dev->board_name = thisboard->name; */
490
491 /* Allocate the private data */
492 devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
493 if (!devpriv)
494 return -ENOMEM;
495 dev->private = devpriv;
496
497 /*
498 * Supported boards are usually either auto-attached via the
499 * Comedi driver's _auto_attach routine, or manually attached via the
500 * Comedi driver's _attach routine. In most cases, attempts to
501 * manual attach boards that are usually auto-attached should be
502 * rejected by this function.
503 */
504 /*
505 * if (thisboard->bustype == pci_bustype) {
506 * dev_err(dev->class_dev,
507 * "Manual attachment of PCI board '%s' not supported\n",
508 * thisboard->name);
509 * }
510 */
511
512 /*
513 * For ISA boards, get the i/o base address from it->options[],
514 * request the i/o region and set dev->iobase * from it->options[].
515 * If using interrupts, get the IRQ number from it->options[].
516 */
517
518 /*
519 * Call a common function to handle the remaining things to do for
520 * attaching ISA or PCI boards. (Extra parameters could be added
521 * to pass additional information such as IRQ number.)
522 */
523 return skel_common_attach(dev);
524 }
525
526 /*
527 * _auto_attach is called via comedi_pci_auto_config() (or
528 * comedi_usb_auto_config(), etc.) to handle devices that can be attached
529 * to the Comedi core automatically without the COMEDI_DEVCONFIG ioctl.
530 *
531 * The context parameter is driver dependent.
532 */
533 static int skel_auto_attach(struct comedi_device *dev,
534 unsigned long context)
535 {
536 struct pci_dev *pcidev = comedi_to_pci_dev(dev);
537 const struct skel_board *thisboard = NULL;
538 struct skel_private *devpriv;
539 int ret;
540
541 /* Hack to allow unused code to be optimized out. */
542 if (!IS_ENABLED(CONFIG_COMEDI_PCI_DRIVERS))
543 return -EINVAL;
544
545 /*
546 * In this example, the _auto_attach is for a PCI device.
547 *
548 * The 'context' passed to this function is the id->driver_data
549 * associated with the PCI device found in the id_table during
550 * the modprobe. This 'context' is the index of the entry in
551 * skel_boards[i] that contains the boardinfo for the PCI device.
552 */
553 if (context < ARRAY_SIZE(skel_boards))
554 thisboard = &skel_boards[context];
555 if (!thisboard)
556 return -ENODEV;
557
558 /*
559 * Point the struct comedi_device to the matching board info
560 * and set the board name.
561 */
562 dev->board_ptr = thisboard;
563 dev->board_name = thisboard->name;
564
565 /* Allocate the private data */
566 devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
567 if (!devpriv)
568 return -ENOMEM;
569 dev->private = devpriv;
570
571 /* Enable the PCI device. */
572 ret = comedi_pci_enable(dev);
573 if (ret)
574 return ret;
575
576 /*
577 * Record the fact that the PCI device is enabled so that it can
578 * be disabled during _detach().
579 *
580 * For this example driver, we assume PCI BAR 0 is the main I/O
581 * region for the board registers and use dev->iobase to hold the
582 * I/O base address and to indicate that the PCI device has been
583 * enabled.
584 *
585 * (For boards with memory-mapped registers, dev->iobase is not
586 * usually needed for register access, so can just be set to 1
587 * to indicate that the PCI device has been enabled.)
588 */
589 dev->iobase = pci_resource_start(pcidev, 0);
590
591 /*
592 * Call a common function to handle the remaining things to do for
593 * attaching ISA or PCI boards. (Extra parameters could be added
594 * to pass additional information such as IRQ number.)
595 */
596 return skel_common_attach(dev);
597 }
598
599 /*
600 * _detach is called to deconfigure a device. It should deallocate
601 * resources.
602 * This function is also called when _attach() fails, so it should be
603 * careful not to release resources that were not necessarily
604 * allocated by _attach(). dev->private and dev->subdevices are
605 * deallocated automatically by the core.
606 */
607 static void skel_detach(struct comedi_device *dev)
608 {
609 const struct skel_board *thisboard = comedi_board(dev);
610 struct skel_private *devpriv = dev->private;
611
612 if (!thisboard || !devpriv)
613 return;
614
615 /*
616 * Do common stuff such as freeing IRQ, unmapping remapped memory
617 * regions, etc., being careful to check that the stuff is valid given
618 * that _detach() is called even when _attach() or _auto_attach() return
619 * an error.
620 */
621
622 if (IS_ENABLED(CONFIG_COMEDI_PCI_DRIVERS) /* &&
623 thisboard->bustype == pci_bustype */) {
624 /*
625 * PCI board
626 *
627 * If PCI device enabled by _auto_attach() (or _attach()),
628 * disable it here.
629 */
630 comedi_pci_disable(dev);
631 } else {
632 /*
633 * ISA board
634 *
635 * Release the first I/O region requested during the
636 * _attach(). This is safe to call even if the request
637 * failed. If any additional I/O regions are requested
638 * they need to be released by the driver.
639 */
640 comedi_legacy_detach(dev);
641 }
642 }
643
644 /*
645 * The struct comedi_driver structure tells the Comedi core module
646 * which functions to call to configure/deconfigure (attach/detach)
647 * the board, and also about the kernel module that contains
648 * the device code.
649 */
650 static struct comedi_driver skel_driver = {
651 .driver_name = "dummy",
652 .module = THIS_MODULE,
653 .attach = skel_attach,
654 .auto_attach = skel_auto_attach,
655 .detach = skel_detach,
656 /* It is not necessary to implement the following members if you are
657 * writing a driver for a ISA PnP or PCI card */
658 /* Most drivers will support multiple types of boards by
659 * having an array of board structures. These were defined
660 * in skel_boards[] above. Note that the element 'name'
661 * was first in the structure -- Comedi uses this fact to
662 * extract the name of the board without knowing any details
663 * about the structure except for its length.
664 * When a device is attached (by comedi_config), the name
665 * of the device is given to Comedi, and Comedi tries to
666 * match it by going through the list of board names. If
667 * there is a match, the address of the pointer is put
668 * into dev->board_ptr and driver->attach() is called.
669 *
670 * Note that these are not necessary if you can determine
671 * the type of board in software. ISA PnP, PCI, and PCMCIA
672 * devices are such boards.
673 */
674 .board_name = &skel_boards[0].name,
675 .offset = sizeof(struct skel_board),
676 .num_names = ARRAY_SIZE(skel_boards),
677 };
678
679 #ifdef CONFIG_COMEDI_PCI_DRIVERS
680
681 static int skel_pci_probe(struct pci_dev *dev,
682 const struct pci_device_id *id)
683 {
684 return comedi_pci_auto_config(dev, &skel_driver, id->driver_data);
685 }
686
687 /*
688 * Please add your PCI vendor ID to comedidev.h, and it will
689 * be forwarded upstream.
690 */
691 #define PCI_VENDOR_ID_SKEL 0xdafe
692
693 /*
694 * This is used by modprobe to translate PCI IDs to drivers.
695 * Should only be used for PCI and ISA-PnP devices
696 */
697 static DEFINE_PCI_DEVICE_TABLE(skel_pci_table) = {
698 { PCI_VDEVICE(SKEL, 0x0100), BOARD_SKEL100 },
699 { PCI_VDEVICE(SKEL, 0x0200), BOARD_SKEL200 },
700 { 0 }
701 };
702 MODULE_DEVICE_TABLE(pci, skel_pci_table);
703
704 static struct pci_driver skel_pci_driver = {
705 .name = "dummy",
706 .id_table = skel_pci_table,
707 .probe = skel_pci_probe,
708 .remove = comedi_pci_auto_unconfig,
709 };
710 module_comedi_pci_driver(skel_driver, skel_pci_driver);
711 #else
712 module_comedi_driver(skel_driver);
713 #endif
714
715 MODULE_AUTHOR("Comedi http://www.comedi.org");
716 MODULE_DESCRIPTION("Comedi low-level driver");
717 MODULE_LICENSE("GPL");