diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-09-13 13:24:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-13 23:13:03 -0400 |
commit | b37c1aeed89062a82da9bf78c83db0328d08e95d (patch) | |
tree | 7a977bf0b329eebc069a7a4c5386b83a7de969d0 | |
parent | 77f17d3714675d1966d07f7e4939816f5cf52e04 (diff) |
staging: comedi: 8255_pci: move ni_pcidio 8255 board support
The 8255 based boards in the ni_pcidio driver are all simple
memory mapped 8255 boards that don't require the dma support
provided by the mite driver.
Move the support for these boards from the ni_pcidio driver to
the generic 8255_pci driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/Kconfig | 9 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/8255_pci.c | 71 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_pcidio.c | 228 |
3 files changed, 127 insertions, 181 deletions
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig index 3f67b98f755..2093403af25 100644 --- a/drivers/staging/comedi/Kconfig +++ b/drivers/staging/comedi/Kconfig | |||
@@ -560,6 +560,8 @@ config COMEDI_8255_PCI | |||
560 | ADlink - PCI-7224, PCI-7248, and PCI-7296 | 560 | ADlink - PCI-7224, PCI-7248, and PCI-7296 |
561 | Measurement Computing - PCI-DIO24, PCI-DIO24H, PCI-DIO48H and | 561 | Measurement Computing - PCI-DIO24, PCI-DIO24H, PCI-DIO48H and |
562 | PCI-DIO96H | 562 | PCI-DIO96H |
563 | National Instruments - PCI-DIO-96, PCI-DIO-96B, PXI-6508, PCI-6503, | ||
564 | PCI-6503B, PCI-6503X, and PXI-6503 | ||
563 | 565 | ||
564 | To compile this driver as a module, choose M here: the module will | 566 | To compile this driver as a module, choose M here: the module will |
565 | be called 8255_pci. | 567 | be called 8255_pci. |
@@ -1030,15 +1032,12 @@ config COMEDI_NI_LABPC | |||
1030 | called ni_labpc. | 1032 | called ni_labpc. |
1031 | 1033 | ||
1032 | config COMEDI_NI_PCIDIO | 1034 | config COMEDI_NI_PCIDIO |
1033 | tristate "NI PCI-DIO32HS, PCI-DIO96, PCI-6533, PCI-6503 support" | 1035 | tristate "NI PCI-DIO32HS, PCI-6533, PCI-6534 support" |
1034 | select COMEDI_MITE | 1036 | select COMEDI_MITE |
1035 | select COMEDI_8255 | 1037 | select COMEDI_8255 |
1036 | ---help--- | 1038 | ---help--- |
1037 | Enable support for National Instruments PCI-DIO-32HS, PXI-6533, | 1039 | Enable support for National Instruments PCI-DIO-32HS, PXI-6533, |
1038 | PCI-DIO-96, PCI-DIO-96B, PXI-6508, PCI-6503, PCI-6503B, PCI-6503X, | 1040 | PCI-6533 and PCI-6534 |
1039 | PXI-6503, PCI-6533 and PCI-6534 | ||
1040 | The DIO-96 appears as four 8255 subdevices. See the 8255 | ||
1041 | driver notes for details. | ||
1042 | 1041 | ||
1043 | To compile this driver as a module, choose M here: the module will be | 1042 | To compile this driver as a module, choose M here: the module will be |
1044 | called ni_pcidio. | 1043 | called ni_pcidio. |
diff --git a/drivers/staging/comedi/drivers/8255_pci.c b/drivers/staging/comedi/drivers/8255_pci.c index 93990fabd12..7dff3c01dc2 100644 --- a/drivers/staging/comedi/drivers/8255_pci.c +++ b/drivers/staging/comedi/drivers/8255_pci.c | |||
@@ -35,6 +35,13 @@ Devices: (ADLink) PCI-7224 [adl_pci-7224] - 24 channels | |||
35 | (Measurement Computing) PCI-DIO24H [cb_pci-dio24h] - 24 channels | 35 | (Measurement Computing) PCI-DIO24H [cb_pci-dio24h] - 24 channels |
36 | (Measurement Computing) PCI-DIO48H [cb_pci-dio48h] - 48 channels | 36 | (Measurement Computing) PCI-DIO48H [cb_pci-dio48h] - 48 channels |
37 | (Measurement Computing) PCI-DIO96H [cb_pci-dio96h] - 96 channels | 37 | (Measurement Computing) PCI-DIO96H [cb_pci-dio96h] - 96 channels |
38 | (National Instruments) PCI-DIO-96 [ni_pci-dio-96] - 96 channels | ||
39 | (National Instruments) PCI-DIO-96B [ni_pci-dio-96b] - 96 channels | ||
40 | (National Instruments) PXI-6508 [ni_pxi-6508] - 96 channels | ||
41 | (National Instruments) PCI-6503 [ni_pci-6503] - 24 channels | ||
42 | (National Instruments) PCI-6503B [ni_pci-6503b] - 24 channels | ||
43 | (National Instruments) PCI-6503X [ni_pci-6503x] - 24 channels | ||
44 | (National Instruments) PXI-6503 [ni_pxi-6503] - 24 channels | ||
38 | Author: H Hartley Sweeten <hsweeten@visionengravers.com> | 45 | Author: H Hartley Sweeten <hsweeten@visionengravers.com> |
39 | Updated: Wed, 12 Sep 2012 11:52:01 -0700 | 46 | Updated: Wed, 12 Sep 2012 11:52:01 -0700 |
40 | Status: untested | 47 | Status: untested |
@@ -66,6 +73,14 @@ Configuration Options: not applicable, uses PCI auto config | |||
66 | #define PCI_DEVICE_ID_CB_PCIDIO96H 0x0017 | 73 | #define PCI_DEVICE_ID_CB_PCIDIO96H 0x0017 |
67 | #define PCI_DEVICE_ID_CB_PCIDIO24 0x0028 | 74 | #define PCI_DEVICE_ID_CB_PCIDIO24 0x0028 |
68 | 75 | ||
76 | #define PCI_DEVICE_ID_NI_PCIDIO96 0x0160 | ||
77 | #define PCI_DEVICE_ID_NI_PCI6503 0x0400 | ||
78 | #define PCI_DEVICE_ID_NI_PCI6503B 0x1250 | ||
79 | #define PCI_DEVICE_ID_NI_PXI6508 0x13c0 | ||
80 | #define PCI_DEVICE_ID_NI_PCIDIO96B 0x1630 | ||
81 | #define PCI_DEVICE_ID_NI_PCI6503X 0x17d0 | ||
82 | #define PCI_DEVICE_ID_NI_PXI_6503 0x1800 | ||
83 | |||
69 | struct pci_8255_boardinfo { | 84 | struct pci_8255_boardinfo { |
70 | const char *name; | 85 | const char *name; |
71 | unsigned short vendor; | 86 | unsigned short vendor; |
@@ -118,6 +133,55 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = { | |||
118 | .device = PCI_DEVICE_ID_CB_PCIDIO96H, | 133 | .device = PCI_DEVICE_ID_CB_PCIDIO96H, |
119 | .dio_badr = 2, | 134 | .dio_badr = 2, |
120 | .n_8255 = 4, | 135 | .n_8255 = 4, |
136 | }, { | ||
137 | .name = "ni_pci-dio-96", | ||
138 | .vendor = PCI_VENDOR_ID_NI, | ||
139 | .device = PCI_DEVICE_ID_NI_PCIDIO96, | ||
140 | .dio_badr = 1, | ||
141 | .is_mmio = 1, | ||
142 | .n_8255 = 4, | ||
143 | }, { | ||
144 | .name = "ni_pci-dio-96b", | ||
145 | .vendor = PCI_VENDOR_ID_NI, | ||
146 | .device = PCI_DEVICE_ID_NI_PCIDIO96B, | ||
147 | .dio_badr = 1, | ||
148 | .is_mmio = 1, | ||
149 | .n_8255 = 4, | ||
150 | }, { | ||
151 | .name = "ni_pxi-6508", | ||
152 | .vendor = PCI_VENDOR_ID_NI, | ||
153 | .device = PCI_DEVICE_ID_NI_PXI6508, | ||
154 | .dio_badr = 1, | ||
155 | .is_mmio = 1, | ||
156 | .n_8255 = 4, | ||
157 | }, { | ||
158 | .name = "ni_pci-6503", | ||
159 | .vendor = PCI_VENDOR_ID_NI, | ||
160 | .device = PCI_DEVICE_ID_NI_PCI6503, | ||
161 | .dio_badr = 1, | ||
162 | .is_mmio = 1, | ||
163 | .n_8255 = 1, | ||
164 | }, { | ||
165 | .name = "ni_pci-6503b", | ||
166 | .vendor = PCI_VENDOR_ID_NI, | ||
167 | .device = PCI_DEVICE_ID_NI_PCI6503B, | ||
168 | .dio_badr = 1, | ||
169 | .is_mmio = 1, | ||
170 | .n_8255 = 1, | ||
171 | }, { | ||
172 | .name = "ni_pci-6503x", | ||
173 | .vendor = PCI_VENDOR_ID_NI, | ||
174 | .device = PCI_DEVICE_ID_NI_PCI6503X, | ||
175 | .dio_badr = 1, | ||
176 | .is_mmio = 1, | ||
177 | .n_8255 = 1, | ||
178 | }, { | ||
179 | .name = "ni_pxi-6503", | ||
180 | .vendor = PCI_VENDOR_ID_NI, | ||
181 | .device = PCI_DEVICE_ID_NI_PXI_6503, | ||
182 | .dio_badr = 1, | ||
183 | .is_mmio = 1, | ||
184 | .n_8255 = 1, | ||
121 | }, | 185 | }, |
122 | }; | 186 | }; |
123 | 187 | ||
@@ -265,6 +329,13 @@ static DEFINE_PCI_DEVICE_TABLE(pci_8255_pci_table) = { | |||
265 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO24H) }, | 329 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO24H) }, |
266 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO48H) }, | 330 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO48H) }, |
267 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO96H) }, | 331 | { PCI_DEVICE(PCI_VENDOR_ID_CB, PCI_DEVICE_ID_CB_PCIDIO96H) }, |
332 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCIDIO96) }, | ||
333 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCIDIO96B) }, | ||
334 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI6508) }, | ||
335 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI6503) }, | ||
336 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI6503B) }, | ||
337 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI6503X) }, | ||
338 | { PCI_DEVICE(PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI_6503) }, | ||
268 | { 0 } | 339 | { 0 } |
269 | }; | 340 | }; |
270 | MODULE_DEVICE_TABLE(pci, pci_8255_pci_table); | 341 | MODULE_DEVICE_TABLE(pci, pci_8255_pci_table); |
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index a83f5251756..0f8650681ee 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | comedi/drivers/ni_pcidio.c | 2 | comedi/drivers/ni_pcidio.c |
3 | driver for National Instruments PCI-DIO-96/PCI-6508 | 3 | driver for National Instruments PCI-DIO-32HS |
4 | National Instruments PCI-DIO-32HS | ||
5 | National Instruments PCI-6503 | ||
6 | 4 | ||
7 | COMEDI - Linux Control and Measurement Device Interface | 5 | COMEDI - Linux Control and Measurement Device Interface |
8 | Copyright (C) 1999,2002 David A. Schleef <ds@schleef.org> | 6 | Copyright (C) 1999,2002 David A. Schleef <ds@schleef.org> |
@@ -24,17 +22,14 @@ | |||
24 | */ | 22 | */ |
25 | /* | 23 | /* |
26 | Driver: ni_pcidio | 24 | Driver: ni_pcidio |
27 | Description: National Instruments PCI-DIO32HS, PCI-DIO96, PCI-6533, PCI-6503 | 25 | Description: National Instruments PCI-DIO32HS, PCI-6533 |
28 | Author: ds | 26 | Author: ds |
29 | Status: works | 27 | Status: works |
30 | Devices: [National Instruments] PCI-DIO-32HS (ni_pcidio), PXI-6533, | 28 | Devices: [National Instruments] PCI-DIO-32HS (ni_pcidio) |
31 | PCI-DIO-96, PCI-DIO-96B, PXI-6508, PCI-6503, PCI-6503B, PCI-6503X, | 29 | [National Instruments] PXI-6533, PCI-6533 (pxi-6533) |
32 | PXI-6503, PCI-6533, PCI-6534 | 30 | [National Instruments] PCI-6534 (pci-6534) |
33 | Updated: Mon, 09 Jan 2012 14:27:23 +0000 | 31 | Updated: Mon, 09 Jan 2012 14:27:23 +0000 |
34 | 32 | ||
35 | The DIO-96 appears as four 8255 subdevices. See the 8255 | ||
36 | driver notes for details. | ||
37 | |||
38 | The DIO32HS board appears as one subdevice, with 32 channels. | 33 | The DIO32HS board appears as one subdevice, with 32 channels. |
39 | Each channel is individually I/O configurable. The channel order | 34 | Each channel is individually I/O configurable. The channel order |
40 | is 0=A0, 1=A1, 2=A2, ... 8=B0, 16=C0, 24=D0. The driver only | 35 | is 0=A0, 1=A1, 2=A2, ... 8=B0, 16=C0, 24=D0. The driver only |
@@ -56,20 +51,6 @@ it are contained in the | |||
56 | comedi_nonfree_firmware tarball available from http://www.comedi.org | 51 | comedi_nonfree_firmware tarball available from http://www.comedi.org |
57 | */ | 52 | */ |
58 | 53 | ||
59 | /* | ||
60 | This driver is for both the NI PCI-DIO-32HS and the PCI-DIO-96, | ||
61 | which have very different architectures. But, since the '96 is | ||
62 | so simple, it is included here. | ||
63 | |||
64 | Manuals (available from ftp://ftp.natinst.com/support/manuals) | ||
65 | |||
66 | 320938c.pdf PCI-DIO-96/PXI-6508/PCI-6503 User Manual | ||
67 | 321464b.pdf AT/PCI-DIO-32HS User Manual | ||
68 | 341329A.pdf PCI-6533 Register-Level Programmer Manual | ||
69 | 341330A.pdf DAQ-DIO Technical Reference Manual | ||
70 | |||
71 | */ | ||
72 | |||
73 | #define USE_DMA | 54 | #define USE_DMA |
74 | /* #define DEBUG 1 */ | 55 | /* #define DEBUG 1 */ |
75 | /* #define DEBUG_FLAGS */ | 56 | /* #define DEBUG_FLAGS */ |
@@ -79,7 +60,6 @@ comedi_nonfree_firmware tarball available from http://www.comedi.org | |||
79 | #include "../comedidev.h" | 60 | #include "../comedidev.h" |
80 | 61 | ||
81 | #include "mite.h" | 62 | #include "mite.h" |
82 | #include "8255.h" | ||
83 | 63 | ||
84 | #undef DPRINTK | 64 | #undef DPRINTK |
85 | #ifdef DEBUG | 65 | #ifdef DEBUG |
@@ -91,14 +71,6 @@ comedi_nonfree_firmware tarball available from http://www.comedi.org | |||
91 | #define PCI_DIO_SIZE 4096 | 71 | #define PCI_DIO_SIZE 4096 |
92 | #define PCI_MITE_SIZE 4096 | 72 | #define PCI_MITE_SIZE 4096 |
93 | 73 | ||
94 | /* defines for the PCI-DIO-96 */ | ||
95 | |||
96 | #define NIDIO_8255_BASE(x) ((x)*4) | ||
97 | #define NIDIO_A 0 | ||
98 | #define NIDIO_B 4 | ||
99 | #define NIDIO_C 8 | ||
100 | #define NIDIO_D 12 | ||
101 | |||
102 | /* defines for the PCI-DIO-32HS */ | 74 | /* defines for the PCI-DIO-32HS */ |
103 | 75 | ||
104 | #define Window_Address 4 /* W */ | 76 | #define Window_Address 4 /* W */ |
@@ -297,76 +269,23 @@ static int ni_pcidio_cancel(struct comedi_device *dev, | |||
297 | struct comedi_subdevice *s); | 269 | struct comedi_subdevice *s); |
298 | 270 | ||
299 | struct nidio_board { | 271 | struct nidio_board { |
300 | |||
301 | int dev_id; | 272 | int dev_id; |
302 | const char *name; | 273 | const char *name; |
303 | int n_8255; | ||
304 | unsigned int is_diodaq:1; | ||
305 | unsigned int uses_firmware:1; | 274 | unsigned int uses_firmware:1; |
306 | }; | 275 | }; |
307 | 276 | ||
308 | static const struct nidio_board nidio_boards[] = { | 277 | static const struct nidio_board nidio_boards[] = { |
309 | { | 278 | { |
310 | .dev_id = 0x1150, | 279 | .dev_id = 0x1150, |
311 | .name = "pci-dio-32hs", | 280 | .name = "pci-dio-32hs", |
312 | .n_8255 = 0, | 281 | }, { |
313 | .is_diodaq = 1, | 282 | .dev_id = 0x1320, |
314 | }, | 283 | .name = "pxi-6533", |
315 | { | 284 | }, { |
316 | .dev_id = 0x1320, | 285 | .dev_id = 0x12b0, |
317 | .name = "pxi-6533", | 286 | .name = "pci-6534", |
318 | .n_8255 = 0, | 287 | .uses_firmware = 1, |
319 | .is_diodaq = 1, | 288 | }, |
320 | }, | ||
321 | { | ||
322 | .dev_id = 0x12b0, | ||
323 | .name = "pci-6534", | ||
324 | .n_8255 = 0, | ||
325 | .is_diodaq = 1, | ||
326 | .uses_firmware = 1, | ||
327 | }, | ||
328 | { | ||
329 | .dev_id = 0x0160, | ||
330 | .name = "pci-dio-96", | ||
331 | .n_8255 = 4, | ||
332 | .is_diodaq = 0, | ||
333 | }, | ||
334 | { | ||
335 | .dev_id = 0x1630, | ||
336 | .name = "pci-dio-96b", | ||
337 | .n_8255 = 4, | ||
338 | .is_diodaq = 0, | ||
339 | }, | ||
340 | { | ||
341 | .dev_id = 0x13c0, | ||
342 | .name = "pxi-6508", | ||
343 | .n_8255 = 4, | ||
344 | .is_diodaq = 0, | ||
345 | }, | ||
346 | { | ||
347 | .dev_id = 0x0400, | ||
348 | .name = "pci-6503", | ||
349 | .n_8255 = 1, | ||
350 | .is_diodaq = 0, | ||
351 | }, | ||
352 | { | ||
353 | .dev_id = 0x1250, | ||
354 | .name = "pci-6503b", | ||
355 | .n_8255 = 1, | ||
356 | .is_diodaq = 0, | ||
357 | }, | ||
358 | { | ||
359 | .dev_id = 0x17d0, | ||
360 | .name = "pci-6503x", | ||
361 | .n_8255 = 1, | ||
362 | .is_diodaq = 0, | ||
363 | }, | ||
364 | { | ||
365 | .dev_id = 0x1800, | ||
366 | .name = "pxi-6503", | ||
367 | .n_8255 = 1, | ||
368 | .is_diodaq = 0, | ||
369 | }, | ||
370 | }; | 289 | }; |
371 | 290 | ||
372 | #define n_nidio_boards ARRAY_SIZE(nidio_boards) | 291 | #define n_nidio_boards ARRAY_SIZE(nidio_boards) |
@@ -442,16 +361,6 @@ static void ni_pcidio_release_di_mite_channel(struct comedi_device *dev) | |||
442 | spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); | 361 | spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); |
443 | } | 362 | } |
444 | 363 | ||
445 | static int nidio96_8255_cb(int dir, int port, int data, unsigned long iobase) | ||
446 | { | ||
447 | if (dir) { | ||
448 | writeb(data, (void *)(iobase + port)); | ||
449 | return 0; | ||
450 | } else { | ||
451 | return readb((void *)(iobase + port)); | ||
452 | } | ||
453 | } | ||
454 | |||
455 | void ni_pcidio_event(struct comedi_device *dev, struct comedi_subdevice *s) | 364 | void ni_pcidio_event(struct comedi_device *dev, struct comedi_subdevice *s) |
456 | { | 365 | { |
457 | if (s-> | 366 | if (s-> |
@@ -1207,9 +1116,7 @@ static int nidio_find_device(struct comedi_device *dev, int bus, int slot) | |||
1207 | static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) | 1116 | static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) |
1208 | { | 1117 | { |
1209 | struct comedi_subdevice *s; | 1118 | struct comedi_subdevice *s; |
1210 | int i; | ||
1211 | int ret; | 1119 | int ret; |
1212 | int n_subdevices; | ||
1213 | unsigned int irq; | 1120 | unsigned int irq; |
1214 | 1121 | ||
1215 | printk(KERN_INFO "comedi%d: nidio:", dev->minor); | 1122 | printk(KERN_INFO "comedi%d: nidio:", dev->minor); |
@@ -1241,64 +1148,49 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
1241 | if (ret < 0) | 1148 | if (ret < 0) |
1242 | return ret; | 1149 | return ret; |
1243 | } | 1150 | } |
1244 | if (!this_board->is_diodaq) | ||
1245 | n_subdevices = this_board->n_8255; | ||
1246 | else | ||
1247 | n_subdevices = 1; | ||
1248 | 1151 | ||
1249 | ret = comedi_alloc_subdevices(dev, n_subdevices); | 1152 | ret = comedi_alloc_subdevices(dev, 1); |
1250 | if (ret) | 1153 | if (ret) |
1251 | return ret; | 1154 | return ret; |
1252 | 1155 | ||
1253 | if (!this_board->is_diodaq) { | 1156 | printk(KERN_INFO " rev=%d", |
1254 | for (i = 0; i < this_board->n_8255; i++) { | 1157 | readb(devpriv->mite->daq_io_addr + Chip_Version)); |
1255 | s = &dev->subdevices[i]; | 1158 | |
1256 | subdev_8255_init(dev, s, nidio96_8255_cb, | 1159 | s = &dev->subdevices[0]; |
1257 | (unsigned long)(devpriv->mite-> | 1160 | |
1258 | daq_io_addr + | 1161 | dev->read_subdev = s; |
1259 | NIDIO_8255_BASE(i))); | 1162 | s->type = COMEDI_SUBD_DIO; |
1260 | } | 1163 | s->subdev_flags = |
1261 | } else { | 1164 | SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL | SDF_PACKED | |
1262 | 1165 | SDF_CMD_READ; | |
1263 | printk(KERN_INFO " rev=%d", | 1166 | s->n_chan = 32; |
1264 | readb(devpriv->mite->daq_io_addr + Chip_Version)); | 1167 | s->range_table = &range_digital; |
1265 | 1168 | s->maxdata = 1; | |
1266 | s = &dev->subdevices[0]; | 1169 | s->insn_config = &ni_pcidio_insn_config; |
1267 | 1170 | s->insn_bits = &ni_pcidio_insn_bits; | |
1268 | dev->read_subdev = s; | 1171 | s->do_cmd = &ni_pcidio_cmd; |
1269 | s->type = COMEDI_SUBD_DIO; | 1172 | s->do_cmdtest = &ni_pcidio_cmdtest; |
1270 | s->subdev_flags = | 1173 | s->cancel = &ni_pcidio_cancel; |
1271 | SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL | SDF_PACKED | | 1174 | s->len_chanlist = 32; /* XXX */ |
1272 | SDF_CMD_READ; | 1175 | s->buf_change = &ni_pcidio_change; |
1273 | s->n_chan = 32; | 1176 | s->async_dma_dir = DMA_BIDIRECTIONAL; |
1274 | s->range_table = &range_digital; | 1177 | s->poll = &ni_pcidio_poll; |
1275 | s->maxdata = 1; | 1178 | |
1276 | s->insn_config = &ni_pcidio_insn_config; | 1179 | writel(0, devpriv->mite->daq_io_addr + Port_IO(0)); |
1277 | s->insn_bits = &ni_pcidio_insn_bits; | 1180 | writel(0, devpriv->mite->daq_io_addr + Port_Pin_Directions(0)); |
1278 | s->do_cmd = &ni_pcidio_cmd; | 1181 | writel(0, devpriv->mite->daq_io_addr + Port_Pin_Mask(0)); |
1279 | s->do_cmdtest = &ni_pcidio_cmdtest; | 1182 | |
1280 | s->cancel = &ni_pcidio_cancel; | 1183 | /* disable interrupts on board */ |
1281 | s->len_chanlist = 32; /* XXX */ | 1184 | writeb(0x00, |
1282 | s->buf_change = &ni_pcidio_change; | 1185 | devpriv->mite->daq_io_addr + |
1283 | s->async_dma_dir = DMA_BIDIRECTIONAL; | 1186 | Master_DMA_And_Interrupt_Control); |
1284 | s->poll = &ni_pcidio_poll; | ||
1285 | |||
1286 | writel(0, devpriv->mite->daq_io_addr + Port_IO(0)); | ||
1287 | writel(0, devpriv->mite->daq_io_addr + Port_Pin_Directions(0)); | ||
1288 | writel(0, devpriv->mite->daq_io_addr + Port_Pin_Mask(0)); | ||
1289 | |||
1290 | /* disable interrupts on board */ | ||
1291 | writeb(0x00, | ||
1292 | devpriv->mite->daq_io_addr + | ||
1293 | Master_DMA_And_Interrupt_Control); | ||
1294 | 1187 | ||
1295 | ret = request_irq(irq, nidio_interrupt, IRQF_SHARED, | 1188 | ret = request_irq(irq, nidio_interrupt, IRQF_SHARED, |
1296 | "ni_pcidio", dev); | 1189 | "ni_pcidio", dev); |
1297 | if (ret < 0) | 1190 | if (ret < 0) |
1298 | printk(KERN_WARNING " irq not available"); | 1191 | printk(KERN_WARNING " irq not available"); |
1299 | 1192 | ||
1300 | dev->irq = irq; | 1193 | dev->irq = irq; |
1301 | } | ||
1302 | 1194 | ||
1303 | printk("\n"); | 1195 | printk("\n"); |
1304 | 1196 | ||
@@ -1307,15 +1199,6 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
1307 | 1199 | ||
1308 | static void nidio_detach(struct comedi_device *dev) | 1200 | static void nidio_detach(struct comedi_device *dev) |
1309 | { | 1201 | { |
1310 | struct comedi_subdevice *s; | ||
1311 | int i; | ||
1312 | |||
1313 | if (this_board && !this_board->is_diodaq) { | ||
1314 | for (i = 0; i < this_board->n_8255; i++) { | ||
1315 | s = &dev->subdevices[i]; | ||
1316 | subdev_8255_cleanup(dev, s); | ||
1317 | } | ||
1318 | } | ||
1319 | if (dev->irq) | 1202 | if (dev->irq) |
1320 | free_irq(dev->irq, dev); | 1203 | free_irq(dev->irq, dev); |
1321 | if (devpriv) { | 1204 | if (devpriv) { |
@@ -1350,13 +1233,6 @@ static DEFINE_PCI_DEVICE_TABLE(ni_pcidio_pci_table) = { | |||
1350 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1150) }, | 1233 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1150) }, |
1351 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1320) }, | 1234 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1320) }, |
1352 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x12b0) }, | 1235 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x12b0) }, |
1353 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x0160) }, | ||
1354 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1630) }, | ||
1355 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x13c0) }, | ||
1356 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x0400) }, | ||
1357 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1250) }, | ||
1358 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x17d0) }, | ||
1359 | { PCI_DEVICE(PCI_VENDOR_ID_NI, 0x1800) }, | ||
1360 | { 0 } | 1236 | { 0 } |
1361 | }; | 1237 | }; |
1362 | MODULE_DEVICE_TABLE(pci, ni_pcidio_pci_table); | 1238 | MODULE_DEVICE_TABLE(pci, ni_pcidio_pci_table); |