From 973781a821fe537ef1cb8ef227266faeed094ef6 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 1 Nov 2012 17:24:06 -0700 Subject: [PATCH] staging: comedi: addi_apci_3120: merge in addi_apci_3001 driver 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/Kconfig | 14 +-- drivers/staging/comedi/drivers/Makefile | 1 - .../staging/comedi/drivers/addi_apci_3001.c | 88 ------------------- .../staging/comedi/drivers/addi_apci_3120.c | 37 ++++++++ 4 files changed, 39 insertions(+), 101 deletions(-) delete mode 100644 drivers/staging/comedi/drivers/addi_apci_3001.c diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig index 21a6748d7adc..6246bed00ef1 100644 --- a/drivers/staging/comedi/Kconfig +++ b/drivers/staging/comedi/Kconfig @@ -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. diff --git a/drivers/staging/comedi/drivers/Makefile b/drivers/staging/comedi/drivers/Makefile index a2787c0ca327..c784bedb9110 100644 --- a/drivers/staging/comedi/drivers/Makefile +++ b/drivers/staging/comedi/drivers/Makefile @@ -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 index 90506a3d1dc4..000000000000 --- a/drivers/staging/comedi/drivers/addi_apci_3001.c +++ /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"); diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index 5db6bfc0e225..979b8a9703ad 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -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); -- 2.39.5