191 #include "../comedidev.h"
201 #define PCI_VENDOR_ID_AMPLICON 0x14dc
202 #define PCI_DEVICE_ID_PCI230 0x0000
203 #define PCI_DEVICE_ID_PCI260 0x0006
204 #define PCI_DEVICE_ID_INVALID 0xffff
206 #define PCI230_IO1_SIZE 32
207 #define PCI230_IO2_SIZE 16
210 #define PCI230_PPI_X_BASE 0x00
211 #define PCI230_PPI_X_A 0x00
212 #define PCI230_PPI_X_B 0x01
213 #define PCI230_PPI_X_C 0x02
214 #define PCI230_PPI_X_CMD 0x03
215 #define PCI230_Z2_CT_BASE 0x14
216 #define PCI230_Z2_CT0 0x14
217 #define PCI230_Z2_CT1 0x15
218 #define PCI230_Z2_CT2 0x16
219 #define PCI230_Z2_CTC 0x17
220 #define PCI230_ZCLK_SCE 0x1A
221 #define PCI230_ZGAT_SCE 0x1D
222 #define PCI230_INT_SCE 0x1E
223 #define PCI230_INT_STAT 0x1E
226 #define PCI230_DACCON 0x00
227 #define PCI230_DACOUT1 0x02
228 #define PCI230_DACOUT2 0x04
229 #define PCI230_ADCDATA 0x08
230 #define PCI230_ADCSWTRIG 0x08
231 #define PCI230_ADCCON 0x0A
232 #define PCI230_ADCEN 0x0C
233 #define PCI230_ADCG 0x0E
235 #define PCI230P_ADCTRIG 0x10
236 #define PCI230P_ADCTH 0x12
237 #define PCI230P_ADCFFTH 0x14
238 #define PCI230P_ADCFFLEV 0x16
239 #define PCI230P_ADCPTSC 0x18
240 #define PCI230P_ADCHYST 0x1A
241 #define PCI230P_EXTFUNC 0x1C
242 #define PCI230P_HWVER 0x1E
244 #define PCI230P2_DACDATA 0x02
245 #define PCI230P2_DACSWTRIG 0x02
246 #define PCI230P2_DACEN 0x06
249 #define PCI230_DAC_SETTLE 5
251 #define PCI230_ADC_SETTLE 1
254 #define PCI230_MUX_SETTLE 10
258 #define PCI230_DAC_OR_UNI (0<<0)
259 #define PCI230_DAC_OR_BIP (1<<0)
260 #define PCI230_DAC_OR_MASK (1<<0)
263 #define PCI230P2_DAC_FIFO_EN (1<<8)
266 #define PCI230P2_DAC_TRIG_NONE (0<<2)
267 #define PCI230P2_DAC_TRIG_SW (1<<2)
268 #define PCI230P2_DAC_TRIG_EXTP (2<<2)
269 #define PCI230P2_DAC_TRIG_EXTN (3<<2)
270 #define PCI230P2_DAC_TRIG_Z2CT0 (4<<2)
271 #define PCI230P2_DAC_TRIG_Z2CT1 (5<<2)
272 #define PCI230P2_DAC_TRIG_Z2CT2 (6<<2)
273 #define PCI230P2_DAC_TRIG_MASK (7<<2)
274 #define PCI230P2_DAC_FIFO_WRAP (1<<7)
275 #define PCI230P2_DAC_INT_FIFO_EMPTY (0<<9)
276 #define PCI230P2_DAC_INT_FIFO_NEMPTY (1<<9)
277 #define PCI230P2_DAC_INT_FIFO_NHALF (2<<9)
278 #define PCI230P2_DAC_INT_FIFO_HALF (3<<9)
279 #define PCI230P2_DAC_INT_FIFO_NFULL (4<<9)
280 #define PCI230P2_DAC_INT_FIFO_FULL (5<<9)
281 #define PCI230P2_DAC_INT_FIFO_MASK (7<<9)
284 #define PCI230_DAC_BUSY (1<<1)
287 #define PCI230P2_DAC_FIFO_UNDERRUN_LATCHED (1<<5)
288 #define PCI230P2_DAC_FIFO_EMPTY (1<<13)
289 #define PCI230P2_DAC_FIFO_FULL (1<<14)
290 #define PCI230P2_DAC_FIFO_HALF (1<<15)
295 #define PCI230P2_DAC_FIFO_UNDERRUN_CLEAR (1<<5)
296 #define PCI230P2_DAC_FIFO_RESET (1<<12)
299 #define PCI230P2_DAC_FIFOLEVEL_HALF 512
300 #define PCI230P2_DAC_FIFOLEVEL_FULL 1024
302 #define PCI230P2_DAC_FIFOROOM_EMPTY PCI230P2_DAC_FIFOLEVEL_FULL
303 #define PCI230P2_DAC_FIFOROOM_ONETOHALF \
304 (PCI230P2_DAC_FIFOLEVEL_FULL - PCI230P2_DAC_FIFOLEVEL_HALF)
305 #define PCI230P2_DAC_FIFOROOM_HALFTOFULL 1
306 #define PCI230P2_DAC_FIFOROOM_FULL 0
309 #define PCI230_ADC_TRIG_NONE (0<<0)
310 #define PCI230_ADC_TRIG_SW (1<<0)
311 #define PCI230_ADC_TRIG_EXTP (2<<0)
312 #define PCI230_ADC_TRIG_EXTN (3<<0)
313 #define PCI230_ADC_TRIG_Z2CT0 (4<<0)
314 #define PCI230_ADC_TRIG_Z2CT1 (5<<0)
315 #define PCI230_ADC_TRIG_Z2CT2 (6<<0)
316 #define PCI230_ADC_TRIG_MASK (7<<0)
317 #define PCI230_ADC_IR_UNI (0<<3)
318 #define PCI230_ADC_IR_BIP (1<<3)
319 #define PCI230_ADC_IR_MASK (1<<3)
320 #define PCI230_ADC_IM_SE (0<<4)
321 #define PCI230_ADC_IM_DIF (1<<4)
322 #define PCI230_ADC_IM_MASK (1<<4)
323 #define PCI230_ADC_FIFO_EN (1<<8)
324 #define PCI230_ADC_INT_FIFO_EMPTY (0<<9)
325 #define PCI230_ADC_INT_FIFO_NEMPTY (1<<9)
326 #define PCI230_ADC_INT_FIFO_NHALF (2<<9)
327 #define PCI230_ADC_INT_FIFO_HALF (3<<9)
328 #define PCI230_ADC_INT_FIFO_NFULL (4<<9)
329 #define PCI230_ADC_INT_FIFO_FULL (5<<9)
330 #define PCI230P_ADC_INT_FIFO_THRESH (7<<9)
331 #define PCI230_ADC_INT_FIFO_MASK (7<<9)
334 #define PCI230_ADC_FIFO_RESET (1<<12)
335 #define PCI230_ADC_GLOB_RESET (1<<13)
338 #define PCI230_ADC_BUSY (1<<15)
339 #define PCI230_ADC_FIFO_EMPTY (1<<12)
340 #define PCI230_ADC_FIFO_FULL (1<<13)
341 #define PCI230_ADC_FIFO_HALF (1<<14)
342 #define PCI230_ADC_FIFO_FULL_LATCHED (1<<5)
345 #define PCI230_ADC_FIFOLEVEL_HALFFULL 2049
346 #define PCI230_ADC_FIFOLEVEL_FULL 4096
350 #define PCI230_ADC_CONV 0xffff
353 #define PCI230P_EXTFUNC_GAT_EXTTRIG (1<<0)
356 #define PCI230P2_EXTFUNC_DACFIFO (1<<1)
371 #define CLK_CONFIG(chan, src) ((((chan) & 3) << 3) | ((src) & 7))
373 #define TIMEBASE_10MHZ 100
374 #define TIMEBASE_1MHZ 1000
375 #define TIMEBASE_100KHZ 10000
376 #define TIMEBASE_10KHZ 100000
377 #define TIMEBASE_1KHZ 1000000
385 #define GAT_NOUTNM2 3
387 #define GAT_CONFIG(chan, src) ((((chan) & 3) << 3) | ((src) & 7))
402 #define PCI230_INT_DISABLE 0
403 #define PCI230_INT_PPI_C0 (1<<0)
404 #define PCI230_INT_PPI_C3 (1<<1)
405 #define PCI230_INT_ADC (1<<2)
406 #define PCI230_INT_ZCLK_CT1 (1<<5)
408 #define PCI230P2_INT_DAC (1<<4)
410 #define PCI230_TEST_BIT(val, n) ((val>>n)&1)
432 #define COMBINE(old, new, mask) (((old) & ~(mask)) | ((new) & (mask)))
435 #define THISCPU smp_processor_id()
438 #define AI_CMD_STARTED 0
439 #define AO_CMD_STARTED 1
495 .name =
"amplc_pci230",
543 static const unsigned int pci230_timebase[8] = {
564 static const unsigned char pci230_ai_gain[7] = { 0, 1, 2, 3, 1, 2, 3 };
567 static const unsigned char pci230_ai_bipolar[7] = { 1, 1, 1, 1, 0, 0, 0 };
577 static const unsigned char pci230_ao_bipolar[2] = { 0, 1 };
590 data = data >> (16 - thisboard->
ai_bits);
595 data ^= 1 << (thisboard->
ai_bits - 1);
600 static inline unsigned short pci230_ao_mangle_datum(
struct comedi_device *dev,
603 const struct pci230_board *thisboard = comedi_board(dev);
609 datum ^= 1 << (thisboard->
ao_bits - 1);
614 datum <<= (16 - thisboard->
ao_bits);
615 return (
unsigned short)datum;
618 static inline void pci230_ao_write_nofifo(
struct comedi_device *dev,
619 short datum,
unsigned int chan)
627 outw(pci230_ao_mangle_datum(dev, datum), dev->
iobase + (((chan) == 0)
633 static inline void pci230_ao_write_fifo(
struct comedi_device *dev,
short datum,
642 outw(pci230_ao_mangle_datum(dev, datum),
646 static int get_resources(
struct comedi_device *dev,
unsigned int res_mask,
653 unsigned int claimed;
654 unsigned long irqflags;
660 && (res_mask != 0); b <<= 1, i++) {
661 if ((res_mask & b) != 0) {
666 }
else if (devpriv->
res_owner[i] != owner) {
667 for (b = 1, i = 0; claimed != 0; b <<= 1, i++) {
668 if ((claimed & b) != 0) {
679 spin_unlock_irqrestore(&devpriv->
res_spinlock, irqflags);
683 static inline int get_one_resource(
struct comedi_device *dev,
684 unsigned int resource,
unsigned char owner)
686 return get_resources(dev, (1
U << resource), owner);
689 static void put_resources(
struct comedi_device *dev,
unsigned int res_mask,
695 unsigned long irqflags;
699 && (res_mask != 0); b <<= 1, i++) {
700 if ((res_mask & b) != 0) {
707 spin_unlock_irqrestore(&devpriv->
res_spinlock, irqflags);
710 static inline void put_one_resource(
struct comedi_device *dev,
711 unsigned int resource,
unsigned char owner)
713 put_resources(dev, (1
U << resource), owner);
716 static inline void put_all_resources(
struct comedi_device *dev,
722 static unsigned int divide_ns(
uint64_t ns,
unsigned int timebase,
723 unsigned int round_mode)
729 rem =
do_div(div, timebase);
731 switch (round_mode) {
734 div += (rem + (timebase / 2)) / timebase;
739 div += (rem + timebase - 1) / timebase;
747 static unsigned int pci230_choose_clk_count(
uint64_t ns,
unsigned int *
count,
748 unsigned int round_mode)
753 cnt = divide_ns(ns, pci230_timebase[clk_src], round_mode);
754 if ((cnt <= 65536) || (clk_src ==
CLK_1KHZ))
762 static void pci230_ns_to_single_timer(
unsigned int *ns,
unsigned int round)
767 clk_src = pci230_choose_clk_count(*ns, &count, round);
768 *ns = count * pci230_timebase[
clk_src];
772 static void pci230_ct_setup_ns_mode(
struct comedi_device *dev,
unsigned int ct,
783 clk_src = pci230_choose_clk_count(ns, &count, round);
793 static void pci230_cancel_ct(
struct comedi_device *dev,
unsigned int ct)
811 unsigned int chan,
range, aref;
812 unsigned int gainshift;
814 unsigned short adccon, adcen;
822 if (chan >= s->
n_chan / 2) {
823 DPRINTK(
"comedi%d: amplc_pci230: ai_rinsn: "
824 "differential channel number out of range "
841 gainshift = chan * 2;
842 if (devpriv->
hwver == 0) {
845 adcen = 3 << gainshift;
849 adcen = 1 << gainshift;
855 gainshift = chan & ~1;
858 devpriv->
adcg = (devpriv->
adcg & ~(3 << gainshift))
859 | (pci230_ai_gain[
range] << gainshift);
878 for (n = 0; n < insn->
n; n++) {
888 for (i = 0; i <
TIMEOUT; i++) {
900 data[
n] = pci230_ai_read(dev);
929 for (i = 0; i < insn->
n; i++) {
931 pci230_ao_write_nofifo(dev, data[i], chan);
948 for (i = 0; i < insn->
n; i++)
957 const struct pci230_board *thisboard = comedi_board(dev);
996 err |= cfc_check_trigger_is_unique(cmd->
stop_src);
1011 #define MAX_SPEED_AO 8000
1012 #define MIN_SPEED_AO 4294967295u
1089 range_err = (1 << 1)
1093 unsigned int chan, prev_chan;
1094 unsigned int range, first_range;
1103 if (chan < prev_chan)
1107 if (range != first_range)
1108 errors |= range_err;
1114 if ((errors & seq_err) != 0) {
1115 DPRINTK(
"comedi%d: amplc_pci230: ao_cmdtest: "
1116 "channel numbers must increase\n",
1119 if ((errors & range_err) != 0) {
1120 DPRINTK(
"comedi%d: amplc_pci230: ao_cmdtest: "
1121 "channels must have the same range\n",
1137 unsigned long irqflags;
1138 unsigned char intsrc;
1147 cmd = &s->
async->cmd;
1150 pci230_cancel_ct(dev, 1);
1153 if (devpriv->
hwver < 2) {
1163 devpriv->
int_en &= ~intsrc;
1165 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
1172 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
1173 if (devpriv->
hwver >= 2) {
1185 static void pci230_handle_ao_nofifo(
struct comedi_device *dev,
1201 pci230_ao_stop(dev, s);
1214 pci230_ao_stop(dev, s);
1227 unsigned int num_scans;
1229 unsigned short dacstat;
1231 unsigned int bytes_per_scan;
1258 if ((num_scans == 0)
1277 if (num_scans > room)
1280 for (n = 0; n < num_scans; n++) {
1285 pci230_ao_write_fifo(dev, datum,
1306 if ((dacstat & PCI230P2_DAC_FIFO_UNDERRUN_LATCHED) != 0) {
1314 pci230_ao_stop(dev, s);
1323 static int pci230_ao_inttrig_scan_begin(
struct comedi_device *dev,
1325 unsigned int trig_num)
1328 unsigned long irqflags;
1336 if (devpriv->
hwver < 2) {
1340 pci230_handle_ao_nofifo(dev, s);
1365 unsigned long irqflags;
1371 pci230_ao_stop(dev, s);
1374 if (devpriv->
hwver >= 2) {
1376 unsigned short scantrig;
1380 run = pci230_handle_ao_fifo(dev, s);
1417 if (devpriv->
hwver < 2) {
1434 async->
inttrig = pci230_ao_inttrig_scan_begin;
1437 if (devpriv->
hwver >= 2) {
1449 static int pci230_ao_inttrig_start(
struct comedi_device *dev,
1451 unsigned int trig_num)
1457 pci230_ao_start(dev, s);
1494 if (devpriv->
hwver >= 2) {
1495 unsigned short dacen;
1535 s->
async->inttrig = pci230_ao_inttrig_start;
1543 pci230_ao_stop(dev, s);
1547 static int pci230_ai_check_scan_period(
struct comedi_cmd *cmd)
1556 min_scan_period = chanlist_len * cmd->
convert_arg;
1557 if ((min_scan_period < chanlist_len)
1574 const struct pci230_board *thisboard = comedi_board(dev);
1604 err |= cfc_check_trigger_is_unique(cmd->
start_src);
1606 err |= cfc_check_trigger_is_unique(cmd->
convert_src);
1607 err |= cfc_check_trigger_is_unique(cmd->
stop_src);
1630 #define MAX_SPEED_AI_SE 3200
1631 #define MAX_SPEED_AI_DIFF 8000
1632 #define MAX_SPEED_AI_PLUS 4000
1633 #define MIN_SPEED_AI 4294967295u
1639 unsigned int max_speed_ai;
1641 if (devpriv->
hwver == 0) {
1740 if (!pci230_ai_check_scan_period(cmd))
1770 if (!pci230_ai_check_scan_period(cmd)) {
1774 pci230_ai_check_scan_period(cmd);
1788 rangepair_err = 1 << 1,
1789 polarity_err = 1 << 2,
1791 diffchan_err = 1 << 4,
1792 buggy_chan0_err = 1 << 5
1795 unsigned int chan, prev_chan;
1796 unsigned int range, prev_range;
1797 unsigned int polarity, prev_polarity;
1798 unsigned int aref, prev_aref;
1799 unsigned int subseq_len;
1804 prev_chan = prev_aref = prev_range = prev_polarity = 0;
1809 polarity = pci230_ai_bipolar[
range];
1814 && (chan >= (s->
n_chan / 2))) {
1815 errors |= diffchan_err;
1820 if ((chan <= prev_chan)
1821 && (subseq_len == 0)) {
1824 if ((subseq_len > 0)
1830 if (aref != prev_aref)
1834 if (polarity != prev_polarity)
1835 errors |= polarity_err;
1840 && (((chan ^ prev_chan) & ~1) == 0)
1841 && (range != prev_range)) {
1842 errors |= rangepair_err;
1850 if (subseq_len == 0) {
1856 if ((n % subseq_len) != 0)
1859 if ((devpriv->
hwver > 0) && (devpriv->
hwver < 4)) {
1874 if ((subseq_len > 1)
1876 errors |= buggy_chan0_err;
1881 if ((errors & seq_err) != 0) {
1882 DPRINTK(
"comedi%d: amplc_pci230: ai_cmdtest: "
1883 "channel numbers must increase or "
1884 "sequence must repeat exactly\n",
1887 if ((errors & rangepair_err) != 0) {
1888 DPRINTK(
"comedi%d: amplc_pci230: ai_cmdtest: "
1889 "single-ended channel pairs must "
1890 "have the same range\n", dev->
minor);
1892 if ((errors & polarity_err) != 0) {
1893 DPRINTK(
"comedi%d: amplc_pci230: ai_cmdtest: "
1894 "channel sequence ranges must be all "
1895 "bipolar or all unipolar\n",
1898 if ((errors & aref_err) != 0) {
1899 DPRINTK(
"comedi%d: amplc_pci230: ai_cmdtest: "
1900 "channel sequence analogue references "
1901 "must be all the same (single-ended "
1902 "or differential)\n", dev->
minor);
1904 if ((errors & diffchan_err) != 0) {
1905 DPRINTK(
"comedi%d: amplc_pci230: ai_cmdtest: "
1906 "differential channel number out of "
1907 "range 0 to %u\n", dev->
minor,
1910 if ((errors & buggy_chan0_err) != 0) {
1912 "amplc_pci230: ai_cmdtest: Buggy PCI230+/260+ h/w version %u requires first channel of multi-channel sequence to be 0 (corrected in h/w version 4)\n",
1924 static void pci230_ai_update_fifo_trigger_level(
struct comedi_device *dev,
1931 unsigned short triglev;
1932 unsigned short adccon;
1950 if ((wake > 1) && (devpriv->
hwver > 0)) {
1962 if (adccon != devpriv->
adccon) {
1963 devpriv->
adccon = adccon;
1968 static int pci230_ai_inttrig_convert(
struct comedi_device *dev,
1970 unsigned int trig_num)
1973 unsigned long irqflags;
1980 unsigned int delayus;
1995 && (devpriv->
hwver == 0)) {
2011 static int pci230_ai_inttrig_scan_begin(
struct comedi_device *dev,
2013 unsigned int trig_num)
2016 unsigned long irqflags;
2039 unsigned long irqflags;
2048 cmd = &s->
async->cmd;
2051 pci230_cancel_ct(dev, 2);
2055 pci230_cancel_ct(dev, 0);
2062 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
2069 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
2085 unsigned long irqflags;
2086 unsigned short conv;
2094 pci230_ai_stop(dev, s);
2102 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
2144 async->
inttrig = pci230_ai_inttrig_convert;
2148 pci230_ai_update_fifo_trigger_level(dev, s);
2209 pci230_ai_inttrig_scan_begin;
2220 static int pci230_ai_inttrig_start(
struct comedi_device *dev,
2222 unsigned int trig_num)
2228 pci230_ai_start(dev, s);
2237 unsigned int events = 0;
2238 unsigned int status_fifo;
2241 unsigned int fifoamount;
2243 unsigned int scanlen = async->
cmd.scan_end_arg;
2262 for (i = 0; i <
todo; i++) {
2263 if (fifoamount == 0) {
2280 if (devpriv->
hwver > 0) {
2284 if (fifoamount == 0) {
2319 pci230_ai_stop(dev, s);
2322 pci230_ai_update_fifo_trigger_level(dev, s);
2329 unsigned int i, chan,
range, diff;
2330 unsigned int res_mask;
2331 unsigned short adccon, adcen;
2407 unsigned int gainshift;
2412 gainshift = 2 * chan;
2413 if (devpriv->
hwver == 0) {
2416 adcen |= 3 << gainshift;
2420 adcen |= 1 << gainshift;
2423 gainshift = (chan & ~1);
2426 devpriv->
adcg = (devpriv->
adcg & ~(3 << gainshift))
2427 | (pci230_ai_gain[
range] << gainshift);
2449 devpriv->
adccon = adccon;
2511 s->
async->inttrig = pci230_ai_inttrig_start;
2514 pci230_ai_start(dev, s);
2523 pci230_ai_stop(dev, s);
2530 unsigned char status_int, valid_status_int;
2534 unsigned long irqflags;
2544 valid_status_int = devpriv->
int_en & status_int;
2548 devpriv->
ier = devpriv->
int_en & ~status_int;
2552 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
2564 pci230_handle_ao_nofifo(dev, s);
2570 pci230_handle_ao_fifo(dev, s);
2576 pci230_handle_ai(dev, s);
2587 spin_unlock_irqrestore(&devpriv->
isr_spinlock, irqflags);
2610 static const struct pci230_board *pci230_find_pci_board(
struct pci_dev *pci_dev)
2614 for (i = 0; i <
ARRAY_SIZE(pci230_boards); i++)
2615 if (pci230_match_pci_board(&pci230_boards[i], pci_dev))
2616 return &pci230_boards[i];
2621 static struct pci_dev *pci230_find_pci_dev(
struct comedi_device *dev,
2624 const struct pci230_board *thisboard = comedi_board(dev);
2625 struct pci_dev *pci_dev =
NULL;
2634 if ((bus || slot) &&
2635 (bus != pci_dev->
bus->number ||
2642 foundboard = pci230_find_pci_board(pci_dev);
2643 if (foundboard ==
NULL)
2649 if (!pci230_match_pci_board(thisboard, pci_dev))
2655 "No supported board found! (req. bus %d, slot %d)\n",
2681 struct pci_dev *pci_dev)
2683 const struct pci230_board *thisboard = comedi_board(dev);
2686 unsigned long iobase1, iobase2;
2690 comedi_set_hw_dev(dev, &pci_dev->
dev);
2696 "failed to enable PCI device and request regions\n");
2704 "%s I/O region 1 0x%04lx I/O region 2 0x%04lx\n",
2713 unsigned short extfunc = 0;
2718 "%s - bad hardware version - got %u, need %u\n",
2723 if (devpriv->
hwver > 0) {
2733 && (devpriv->
hwver >= 2)) {
2766 "unable to register irq %u, commands will not be available\n",
2790 s->
do_cmd = &pci230_ai_cmd;
2792 s->
cancel = pci230_ai_cancel;
2810 s->
do_cmd = &pci230_ao_cmd;
2812 s->
cancel = pci230_ao_cancel;
2833 const struct pci230_board *thisboard = comedi_board(dev);
2839 rc = pci230_alloc_private(dev);
2842 pci_dev = pci230_find_pci_dev(dev, it);
2845 return pci230_attach_common(dev, pci_dev);
2849 struct pci_dev *pci_dev)
2855 rc = pci230_alloc_private(dev);
2858 dev->
board_ptr = pci230_find_pci_board(pci_dev);
2861 "amplc_pci230: BUG! cannot determine board type!\n");
2871 return pci230_attach_common(dev, pci_dev);
2876 const struct pci230_board *thisboard = comedi_board(dev);
2877 struct pci_dev *
pcidev = comedi_to_pci_dev(dev);
2891 .driver_name =
"amplc_pci230",
2893 .attach = pci230_attach,
2894 .attach_pci = pci230_attach_pci,
2895 .detach = pci230_detach,
2896 .board_name = &pci230_boards[0].
name,
2897 .offset =
sizeof(pci230_boards[0]),
2901 static int __devinit amplc_pci230_pci_probe(
struct pci_dev *dev,
2907 static void __devexit amplc_pci230_pci_remove(
struct pci_dev *dev)
2919 static struct pci_driver amplc_pci230_pci_driver = {
2920 .name =
"amplc_pci230",
2921 .id_table = amplc_pci230_pci_table,
2922 .probe = amplc_pci230_pci_probe,