2 comedi/drivers/jr3_pci.c
3 hardware driver for JR3/PCI force sensor board
5 COMEDI - Linux Control and Measurement Device Interface
6 Copyright (C) 2007 Anders Blomdell <anders.blomdell@control.lth.se>
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.
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.
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.
25 Description: JR3/PCI force sensor board
26 Author: Anders Blomdell <anders.blomdell@control.lth.se>
28 Devices: [JR3] PCI force sensor board (jr3_pci)
30 The DSP on the board requires initialization code, which can
31 be loaded by placing it in /lib/firmware/comedi.
32 The initialization code should be somewhere on the media you got
33 with your card. One version is available from http://www.comedi.org
34 in the comedi_nonfree_firmware tarball.
36 Configuration options:
37 [0] - PCI bus number - if bus number and slot number are 0,
38 then driver search for first unused card
43 #include "../comedidev.h"
45 #include <linux/delay.h>
46 #include <linux/ctype.h>
47 #include <linux/firmware.h>
48 #include <linux/jiffies.h>
49 #include <linux/slab.h>
50 #include <linux/timer.h>
51 #include <linux/kernel.h>
54 #define PCI_VENDOR_ID_JR3 0x1762
55 #define PCI_DEVICE_ID_JR3_1_CHANNEL 0x3111
56 #define PCI_DEVICE_ID_JR3_1_CHANNEL_NEW 0x1111
57 #define PCI_DEVICE_ID_JR3_2_CHANNEL 0x3112
58 #define PCI_DEVICE_ID_JR3_3_CHANNEL 0x3113
59 #define PCI_DEVICE_ID_JR3_4_CHANNEL 0x3114
61 struct jr3_pci_dev_private {
63 struct pci_dev *pci_dev;
65 volatile struct jr3_t *iobase;
67 struct timer_list timer;
76 struct jr3_pci_subdev_private {
77 volatile struct jr3_channel *channel;
78 unsigned long next_time_min;
79 unsigned long next_time_max;
80 enum { state_jr3_poll,
81 state_jr3_init_wait_for_offset,
82 state_jr3_init_transform_complete,
83 state_jr3_init_set_full_scale_complete,
84 state_jr3_init_use_offset_complete,
92 struct comedi_krange range;
94 const struct comedi_lrange *range_table_list[8 * 7 + 2];
95 unsigned int maxdata_list[8 * 7 + 2];
100 /* Hotplug firmware loading stuff */
101 static int comedi_load_firmware(struct comedi_device *dev, char *name,
102 int (*cb)(struct comedi_device *dev,
103 const u8 *data, size_t size))
106 const struct firmware *fw;
108 static const char *prefix = "comedi/";
109 struct jr3_pci_dev_private *devpriv = dev->private;
111 firmware_path = kmalloc(strlen(prefix) + strlen(name) + 1, GFP_KERNEL);
112 if (!firmware_path) {
115 firmware_path[0] = '\0';
116 strcat(firmware_path, prefix);
117 strcat(firmware_path, name);
118 result = request_firmware(&fw, firmware_path,
119 &devpriv->pci_dev->dev);
124 result = cb(dev, fw->data, fw->size);
125 release_firmware(fw);
127 kfree(firmware_path);
132 static struct poll_delay_t poll_delay_min_max(int min, int max)
134 struct poll_delay_t result;
141 static int is_complete(volatile struct jr3_channel *channel)
143 return get_s16(&channel->command_word0) == 0;
153 static void set_transforms(volatile struct jr3_channel *channel,
154 struct transform_t transf, short num)
158 num &= 0x000f; /* Make sure that 0 <= num <= 15 */
159 for (i = 0; i < 8; i++) {
161 set_u16(&channel->transforms[num].link[i].link_type,
162 transf.link[i].link_type);
164 set_s16(&channel->transforms[num].link[i].link_amount,
165 transf.link[i].link_amount);
167 if (transf.link[i].link_type == end_x_form)
172 static void use_transform(volatile struct jr3_channel *channel,
175 set_s16(&channel->command_word0, 0x0500 + (transf_num & 0x000f));
178 static void use_offset(volatile struct jr3_channel *channel, short offset_num)
180 set_s16(&channel->command_word0, 0x0600 + (offset_num & 0x000f));
183 static void set_offset(volatile struct jr3_channel *channel)
185 set_s16(&channel->command_word0, 0x0700);
197 static void set_full_scales(volatile struct jr3_channel *channel,
198 struct six_axis_t full_scale)
200 printk("%d %d %d %d %d %d\n",
203 full_scale.fz, full_scale.mx, full_scale.my, full_scale.mz);
204 set_s16(&channel->full_scale.fx, full_scale.fx);
205 set_s16(&channel->full_scale.fy, full_scale.fy);
206 set_s16(&channel->full_scale.fz, full_scale.fz);
207 set_s16(&channel->full_scale.mx, full_scale.mx);
208 set_s16(&channel->full_scale.my, full_scale.my);
209 set_s16(&channel->full_scale.mz, full_scale.mz);
210 set_s16(&channel->command_word0, 0x0a00);
213 static struct six_axis_t get_min_full_scales(volatile struct jr3_channel
216 struct six_axis_t result;
217 result.fx = get_s16(&channel->min_full_scale.fx);
218 result.fy = get_s16(&channel->min_full_scale.fy);
219 result.fz = get_s16(&channel->min_full_scale.fz);
220 result.mx = get_s16(&channel->min_full_scale.mx);
221 result.my = get_s16(&channel->min_full_scale.my);
222 result.mz = get_s16(&channel->min_full_scale.mz);
226 static struct six_axis_t get_max_full_scales(volatile struct jr3_channel
229 struct six_axis_t result;
230 result.fx = get_s16(&channel->max_full_scale.fx);
231 result.fy = get_s16(&channel->max_full_scale.fy);
232 result.fz = get_s16(&channel->max_full_scale.fz);
233 result.mx = get_s16(&channel->max_full_scale.mx);
234 result.my = get_s16(&channel->max_full_scale.my);
235 result.mz = get_s16(&channel->max_full_scale.mz);
239 static int jr3_pci_ai_insn_read(struct comedi_device *dev,
240 struct comedi_subdevice *s,
241 struct comedi_insn *insn, unsigned int *data)
244 struct jr3_pci_subdev_private *p;
248 channel = CR_CHAN(insn->chanspec);
249 if (p == NULL || channel > 57) {
255 if (p->state != state_jr3_done ||
256 (get_u16(&p->channel->errors) & (watch_dog | watch_dog2 |
258 /* No sensor or sensor changed */
259 if (p->state == state_jr3_done) {
260 /* Restart polling */
261 p->state = state_jr3_poll;
265 for (i = 0; i < insn->n; i++) {
270 filter = channel / 8;
271 if (p->state != state_jr3_done) {
325 data[i] = F + 0x4000;
327 } else if (channel == 56) {
328 if (p->state != state_jr3_done) {
332 get_u16(&p->channel->model_no);
334 } else if (channel == 57) {
335 if (p->state != state_jr3_done) {
339 get_u16(&p->channel->serial_no);
347 static int jr3_pci_open(struct comedi_device *dev)
350 struct jr3_pci_dev_private *devpriv = dev->private;
352 dev_dbg(dev->class_dev, "jr3_pci_open\n");
353 for (i = 0; i < devpriv->n_channels; i++) {
354 struct jr3_pci_subdev_private *p;
356 p = dev->subdevices[i].private;
358 dev_dbg(dev->class_dev, "serial: %p %d (%d)\n", p,
359 p->serial_no, p->channel_no);
365 int read_idm_word(const u8 * data, size_t size, int *pos, unsigned int *val)
368 if (pos != 0 && val != 0) {
369 /* Skip over non hex */
370 for (; *pos < size && !isxdigit(data[*pos]); (*pos)++) {
374 for (; *pos < size; (*pos)++) {
376 value = hex_to_bin(data[*pos]);
379 *val = (*val << 4) + value;
387 static int jr3_download_firmware(struct comedi_device *dev, const u8 * data,
391 * IDM file format is:
392 * { count, address, data <count> } *
395 int result, more, pos, OK;
402 unsigned int count, addr;
404 more = more && read_idm_word(data, size, &pos, &count);
405 if (more && count == 0xffff) {
409 more = more && read_idm_word(data, size, &pos, &addr);
410 while (more && count > 0) {
412 more = more && read_idm_word(data, size, &pos, &dummy);
421 struct jr3_pci_dev_private *p = dev->private;
423 for (i = 0; i < p->n_channels; i++) {
424 struct jr3_pci_subdev_private *sp;
426 sp = dev->subdevices[i].private;
430 unsigned int count, addr;
432 && read_idm_word(data, size, &pos, &count);
433 if (more && count == 0xffff)
436 && read_idm_word(data, size, &pos, &addr);
437 dev_dbg(dev->class_dev,
438 "Loading#%d %4.4x bytes at %4.4x\n",
440 while (more && count > 0) {
442 /* 16 bit data, never seen in real life!! */
446 && read_idm_word(data,
450 /* printk("jr3_data, not tested\n"); */
451 /* jr3[addr + 0x20000 * pnum] = data1; */
453 /* Download 24 bit program */
454 unsigned int data1, data2;
457 && read_idm_word(data,
461 && read_idm_word(data, size,
487 static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s)
489 struct poll_delay_t result = poll_delay_min_max(1000, 2000);
490 struct jr3_pci_subdev_private *p = s->private;
494 volatile struct jr3_channel *channel = p->channel;
495 int errors = get_u16(&channel->errors);
497 if (errors != p->errors) {
498 printk("Errors: %x -> %x\n", p->errors, errors);
501 if (errors & (watch_dog | watch_dog2 | sensor_change)) {
502 /* Sensor communication lost, force poll mode */
503 p->state = state_jr3_poll;
507 case state_jr3_poll:{
508 u16 model_no = get_u16(&channel->model_no);
509 u16 serial_no = get_u16(&channel->serial_no);
510 if ((errors & (watch_dog | watch_dog2)) ||
511 model_no == 0 || serial_no == 0) {
513 * Still no sensor, keep on polling. Since it takes up to 10 seconds
514 * for offsets to stabilize, polling each second should suffice.
516 result = poll_delay_min_max(1000, 2000);
520 state_jr3_init_wait_for_offset;
521 result = poll_delay_min_max(1000, 2000);
525 case state_jr3_init_wait_for_offset:{
527 if (p->retries < 10) {
528 /* Wait for offeset to stabilize (< 10 s according to manual) */
529 result = poll_delay_min_max(1000, 2000);
531 struct transform_t transf;
534 get_u16(&channel->model_no);
536 get_u16(&channel->serial_no);
539 ("Setting transform for channel %d\n",
541 printk("Sensor Model = %i\n",
543 printk("Sensor Serial = %i\n",
546 /* Transformation all zeros */
547 for (i = 0; i < ARRAY_SIZE(transf.link); i++) {
548 transf.link[i].link_type =
550 transf.link[i].link_amount = 0;
553 set_transforms(channel, transf, 0);
554 use_transform(channel, 0);
556 state_jr3_init_transform_complete;
557 result = poll_delay_min_max(20, 100); /* Allow 20 ms for completion */
560 case state_jr3_init_transform_complete:{
561 if (!is_complete(channel)) {
563 ("state_jr3_init_transform_complete complete = %d\n",
564 is_complete(channel));
565 result = poll_delay_min_max(20, 100);
568 struct six_axis_t min_full_scale;
569 struct six_axis_t max_full_scale;
572 get_min_full_scales(channel);
573 printk("Obtained Min. Full Scales:\n");
574 printk(KERN_DEBUG "%i ", (min_full_scale).fx);
575 printk(KERN_CONT "%i ", (min_full_scale).fy);
576 printk(KERN_CONT "%i ", (min_full_scale).fz);
577 printk(KERN_CONT "%i ", (min_full_scale).mx);
578 printk(KERN_CONT "%i ", (min_full_scale).my);
579 printk(KERN_CONT "%i ", (min_full_scale).mz);
580 printk(KERN_CONT "\n");
583 get_max_full_scales(channel);
584 printk("Obtained Max. Full Scales:\n");
585 printk(KERN_DEBUG "%i ", (max_full_scale).fx);
586 printk(KERN_CONT "%i ", (max_full_scale).fy);
587 printk(KERN_CONT "%i ", (max_full_scale).fz);
588 printk(KERN_CONT "%i ", (max_full_scale).mx);
589 printk(KERN_CONT "%i ", (max_full_scale).my);
590 printk(KERN_CONT "%i ", (max_full_scale).mz);
591 printk(KERN_CONT "\n");
593 set_full_scales(channel,
597 state_jr3_init_set_full_scale_complete;
598 result = poll_delay_min_max(20, 100); /* Allow 20 ms for completion */
602 case state_jr3_init_set_full_scale_complete:{
603 if (!is_complete(channel)) {
605 ("state_jr3_init_set_full_scale_complete complete = %d\n",
606 is_complete(channel));
607 result = poll_delay_min_max(20, 100);
609 volatile struct force_array *full_scale;
611 /* Use ranges in kN or we will overflow arount 2000N! */
612 full_scale = &channel->full_scale;
613 p->range[0].range.min =
614 -get_s16(&full_scale->fx) * 1000;
615 p->range[0].range.max =
616 get_s16(&full_scale->fx) * 1000;
617 p->range[1].range.min =
618 -get_s16(&full_scale->fy) * 1000;
619 p->range[1].range.max =
620 get_s16(&full_scale->fy) * 1000;
621 p->range[2].range.min =
622 -get_s16(&full_scale->fz) * 1000;
623 p->range[2].range.max =
624 get_s16(&full_scale->fz) * 1000;
625 p->range[3].range.min =
626 -get_s16(&full_scale->mx) * 100;
627 p->range[3].range.max =
628 get_s16(&full_scale->mx) * 100;
629 p->range[4].range.min =
630 -get_s16(&full_scale->my) * 100;
631 p->range[4].range.max =
632 get_s16(&full_scale->my) * 100;
633 p->range[5].range.min =
634 -get_s16(&full_scale->mz) * 100;
635 p->range[5].range.max =
636 get_s16(&full_scale->mz) * 100;
637 p->range[6].range.min = -get_s16(&full_scale->v1) * 100; /* ?? */
638 p->range[6].range.max = get_s16(&full_scale->v1) * 100; /* ?? */
639 p->range[7].range.min = -get_s16(&full_scale->v2) * 100; /* ?? */
640 p->range[7].range.max = get_s16(&full_scale->v2) * 100; /* ?? */
641 p->range[8].range.min = 0;
642 p->range[8].range.max = 65535;
646 for (i = 0; i < 9; i++) {
647 printk("%d %d - %d\n",
658 use_offset(channel, 0);
660 state_jr3_init_use_offset_complete;
661 result = poll_delay_min_max(40, 100); /* Allow 40 ms for completion */
665 case state_jr3_init_use_offset_complete:{
666 if (!is_complete(channel)) {
668 ("state_jr3_init_use_offset_complete complete = %d\n",
669 is_complete(channel));
670 result = poll_delay_min_max(20, 100);
673 ("Default offsets %d %d %d %d %d %d\n",
674 get_s16(&channel->offsets.fx),
675 get_s16(&channel->offsets.fy),
676 get_s16(&channel->offsets.fz),
677 get_s16(&channel->offsets.mx),
678 get_s16(&channel->offsets.my),
679 get_s16(&channel->offsets.mz));
681 set_s16(&channel->offsets.fx, 0);
682 set_s16(&channel->offsets.fy, 0);
683 set_s16(&channel->offsets.fz, 0);
684 set_s16(&channel->offsets.mx, 0);
685 set_s16(&channel->offsets.my, 0);
686 set_s16(&channel->offsets.mz, 0);
690 p->state = state_jr3_done;
694 case state_jr3_done:{
695 poll_delay_min_max(10000, 20000);
699 poll_delay_min_max(1000, 2000);
707 static void jr3_pci_poll_dev(unsigned long data)
710 struct comedi_device *dev = (struct comedi_device *)data;
711 struct jr3_pci_dev_private *devpriv = dev->private;
716 spin_lock_irqsave(&dev->spinlock, flags);
719 /* Poll all channels that are ready to be polled */
720 for (i = 0; i < devpriv->n_channels; i++) {
721 struct jr3_pci_subdev_private *subdevpriv =
722 dev->subdevices[i].private;
723 if (now > subdevpriv->next_time_min) {
724 struct poll_delay_t sub_delay;
726 sub_delay = jr3_pci_poll_subdevice(&dev->subdevices[i]);
727 subdevpriv->next_time_min =
728 jiffies + msecs_to_jiffies(sub_delay.min);
729 subdevpriv->next_time_max =
730 jiffies + msecs_to_jiffies(sub_delay.max);
731 if (sub_delay.max && sub_delay.max < delay) {
733 * Wake up as late as possible -> poll as many channels as possible
736 delay = sub_delay.max;
740 spin_unlock_irqrestore(&dev->spinlock, flags);
742 devpriv->timer.expires = jiffies + msecs_to_jiffies(delay);
743 add_timer(&devpriv->timer);
746 static int jr3_pci_attach(struct comedi_device *dev,
747 struct comedi_devconfig *it)
750 struct pci_dev *card = NULL;
751 int opt_bus, opt_slot, i;
752 struct jr3_pci_dev_private *devpriv;
754 opt_bus = it->options[0];
755 opt_slot = it->options[1];
757 if (sizeof(struct jr3_channel) != 0xc00) {
758 dev_err(dev->class_dev,
759 "sizeof(struct jr3_channel) = %x [expected %x]\n",
760 (unsigned)sizeof(struct jr3_channel), 0xc00);
764 result = alloc_private(dev, sizeof(struct jr3_pci_dev_private));
768 devpriv = dev->private;
769 init_timer(&devpriv->timer);
771 card = pci_get_device(PCI_VENDOR_ID_JR3, PCI_ANY_ID, card);
776 switch (card->device) {
777 case PCI_DEVICE_ID_JR3_1_CHANNEL:{
778 devpriv->n_channels = 1;
781 case PCI_DEVICE_ID_JR3_1_CHANNEL_NEW:{
782 devpriv->n_channels = 1;
785 case PCI_DEVICE_ID_JR3_2_CHANNEL:{
786 devpriv->n_channels = 2;
789 case PCI_DEVICE_ID_JR3_3_CHANNEL:{
790 devpriv->n_channels = 3;
793 case PCI_DEVICE_ID_JR3_4_CHANNEL:{
794 devpriv->n_channels = 4;
798 devpriv->n_channels = 0;
801 if (devpriv->n_channels >= 1) {
802 if (opt_bus == 0 && opt_slot == 0) {
803 /* Take first available card */
805 } else if (opt_bus == card->bus->number &&
806 opt_slot == PCI_SLOT(card->devfn)) {
807 /* Take requested card */
814 dev_err(dev->class_dev, "no jr3_pci found\n");
817 devpriv->pci_dev = card;
818 dev->board_name = "jr3_pci";
821 result = comedi_pci_enable(card, "jr3_pci");
825 devpriv->pci_enabled = 1;
826 devpriv->iobase = ioremap(pci_resource_start(card, 0),
827 offsetof(struct jr3_t, channel[devpriv->n_channels]));
828 if (!devpriv->iobase)
831 result = comedi_alloc_subdevices(dev, devpriv->n_channels);
835 dev->open = jr3_pci_open;
836 for (i = 0; i < devpriv->n_channels; i++) {
837 dev->subdevices[i].type = COMEDI_SUBD_AI;
838 dev->subdevices[i].subdev_flags = SDF_READABLE | SDF_GROUND;
839 dev->subdevices[i].n_chan = 8 * 7 + 2;
840 dev->subdevices[i].insn_read = jr3_pci_ai_insn_read;
841 dev->subdevices[i].private =
842 kzalloc(sizeof(struct jr3_pci_subdev_private), GFP_KERNEL);
843 if (dev->subdevices[i].private) {
844 struct jr3_pci_subdev_private *p;
847 p = dev->subdevices[i].private;
848 p->channel = &devpriv->iobase->channel[i].data;
849 dev_dbg(dev->class_dev, "p->channel %p %p (%tx)\n",
850 p->channel, devpriv->iobase,
851 ((char *)(p->channel) -
852 (char *)(devpriv->iobase)));
854 for (j = 0; j < 8; j++) {
857 p->range[j].length = 1;
858 p->range[j].range.min = -1000000;
859 p->range[j].range.max = 1000000;
860 for (k = 0; k < 7; k++) {
861 p->range_table_list[j + k * 8] =
862 (struct comedi_lrange *)&p->
864 p->maxdata_list[j + k * 8] = 0x7fff;
867 p->range[8].length = 1;
868 p->range[8].range.min = 0;
869 p->range[8].range.max = 65536;
871 p->range_table_list[56] =
872 (struct comedi_lrange *)&p->range[8];
873 p->range_table_list[57] =
874 (struct comedi_lrange *)&p->range[8];
875 p->maxdata_list[56] = 0xffff;
876 p->maxdata_list[57] = 0xffff;
877 /* Channel specific range and maxdata */
878 dev->subdevices[i].range_table = 0;
879 dev->subdevices[i].range_table_list =
881 dev->subdevices[i].maxdata = 0;
882 dev->subdevices[i].maxdata_list = p->maxdata_list;
887 devpriv->iobase->channel[0].reset = 0;
889 result = comedi_load_firmware(dev, "jr3pci.idm", jr3_download_firmware);
890 dev_dbg(dev->class_dev, "Firmare load %d\n", result);
895 * TODO: use firmware to load preferred offset tables. Suggested
897 * model serial Fx Fy Fz Mx My Mz\n
899 * comedi_load_firmware(dev, "jr3_offsets_table", jr3_download_firmware);
903 * It takes a few milliseconds for software to settle as much as we
904 * can read firmware version
906 msleep_interruptible(25);
907 for (i = 0; i < 0x18; i++) {
908 dev_dbg(dev->class_dev, "%c\n",
909 get_u16(&devpriv->iobase->channel[0].
910 data.copyright[i]) >> 8);
913 /* Start card timer */
914 for (i = 0; i < devpriv->n_channels; i++) {
915 struct jr3_pci_subdev_private *p = dev->subdevices[i].private;
917 p->next_time_min = jiffies + msecs_to_jiffies(500);
918 p->next_time_max = jiffies + msecs_to_jiffies(2000);
921 devpriv->timer.data = (unsigned long)dev;
922 devpriv->timer.function = jr3_pci_poll_dev;
923 devpriv->timer.expires = jiffies + msecs_to_jiffies(1000);
924 add_timer(&devpriv->timer);
930 static void jr3_pci_detach(struct comedi_device *dev)
933 struct jr3_pci_dev_private *devpriv = dev->private;
936 del_timer_sync(&devpriv->timer);
938 if (dev->subdevices) {
939 for (i = 0; i < devpriv->n_channels; i++)
940 kfree(dev->subdevices[i].private);
943 iounmap((void *)devpriv->iobase);
944 if (devpriv->pci_enabled)
945 comedi_pci_disable(devpriv->pci_dev);
946 if (devpriv->pci_dev)
947 pci_dev_put(devpriv->pci_dev);
951 static struct comedi_driver jr3_pci_driver = {
952 .driver_name = "jr3_pci",
953 .module = THIS_MODULE,
954 .attach = jr3_pci_attach,
955 .detach = jr3_pci_detach,
958 static int __devinit jr3_pci_pci_probe(struct pci_dev *dev,
959 const struct pci_device_id *ent)
961 return comedi_pci_auto_config(dev, &jr3_pci_driver);
964 static void __devexit jr3_pci_pci_remove(struct pci_dev *dev)
966 comedi_pci_auto_unconfig(dev);
969 static DEFINE_PCI_DEVICE_TABLE(jr3_pci_pci_table) = {
970 { PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_1_CHANNEL) },
971 { PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_1_CHANNEL_NEW) },
972 { PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_2_CHANNEL) },
973 { PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_3_CHANNEL) },
974 { PCI_DEVICE(PCI_VENDOR_ID_JR3, PCI_DEVICE_ID_JR3_4_CHANNEL) },
977 MODULE_DEVICE_TABLE(pci, jr3_pci_pci_table);
979 static struct pci_driver jr3_pci_pci_driver = {
981 .id_table = jr3_pci_pci_table,
982 .probe = jr3_pci_pci_probe,
983 .remove = __devexit_p(jr3_pci_pci_remove),
985 module_comedi_pci_driver(jr3_pci_driver, jr3_pci_pci_driver);
987 MODULE_AUTHOR("Comedi http://www.comedi.org");
988 MODULE_DESCRIPTION("Comedi low-level driver");
989 MODULE_LICENSE("GPL");
990 MODULE_FIRMWARE("comedi/jr3pci.idm");