45 #include <linux/slab.h>
46 #include "../comedidev.h"
50 #define AO_VALUE_OFFSET 0x00
51 #define AO_CHAN_OFFSET 0x0c
52 #define AO_STATUS_OFFSET 0x10
53 #define AO_CONTROL_OFFSET 0x10
54 #define DIO_PORT0_DIR_OFFSET 0x20
55 #define DIO_PORT0_DATA_OFFSET 0x24
56 #define DIO_PORT1_DIR_OFFSET 0x28
57 #define DIO_PORT1_DATA_OFFSET 0x2c
58 #define MISC_STATUS_OFFSET 0x14
59 #define MISC_CONTROL_OFFSET 0x14
114 for (i = 0; i < insn->
n; i++) {
116 writel(((chan & 15) << 1) | ((chan & 16) >> 4),
134 for (i = 0; i < insn->
n; i++)
147 unsigned int mask = data[0];
148 unsigned int bits = data[1];
157 data[1] =
readl(io_addr);
162 static int ni_670x_dio_insn_config(
struct comedi_device *dev,
196 for (n = 0; n <
ARRAY_SIZE(ni_670x_boards); n++) {
198 if (board->
dev_id == dev_id)
213 ret = alloc_private(dev,
sizeof(*devpriv));
217 dev->
board_ptr = ni_670x_find_boardinfo(pcidev);
223 thisboard = comedi_board(dev);
247 if (!range_table_list)
250 for (i = 0; i < 16; i++) {
252 range_table_list[16 +
i] = &range_0_20mA;
291 if (devpriv && devpriv->
mite) {
293 mite_free(devpriv->
mite);
298 .driver_name =
"ni_670x",
300 .attach_pci = ni_670x_attach_pci,
301 .detach = ni_670x_detach,
322 static struct pci_driver ni_670x_pci_driver = {
324 .id_table = ni_670x_pci_table,
325 .probe = ni_670x_pci_probe,