2 comedi/drivers/ni_6514.c
3 driver for National Instruments PCI-6514
5 Copyright (C) 2006 Jon Grierson <jd@renko.co.uk>
6 Copyright (C) 2006 Frank Mori Hess <fmhess@users.sourceforge.net>
8 COMEDI - Linux Control and Measurement Device Interface
9 Copyright (C) 1999,2002,2003 David A. Schleef <ds@schleef.org>
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 Description: National Instruments 65xx static dio boards
29 Author: Jon Grierson <jd@renko.co.uk>,
30 Frank Mori Hess <fmhess@users.sourceforge.net>
32 Devices: [National Instruments] PCI-6509 (ni_65xx), PXI-6509, PCI-6510,
33 PCI-6511, PXI-6511, PCI-6512, PXI-6512, PCI-6513, PXI-6513, PCI-6514,
34 PXI-6514, PCI-6515, PXI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519,
35 PCI-6520, PCI-6521, PXI-6521, PCI-6528, PXI-6528
36 Updated: Wed Oct 18 08:59:11 EDT 2006
38 Based on the PCI-6527 driver by ds.
39 The interrupt subdevice (subdevice 3) is probably broken for all boards
40 except maybe the 6514.
45 Manuals (available from ftp://ftp.natinst.com/support/manuals)
47 370106b.pdf 6514 Register Level Programmer Manual
54 #include <linux/interrupt.h>
55 #include <linux/slab.h>
56 #include "../comedidev.h"
60 #define NI6514_DIO_SIZE 4096
61 #define NI6514_MITE_SIZE 4096
63 #define NI_65XX_MAX_NUM_PORTS 12
64 static const unsigned ni_65xx_channels_per_port
= 8;
65 static const unsigned ni_65xx_port_offset
= 0x10;
67 static inline unsigned Port_Data(unsigned port
)
69 return 0x40 + port
* ni_65xx_port_offset
;
72 static inline unsigned Port_Select(unsigned port
)
74 return 0x41 + port
* ni_65xx_port_offset
;
77 static inline unsigned Rising_Edge_Detection_Enable(unsigned port
)
79 return 0x42 + port
* ni_65xx_port_offset
;
82 static inline unsigned Falling_Edge_Detection_Enable(unsigned port
)
84 return 0x43 + port
* ni_65xx_port_offset
;
87 static inline unsigned Filter_Enable(unsigned port
)
89 return 0x44 + port
* ni_65xx_port_offset
;
92 #define ID_Register 0x00
94 #define Clear_Register 0x01
96 #define ClrOverflow 0x04
98 #define Filter_Interval 0x08
100 #define Change_Status 0x02
101 #define MasterInterruptStatus 0x04
102 #define Overflow 0x02
103 #define EdgeStatus 0x01
105 #define Master_Interrupt_Control 0x03
106 #define FallingEdgeIntEnable 0x10
107 #define RisingEdgeIntEnable 0x08
108 #define MasterInterruptEnable 0x04
109 #define OverflowIntEnable 0x02
110 #define EdgeIntEnable 0x01
112 static int ni_65xx_attach(struct comedi_device
*dev
,
113 struct comedi_devconfig
*it
);
114 static int ni_65xx_detach(struct comedi_device
*dev
);
115 static struct comedi_driver driver_ni_65xx
= {
116 .driver_name
= "ni_65xx",
117 .module
= THIS_MODULE
,
118 .attach
= ni_65xx_attach
,
119 .detach
= ni_65xx_detach
,
122 struct ni_65xx_board
{
126 unsigned num_dio_ports
;
127 unsigned num_di_ports
;
128 unsigned num_do_ports
;
129 unsigned invert_outputs
:1;
132 static const struct ni_65xx_board ni_65xx_boards
[] = {
137 .invert_outputs
= 0},
142 .invert_outputs
= 0},
167 .invert_outputs
= 1},
172 .invert_outputs
= 1},
178 .invert_outputs
= 1},
184 .invert_outputs
= 1},
190 .invert_outputs
= 1},
196 .invert_outputs
= 1},
201 .invert_outputs
= 1},
206 .invert_outputs
= 1},
212 .invert_outputs
= 1},
218 .invert_outputs
= 1},
251 #define n_ni_65xx_boards ARRAY_SIZE(ni_65xx_boards)
252 static inline const struct ni_65xx_board
*board(struct comedi_device
*dev
)
254 return dev
->board_ptr
;
257 static inline unsigned ni_65xx_port_by_channel(unsigned channel
)
259 return channel
/ ni_65xx_channels_per_port
;
262 static inline unsigned ni_65xx_total_num_ports(const struct ni_65xx_board
265 return board
->num_dio_ports
+ board
->num_di_ports
+ board
->num_do_ports
;
268 static DEFINE_PCI_DEVICE_TABLE(ni_65xx_pci_table
) = {
269 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x1710)},
270 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7085)},
271 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7086)},
272 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7087)},
273 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7088)},
274 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70a9)},
275 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70c3)},
276 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70c8)},
277 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70c9)},
278 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70cc)},
279 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70CD)},
280 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70d1)},
281 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70d2)},
282 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x70d3)},
283 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7124)},
284 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7125)},
285 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7126)},
286 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7127)},
287 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x7128)},
288 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x718b)},
289 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x718c)},
290 {PCI_DEVICE(PCI_VENDOR_ID_NI
, 0x71c5)},
294 MODULE_DEVICE_TABLE(pci
, ni_65xx_pci_table
);
296 struct ni_65xx_private
{
297 struct mite_struct
*mite
;
298 unsigned int filter_interval
;
299 unsigned short filter_enable
[NI_65XX_MAX_NUM_PORTS
];
300 unsigned short output_bits
[NI_65XX_MAX_NUM_PORTS
];
301 unsigned short dio_direction
[NI_65XX_MAX_NUM_PORTS
];
304 static inline struct ni_65xx_private
*private(struct comedi_device
*dev
)
309 struct ni_65xx_subdevice_private
{
313 static inline struct ni_65xx_subdevice_private
*sprivate(struct comedi_subdevice
316 return subdev
->private;
319 static struct ni_65xx_subdevice_private
*ni_65xx_alloc_subdevice_private(void)
321 struct ni_65xx_subdevice_private
*subdev_private
=
322 kzalloc(sizeof(struct ni_65xx_subdevice_private
), GFP_KERNEL
);
323 if (subdev_private
== NULL
)
325 return subdev_private
;
328 static int ni_65xx_find_device(struct comedi_device
*dev
, int bus
, int slot
);
330 static int ni_65xx_config_filter(struct comedi_device
*dev
,
331 struct comedi_subdevice
*s
,
332 struct comedi_insn
*insn
, unsigned int *data
)
334 const unsigned chan
= CR_CHAN(insn
->chanspec
);
335 const unsigned port
=
336 sprivate(s
)->base_port
+ ni_65xx_port_by_channel(chan
);
338 if (data
[0] != INSN_CONFIG_FILTER
)
341 static const unsigned filter_resolution_ns
= 200;
342 static const unsigned max_filter_interval
= 0xfffff;
345 (filter_resolution_ns
/ 2)) / filter_resolution_ns
;
346 if (interval
> max_filter_interval
)
347 interval
= max_filter_interval
;
348 data
[1] = interval
* filter_resolution_ns
;
350 if (interval
!= private(dev
)->filter_interval
) {
352 private(dev
)->mite
->daq_io_addr
+
354 private(dev
)->filter_interval
= interval
;
357 private(dev
)->filter_enable
[port
] |=
358 1 << (chan
% ni_65xx_channels_per_port
);
360 private(dev
)->filter_enable
[port
] &=
361 ~(1 << (chan
% ni_65xx_channels_per_port
));
364 writeb(private(dev
)->filter_enable
[port
],
365 private(dev
)->mite
->daq_io_addr
+ Filter_Enable(port
));
370 static int ni_65xx_dio_insn_config(struct comedi_device
*dev
,
371 struct comedi_subdevice
*s
,
372 struct comedi_insn
*insn
, unsigned int *data
)
378 port
= sprivate(s
)->base_port
+
379 ni_65xx_port_by_channel(CR_CHAN(insn
->chanspec
));
381 case INSN_CONFIG_FILTER
:
382 return ni_65xx_config_filter(dev
, s
, insn
, data
);
384 case INSN_CONFIG_DIO_OUTPUT
:
385 if (s
->type
!= COMEDI_SUBD_DIO
)
387 private(dev
)->dio_direction
[port
] = COMEDI_OUTPUT
;
388 writeb(0, private(dev
)->mite
->daq_io_addr
+ Port_Select(port
));
391 case INSN_CONFIG_DIO_INPUT
:
392 if (s
->type
!= COMEDI_SUBD_DIO
)
394 private(dev
)->dio_direction
[port
] = COMEDI_INPUT
;
395 writeb(1, private(dev
)->mite
->daq_io_addr
+ Port_Select(port
));
398 case INSN_CONFIG_DIO_QUERY
:
399 if (s
->type
!= COMEDI_SUBD_DIO
)
401 data
[1] = private(dev
)->dio_direction
[port
];
410 static int ni_65xx_dio_insn_bits(struct comedi_device
*dev
,
411 struct comedi_subdevice
*s
,
412 struct comedi_insn
*insn
, unsigned int *data
)
414 unsigned base_bitfield_channel
;
415 const unsigned max_ports_per_bitfield
= 5;
416 unsigned read_bits
= 0;
420 base_bitfield_channel
= CR_CHAN(insn
->chanspec
);
421 for (j
= 0; j
< max_ports_per_bitfield
; ++j
) {
422 const unsigned port_offset
=
423 ni_65xx_port_by_channel(base_bitfield_channel
) + j
;
424 const unsigned port
=
425 sprivate(s
)->base_port
+ port_offset
;
426 unsigned base_port_channel
;
427 unsigned port_mask
, port_data
, port_read_bits
;
429 if (port
>= ni_65xx_total_num_ports(board(dev
)))
431 base_port_channel
= port_offset
* ni_65xx_channels_per_port
;
434 bitshift
= base_port_channel
- base_bitfield_channel
;
435 if (bitshift
>= 32 || bitshift
<= -32)
438 port_mask
>>= bitshift
;
439 port_data
>>= bitshift
;
441 port_mask
<<= -bitshift
;
442 port_data
<<= -bitshift
;
448 private(dev
)->output_bits
[port
] &= ~port_mask
;
449 private(dev
)->output_bits
[port
] |=
450 port_data
& port_mask
;
451 bits
= private(dev
)->output_bits
[port
];
452 if (board(dev
)->invert_outputs
)
455 private(dev
)->mite
->daq_io_addr
+
457 /* printk("wrote 0x%x to port %i\n", bits, port); */
460 readb(private(dev
)->mite
->daq_io_addr
+ Port_Data(port
));
461 /* printk("read 0x%x from port %i\n", port_read_bits, port); */
462 if (s
->type
== COMEDI_SUBD_DO
&& board(dev
)->invert_outputs
) {
463 /* Outputs inverted, so invert value read back from
464 * DO subdevice. (Does not apply to boards with DIO
466 port_read_bits
^= 0xFF;
469 port_read_bits
<<= bitshift
;
471 port_read_bits
>>= -bitshift
;
473 read_bits
|= port_read_bits
;
479 static irqreturn_t
ni_65xx_interrupt(int irq
, void *d
)
481 struct comedi_device
*dev
= d
;
482 struct comedi_subdevice
*s
= dev
->subdevices
+ 2;
485 status
= readb(private(dev
)->mite
->daq_io_addr
+ Change_Status
);
486 if ((status
& MasterInterruptStatus
) == 0)
488 if ((status
& EdgeStatus
) == 0)
491 writeb(ClrEdge
| ClrOverflow
,
492 private(dev
)->mite
->daq_io_addr
+ Clear_Register
);
494 comedi_buf_put(s
->async
, 0);
495 s
->async
->events
|= COMEDI_CB_EOS
;
496 comedi_event(dev
, s
);
500 static int ni_65xx_intr_cmdtest(struct comedi_device
*dev
,
501 struct comedi_subdevice
*s
,
502 struct comedi_cmd
*cmd
)
507 /* step 1: make sure trigger sources are trivially valid */
509 tmp
= cmd
->start_src
;
510 cmd
->start_src
&= TRIG_NOW
;
511 if (!cmd
->start_src
|| tmp
!= cmd
->start_src
)
514 tmp
= cmd
->scan_begin_src
;
515 cmd
->scan_begin_src
&= TRIG_OTHER
;
516 if (!cmd
->scan_begin_src
|| tmp
!= cmd
->scan_begin_src
)
519 tmp
= cmd
->convert_src
;
520 cmd
->convert_src
&= TRIG_FOLLOW
;
521 if (!cmd
->convert_src
|| tmp
!= cmd
->convert_src
)
524 tmp
= cmd
->scan_end_src
;
525 cmd
->scan_end_src
&= TRIG_COUNT
;
526 if (!cmd
->scan_end_src
|| tmp
!= cmd
->scan_end_src
)
530 cmd
->stop_src
&= TRIG_COUNT
;
531 if (!cmd
->stop_src
|| tmp
!= cmd
->stop_src
)
537 /* step 2: make sure trigger sources are unique and mutually
543 /* step 3: make sure arguments are trivially compatible */
545 if (cmd
->start_arg
!= 0) {
549 if (cmd
->scan_begin_arg
!= 0) {
550 cmd
->scan_begin_arg
= 0;
553 if (cmd
->convert_arg
!= 0) {
554 cmd
->convert_arg
= 0;
558 if (cmd
->scan_end_arg
!= 1) {
559 cmd
->scan_end_arg
= 1;
562 if (cmd
->stop_arg
!= 0) {
570 /* step 4: fix up any arguments */
578 static int ni_65xx_intr_cmd(struct comedi_device
*dev
,
579 struct comedi_subdevice
*s
)
581 /* struct comedi_cmd *cmd = &s->async->cmd; */
583 writeb(ClrEdge
| ClrOverflow
,
584 private(dev
)->mite
->daq_io_addr
+ Clear_Register
);
585 writeb(FallingEdgeIntEnable
| RisingEdgeIntEnable
|
586 MasterInterruptEnable
| EdgeIntEnable
,
587 private(dev
)->mite
->daq_io_addr
+ Master_Interrupt_Control
);
592 static int ni_65xx_intr_cancel(struct comedi_device
*dev
,
593 struct comedi_subdevice
*s
)
596 private(dev
)->mite
->daq_io_addr
+ Master_Interrupt_Control
);
601 static int ni_65xx_intr_insn_bits(struct comedi_device
*dev
,
602 struct comedi_subdevice
*s
,
603 struct comedi_insn
*insn
, unsigned int *data
)
612 static int ni_65xx_intr_insn_config(struct comedi_device
*dev
,
613 struct comedi_subdevice
*s
,
614 struct comedi_insn
*insn
,
619 if (data
[0] != INSN_CONFIG_CHANGE_NOTIFY
)
623 private(dev
)->mite
->daq_io_addr
+
624 Rising_Edge_Detection_Enable(0));
626 private(dev
)->mite
->daq_io_addr
+
627 Rising_Edge_Detection_Enable(0x10));
628 writeb(data
[1] >> 16,
629 private(dev
)->mite
->daq_io_addr
+
630 Rising_Edge_Detection_Enable(0x20));
631 writeb(data
[1] >> 24,
632 private(dev
)->mite
->daq_io_addr
+
633 Rising_Edge_Detection_Enable(0x30));
636 private(dev
)->mite
->daq_io_addr
+
637 Falling_Edge_Detection_Enable(0));
639 private(dev
)->mite
->daq_io_addr
+
640 Falling_Edge_Detection_Enable(0x10));
641 writeb(data
[2] >> 16,
642 private(dev
)->mite
->daq_io_addr
+
643 Falling_Edge_Detection_Enable(0x20));
644 writeb(data
[2] >> 24,
645 private(dev
)->mite
->daq_io_addr
+
646 Falling_Edge_Detection_Enable(0x30));
651 static int ni_65xx_attach(struct comedi_device
*dev
,
652 struct comedi_devconfig
*it
)
654 struct comedi_subdevice
*s
;
658 printk(KERN_INFO
"comedi%d: ni_65xx:", dev
->minor
);
660 ret
= alloc_private(dev
, sizeof(struct ni_65xx_private
));
664 ret
= ni_65xx_find_device(dev
, it
->options
[0], it
->options
[1]);
668 ret
= mite_setup(private(dev
)->mite
);
670 printk(KERN_WARNING
"error setting up mite\n");
674 dev
->board_name
= board(dev
)->name
;
675 dev
->irq
= mite_irq(private(dev
)->mite
);
676 printk(KERN_INFO
" %s", dev
->board_name
);
678 printk(KERN_INFO
" ID=0x%02x",
679 readb(private(dev
)->mite
->daq_io_addr
+ ID_Register
));
681 ret
= alloc_subdevices(dev
, 4);
685 s
= dev
->subdevices
+ 0;
686 if (board(dev
)->num_di_ports
) {
687 s
->type
= COMEDI_SUBD_DI
;
688 s
->subdev_flags
= SDF_READABLE
;
690 board(dev
)->num_di_ports
* ni_65xx_channels_per_port
;
691 s
->range_table
= &range_digital
;
693 s
->insn_config
= ni_65xx_dio_insn_config
;
694 s
->insn_bits
= ni_65xx_dio_insn_bits
;
695 s
->private = ni_65xx_alloc_subdevice_private();
696 if (s
->private == NULL
)
698 sprivate(s
)->base_port
= 0;
700 s
->type
= COMEDI_SUBD_UNUSED
;
703 s
= dev
->subdevices
+ 1;
704 if (board(dev
)->num_do_ports
) {
705 s
->type
= COMEDI_SUBD_DO
;
706 s
->subdev_flags
= SDF_READABLE
| SDF_WRITABLE
;
708 board(dev
)->num_do_ports
* ni_65xx_channels_per_port
;
709 s
->range_table
= &range_digital
;
711 s
->insn_bits
= ni_65xx_dio_insn_bits
;
712 s
->private = ni_65xx_alloc_subdevice_private();
713 if (s
->private == NULL
)
715 sprivate(s
)->base_port
= board(dev
)->num_di_ports
;
717 s
->type
= COMEDI_SUBD_UNUSED
;
720 s
= dev
->subdevices
+ 2;
721 if (board(dev
)->num_dio_ports
) {
722 s
->type
= COMEDI_SUBD_DIO
;
723 s
->subdev_flags
= SDF_READABLE
| SDF_WRITABLE
;
725 board(dev
)->num_dio_ports
* ni_65xx_channels_per_port
;
726 s
->range_table
= &range_digital
;
728 s
->insn_config
= ni_65xx_dio_insn_config
;
729 s
->insn_bits
= ni_65xx_dio_insn_bits
;
730 s
->private = ni_65xx_alloc_subdevice_private();
731 if (s
->private == NULL
)
733 sprivate(s
)->base_port
= 0;
734 for (i
= 0; i
< board(dev
)->num_dio_ports
; ++i
) {
735 /* configure all ports for input */
737 private(dev
)->mite
->daq_io_addr
+
741 s
->type
= COMEDI_SUBD_UNUSED
;
744 s
= dev
->subdevices
+ 3;
745 dev
->read_subdev
= s
;
746 s
->type
= COMEDI_SUBD_DI
;
747 s
->subdev_flags
= SDF_READABLE
| SDF_CMD_READ
;
749 s
->range_table
= &range_unknown
;
751 s
->do_cmdtest
= ni_65xx_intr_cmdtest
;
752 s
->do_cmd
= ni_65xx_intr_cmd
;
753 s
->cancel
= ni_65xx_intr_cancel
;
754 s
->insn_bits
= ni_65xx_intr_insn_bits
;
755 s
->insn_config
= ni_65xx_intr_insn_config
;
757 for (i
= 0; i
< ni_65xx_total_num_ports(board(dev
)); ++i
) {
759 private(dev
)->mite
->daq_io_addr
+ Filter_Enable(i
));
760 if (board(dev
)->invert_outputs
)
762 private(dev
)->mite
->daq_io_addr
+ Port_Data(i
));
765 private(dev
)->mite
->daq_io_addr
+ Port_Data(i
));
767 writeb(ClrEdge
| ClrOverflow
,
768 private(dev
)->mite
->daq_io_addr
+ Clear_Register
);
770 private(dev
)->mite
->daq_io_addr
+ Master_Interrupt_Control
);
772 /* Set filter interval to 0 (32bit reg) */
773 writeb(0x00000000, private(dev
)->mite
->daq_io_addr
+ Filter_Interval
);
775 ret
= request_irq(dev
->irq
, ni_65xx_interrupt
, IRQF_SHARED
,
779 printk(KERN_WARNING
" irq not available");
787 static int ni_65xx_detach(struct comedi_device
*dev
)
789 if (private(dev
) && private(dev
)->mite
790 && private(dev
)->mite
->daq_io_addr
) {
792 private(dev
)->mite
->daq_io_addr
+
793 Master_Interrupt_Control
);
797 free_irq(dev
->irq
, dev
);
801 for (i
= 0; i
< dev
->n_subdevices
; ++i
) {
802 kfree(dev
->subdevices
[i
].private);
803 dev
->subdevices
[i
].private = NULL
;
805 if (private(dev
)->mite
)
806 mite_unsetup(private(dev
)->mite
);
811 static int ni_65xx_find_device(struct comedi_device
*dev
, int bus
, int slot
)
813 struct mite_struct
*mite
;
816 for (mite
= mite_devices
; mite
; mite
= mite
->next
) {
820 if (bus
!= mite
->pcidev
->bus
->number
||
821 slot
!= PCI_SLOT(mite
->pcidev
->devfn
))
824 for (i
= 0; i
< n_ni_65xx_boards
; i
++) {
825 if (mite_device_id(mite
) == ni_65xx_boards
[i
].dev_id
) {
826 dev
->board_ptr
= ni_65xx_boards
+ i
;
827 private(dev
)->mite
= mite
;
832 printk(KERN_WARNING
"no device found\n");
837 static int __devinit
driver_ni_65xx_pci_probe(struct pci_dev
*dev
,
838 const struct pci_device_id
*ent
)
840 return comedi_pci_auto_config(dev
, driver_ni_65xx
.driver_name
);
843 static void __devexit
driver_ni_65xx_pci_remove(struct pci_dev
*dev
)
845 comedi_pci_auto_unconfig(dev
);
848 static struct pci_driver driver_ni_65xx_pci_driver
= {
849 .id_table
= ni_65xx_pci_table
,
850 .probe
= &driver_ni_65xx_pci_probe
,
851 .remove
= __devexit_p(&driver_ni_65xx_pci_remove
)
854 static int __init
driver_ni_65xx_init_module(void)
858 retval
= comedi_driver_register(&driver_ni_65xx
);
862 driver_ni_65xx_pci_driver
.name
= (char *)driver_ni_65xx
.driver_name
;
863 return pci_register_driver(&driver_ni_65xx_pci_driver
);
866 static void __exit
driver_ni_65xx_cleanup_module(void)
868 pci_unregister_driver(&driver_ni_65xx_pci_driver
);
869 comedi_driver_unregister(&driver_ni_65xx
);
872 module_init(driver_ni_65xx_init_module
);
873 module_exit(driver_ni_65xx_cleanup_module
);