1 #include <linux/module.h>
6 #include "../comedidev.h"
8 #include "amcc_s5933.h"
10 #include "addi-data/addi_common.h"
12 static void fpu_begin(void)
17 static void fpu_end(void)
22 #include "addi-data/addi_eeprom.c"
23 #include "addi-data/hwdrv_apci3200.c"
24 #include "addi-data/addi_common.c"
26 enum apci3200_boardid
{
31 static const struct addi_board apci3200_boardtypes
[] = {
33 .pc_DriverName
= "apci3200",
34 .i_IorangeBase1
= 256,
36 .pc_EepromChip
= "S5920",
38 .i_NbrAiChannelDiff
= 8,
39 .i_AiChannelList
= 16,
40 .i_AiMaxdata
= 0x3ffff,
41 .pr_AiRangelist
= &range_apci3200_ai
,
44 .ui_MinAcquisitiontimeNs
= 10000,
45 .ui_MinDelaytimeNs
= 100000,
46 .interrupt
= apci3200_interrupt
,
47 .reset
= apci3200_reset
,
48 .ai_config
= apci3200_ai_config
,
49 .ai_read
= apci3200_ai_read
,
50 .ai_write
= apci3200_ai_write
,
51 .ai_bits
= apci3200_ai_bits_test
,
52 .ai_cmdtest
= apci3200_ai_cmdtest
,
53 .ai_cmd
= apci3200_ai_cmd
,
54 .ai_cancel
= apci3200_cancel
,
55 .di_bits
= apci3200_di_insn_bits
,
56 .do_bits
= apci3200_do_insn_bits
,
59 .pc_DriverName
= "apci3300",
60 .i_IorangeBase1
= 256,
62 .pc_EepromChip
= "S5920",
63 .i_NbrAiChannelDiff
= 8,
65 .i_AiMaxdata
= 0x3ffff,
66 .pr_AiRangelist
= &range_apci3300_ai
,
69 .ui_MinAcquisitiontimeNs
= 10000,
70 .ui_MinDelaytimeNs
= 100000,
71 .interrupt
= apci3200_interrupt
,
72 .reset
= apci3200_reset
,
73 .ai_config
= apci3200_ai_config
,
74 .ai_read
= apci3200_ai_read
,
75 .ai_write
= apci3200_ai_write
,
76 .ai_bits
= apci3200_ai_bits_test
,
77 .ai_cmdtest
= apci3200_ai_cmdtest
,
78 .ai_cmd
= apci3200_ai_cmd
,
79 .ai_cancel
= apci3200_cancel
,
80 .di_bits
= apci3200_di_insn_bits
,
81 .do_bits
= apci3200_do_insn_bits
,
85 static int apci3200_auto_attach(struct comedi_device
*dev
,
86 unsigned long context
)
88 const struct addi_board
*board
= NULL
;
90 if (context
< ARRAY_SIZE(apci3200_boardtypes
))
91 board
= &apci3200_boardtypes
[context
];
94 dev
->board_ptr
= board
;
96 return addi_auto_attach(dev
, context
);
99 static struct comedi_driver apci3200_driver
= {
100 .driver_name
= "addi_apci_3200",
101 .module
= THIS_MODULE
,
102 .auto_attach
= apci3200_auto_attach
,
103 .detach
= i_ADDI_Detach
,
106 static int apci3200_pci_probe(struct pci_dev
*dev
,
107 const struct pci_device_id
*id
)
109 return comedi_pci_auto_config(dev
, &apci3200_driver
, id
->driver_data
);
112 static const struct pci_device_id apci3200_pci_table
[] = {
113 { PCI_VDEVICE(ADDIDATA
, 0x3000), BOARD_APCI3200
},
114 { PCI_VDEVICE(ADDIDATA
, 0x3007), BOARD_APCI3300
},
117 MODULE_DEVICE_TABLE(pci
, apci3200_pci_table
);
119 static struct pci_driver apci3200_pci_driver
= {
120 .name
= "addi_apci_3200",
121 .id_table
= apci3200_pci_table
,
122 .probe
= apci3200_pci_probe
,
123 .remove
= comedi_pci_auto_unconfig
,
125 module_comedi_pci_driver(apci3200_driver
, apci3200_pci_driver
);