staging: comedi: addi_apci_3120: merge in addi_apci_3001 driver
authorH Hartley Sweeten <hartleys@visionengravers.com>
Fri, 2 Nov 2012 00:24:06 +0000 (17:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Nov 2012 18:23:47 +0000 (11:23 -0700)
The addi_apci_3120 and addi_apci_3001 drivers share the same low-level
board support code (hwdrv_apci3120). Merge the boardinfo and PCI_DEVICE
information from the addi_apci_3001 driver into the addi_apci_3120
driver and delete then delete the addi_apci_3001 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>
drivers/staging/comedi/Kconfig
drivers/staging/comedi/drivers/Makefile
drivers/staging/comedi/drivers/addi_apci_3001.c [deleted file]
drivers/staging/comedi/drivers/addi_apci_3120.c

index 21a6748d7adcc6df5ecb8c1018d104025dc7893a..6246bed00ef1a68d616f23ee7cc8d28fa9c10087 100644 (file)
@@ -647,22 +647,12 @@ config COMEDI_ADDI_APCI_2200
          To compile this driver as a module, choose M here: the module will be
          called addi_apci_2200.
 
-config COMEDI_ADDI_APCI_3001
-       tristate "ADDI-DATA APCI_3001 support"
-       depends on VIRT_TO_BUS
-       select COMEDI_FC
-       ---help---
-         Enable support for ADDI-DATA APCI_3001 cards
-
-         To compile this driver as a module, choose M here: the module will be
-         called addi_apci_3001.
-
 config COMEDI_ADDI_APCI_3120
-       tristate "ADDI-DATA APCI_3520 support"
+       tristate "ADDI-DATA APCI_3120/3001 support"
        depends on VIRT_TO_BUS
        select COMEDI_FC
        ---help---
-         Enable support for ADDI-DATA APCI_3520 cards
+         Enable support for ADDI-DATA APCI_3120/3001 cards
 
          To compile this driver as a module, choose M here: the module will be
          called addi_apci_3120.
index a2787c0ca3274fa8d62791bbb68f8e577864cf24..c784bedb9110752bde98452c1e6ad067bb96bf68 100644 (file)
@@ -65,7 +65,6 @@ obj-$(CONFIG_COMEDI_ADDI_APCI_16XX)   += addi_apci_16xx.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_2016)    += addi_apci_2016.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_2032)    += addi_apci_2032.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_2200)    += addi_apci_2200.o
-obj-$(CONFIG_COMEDI_ADDI_APCI_3001)    += addi_apci_3001.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_3120)    += addi_apci_3120.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_3501)    += addi_apci_3501.o
 obj-$(CONFIG_COMEDI_ADDI_APCI_3XXX)    += addi_apci_3xxx.o
diff --git a/drivers/staging/comedi/drivers/addi_apci_3001.c b/drivers/staging/comedi/drivers/addi_apci_3001.c
deleted file mode 100644 (file)
index 90506a3..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "../comedidev.h"
-#include "comedi_fc.h"
-#include "amcc_s5933.h"
-
-#include "addi-data/addi_common.h"
-
-#include "addi-data/addi_eeprom.c"
-#include "addi-data/hwdrv_apci3120.c"
-#include "addi-data/addi_common.c"
-
-static const struct addi_board apci3001_boardtypes[] = {
-       {
-               .pc_DriverName          = "apci3001",
-               .i_VendorId             = PCI_VENDOR_ID_ADDIDATA_OLD,
-               .i_DeviceId             = 0x828D,
-               .i_IorangeBase0         = AMCC_OP_REG_SIZE,
-               .i_IorangeBase1         = APCI3120_ADDRESS_RANGE,
-               .i_IorangeBase2         = 8,
-               .i_PCIEeprom            = ADDIDATA_NO_EEPROM,
-               .i_NbrAiChannel         = 16,
-               .i_NbrAiChannelDiff     = 8,
-               .i_AiChannelList        = 16,
-               .i_AiMaxdata            = 0xfff,
-               .pr_AiRangelist         = &range_apci3120_ai,
-               .i_NbrDiChannel         = 4,
-               .i_NbrDoChannel         = 4,
-               .i_DoMaxdata            = 0x0f,
-               .i_Dma                  = 1,
-               .i_Timer                = 1,
-               .b_AvailableConvertUnit = 1,
-               .ui_MinAcquisitiontimeNs = 10000,
-               .ui_MinDelaytimeNs      = 100000,
-               .interrupt              = v_APCI3120_Interrupt,
-               .reset                  = i_APCI3120_Reset,
-               .ai_config              = i_APCI3120_InsnConfigAnalogInput,
-               .ai_read                = i_APCI3120_InsnReadAnalogInput,
-               .ai_cmdtest             = i_APCI3120_CommandTestAnalogInput,
-               .ai_cmd                 = i_APCI3120_CommandAnalogInput,
-               .ai_cancel              = i_APCI3120_StopCyclicAcquisition,
-               .di_read                = i_APCI3120_InsnReadDigitalInput,
-               .di_bits                = i_APCI3120_InsnBitsDigitalInput,
-               .do_config              = i_APCI3120_InsnConfigDigitalOutput,
-               .do_write               = i_APCI3120_InsnWriteDigitalOutput,
-               .do_bits                = i_APCI3120_InsnBitsDigitalOutput,
-               .timer_config           = i_APCI3120_InsnConfigTimer,
-               .timer_write            = i_APCI3120_InsnWriteTimer,
-               .timer_read             = i_APCI3120_InsnReadTimer,
-       },
-};
-
-static struct comedi_driver apci3001_driver = {
-       .driver_name    = "addi_apci_3001",
-       .module         = THIS_MODULE,
-       .attach_pci     = addi_attach_pci,
-       .detach         = i_ADDI_Detach,
-       .num_names      = ARRAY_SIZE(apci3001_boardtypes),
-       .board_name     = &apci3001_boardtypes[0].pc_DriverName,
-       .offset         = sizeof(struct addi_board),
-};
-
-static int __devinit apci3001_pci_probe(struct pci_dev *dev,
-                                       const struct pci_device_id *ent)
-{
-       return comedi_pci_auto_config(dev, &apci3001_driver);
-}
-
-static void __devexit apci3001_pci_remove(struct pci_dev *dev)
-{
-       comedi_pci_auto_unconfig(dev);
-}
-
-static DEFINE_PCI_DEVICE_TABLE(apci3001_pci_table) = {
-       { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA_OLD, 0x828d) },
-       { 0 }
-};
-MODULE_DEVICE_TABLE(pci, apci3001_pci_table);
-
-static struct pci_driver apci3001_pci_driver = {
-       .name           = "addi_apci_3001",
-       .id_table       = apci3001_pci_table,
-       .probe          = apci3001_pci_probe,
-       .remove         = __devexit_p(apci3001_pci_remove),
-};
-module_comedi_pci_driver(apci3001_driver, apci3001_pci_driver);
-
-MODULE_AUTHOR("Comedi http://www.comedi.org");
-MODULE_DESCRIPTION("Comedi low-level driver");
-MODULE_LICENSE("GPL");
index 5db6bfc0e22562bb4fce7ea8ba61bae5023c8109..979b8a9703adf57e2be91f28fa579edc0001af9a 100644 (file)
@@ -51,6 +51,42 @@ static const struct addi_board apci3120_boardtypes[] = {
                .timer_config           = i_APCI3120_InsnConfigTimer,
                .timer_write            = i_APCI3120_InsnWriteTimer,
                .timer_read             = i_APCI3120_InsnReadTimer,
+       }, {
+               .pc_DriverName          = "apci3001",
+               .i_VendorId             = PCI_VENDOR_ID_ADDIDATA_OLD,
+               .i_DeviceId             = 0x828D,
+               .i_IorangeBase0         = AMCC_OP_REG_SIZE,
+               .i_IorangeBase1         = APCI3120_ADDRESS_RANGE,
+               .i_IorangeBase2         = 8,
+               .i_PCIEeprom            = ADDIDATA_NO_EEPROM,
+               .i_NbrAiChannel         = 16,
+               .i_NbrAiChannelDiff     = 8,
+               .i_AiChannelList        = 16,
+               .i_AiMaxdata            = 0xfff,
+               .pr_AiRangelist         = &range_apci3120_ai,
+               .i_NbrDiChannel         = 4,
+               .i_NbrDoChannel         = 4,
+               .i_DoMaxdata            = 0x0f,
+               .i_Dma                  = 1,
+               .i_Timer                = 1,
+               .b_AvailableConvertUnit = 1,
+               .ui_MinAcquisitiontimeNs = 10000,
+               .ui_MinDelaytimeNs      = 100000,
+               .interrupt              = v_APCI3120_Interrupt,
+               .reset                  = i_APCI3120_Reset,
+               .ai_config              = i_APCI3120_InsnConfigAnalogInput,
+               .ai_read                = i_APCI3120_InsnReadAnalogInput,
+               .ai_cmdtest             = i_APCI3120_CommandTestAnalogInput,
+               .ai_cmd                 = i_APCI3120_CommandAnalogInput,
+               .ai_cancel              = i_APCI3120_StopCyclicAcquisition,
+               .di_read                = i_APCI3120_InsnReadDigitalInput,
+               .di_bits                = i_APCI3120_InsnBitsDigitalInput,
+               .do_config              = i_APCI3120_InsnConfigDigitalOutput,
+               .do_write               = i_APCI3120_InsnWriteDigitalOutput,
+               .do_bits                = i_APCI3120_InsnBitsDigitalOutput,
+               .timer_config           = i_APCI3120_InsnConfigTimer,
+               .timer_write            = i_APCI3120_InsnWriteTimer,
+               .timer_read             = i_APCI3120_InsnReadTimer,
        },
 };
 
@@ -77,6 +113,7 @@ static void __devexit apci3120_pci_remove(struct pci_dev *dev)
 
 static DEFINE_PCI_DEVICE_TABLE(apci3120_pci_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA_OLD, 0x818d) },
+       { PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA_OLD, 0x828d) },
        { 0 }
 };
 MODULE_DEVICE_TABLE(pci, apci3120_pci_table);