Commit 2a366e7b authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: addi_apci_1516: merge in addi_apci_2016 driver

The low-level hardware support code for these drivers, hwdrv_apci1516.c
and hwdrv_apci2016.c, is identical. Both of these boards are 16 channel
dio boards. The 1516 board has 8 input/8 output channels and the 2016
has 16 output channels.

To ease maintainability, merge the boardinfo and pci device information
from the addi_apci_2016 driver into the addi_apci_1516 driver and modify
the Kconfig and Makefile appropriately.

This allows deleting the addi_apci_2016.c and hwdrv_apci2016.c files.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 848ce511
......@@ -594,10 +594,10 @@ config COMEDI_ADDI_APCI_1500
called addi_apci_1500.
config COMEDI_ADDI_APCI_1516
tristate "ADDI-DATA APCI_1516 support"
tristate "ADDI-DATA APCI-1516/2016 support"
depends on VIRT_TO_BUS
---help---
Enable support for ADDI-DATA APCI_1516 cards
Enable support for ADDI-DATA APCI-1516 and APCI-2016 boards.
To compile this driver as a module, choose M here: the module will be
called addi_apci_1516.
......@@ -620,15 +620,6 @@ config COMEDI_ADDI_APCI_16XX
To compile this driver as a module, choose M here: the module will be
called addi_apci_16xx.
config COMEDI_ADDI_APCI_2016
tristate "ADDI-DATA APCI_2016 support"
depends on VIRT_TO_BUS
---help---
Enable support for ADDI-DATA APCI_2016 cards
To compile this driver as a module, choose M here: the module will be
called addi_apci_2016.
config COMEDI_ADDI_APCI_2032
tristate "ADDI-DATA APCI_2032 support"
depends on VIRT_TO_BUS
......
......@@ -62,7 +62,6 @@ obj-$(CONFIG_COMEDI_ADDI_APCI_1500) += addi_apci_1500.o
obj-$(CONFIG_COMEDI_ADDI_APCI_1516) += addi_apci_1516.o
obj-$(CONFIG_COMEDI_ADDI_APCI_1564) += addi_apci_1564.o
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_3120) += addi_apci_3120.o
......
......@@ -27,6 +27,22 @@ static const struct addi_board apci1516_boardtypes[] = {
.timer_config = i_APCI1516_ConfigWatchdog,
.timer_write = i_APCI1516_StartStopWriteWatchdog,
.timer_read = i_APCI1516_ReadWatchdog,
}, {
.pc_DriverName = "apci2016",
.i_VendorId = PCI_VENDOR_ID_ADDIDATA,
.i_DeviceId = 0x1002,
.i_IorangeBase0 = 128,
.i_IorangeBase1 = APCI1516_ADDRESS_RANGE,
.i_IorangeBase2 = 32,
.i_PCIEeprom = ADDIDATA_EEPROM,
.pc_EepromChip = ADDIDATA_S5920,
.i_NbrDoChannel = 16,
.i_Timer = 1,
.reset = i_APCI1516_Reset,
.do_bits = apci1516_do_insn_bits,
.timer_config = i_APCI1516_ConfigWatchdog,
.timer_write = i_APCI1516_StartStopWriteWatchdog,
.timer_read = i_APCI1516_ReadWatchdog,
},
};
......@@ -53,6 +69,7 @@ static void __devexit apci1516_pci_remove(struct pci_dev *dev)
static DEFINE_PCI_DEVICE_TABLE(apci1516_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1001) },
{ PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1002) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, apci1516_pci_table);
......
#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_apci2016.c"
#include "addi-data/addi_common.c"
static const struct addi_board apci2016_boardtypes[] = {
{
.pc_DriverName = "apci2016",
.i_VendorId = PCI_VENDOR_ID_ADDIDATA,
.i_DeviceId = 0x1002,
.i_IorangeBase0 = 128,
.i_IorangeBase1 = APCI2016_ADDRESS_RANGE,
.i_IorangeBase2 = 32,
.i_PCIEeprom = ADDIDATA_EEPROM,
.pc_EepromChip = ADDIDATA_S5920,
.i_NbrDoChannel = 16,
.i_Timer = 1,
.reset = i_APCI2016_Reset,
.do_bits = apci2016_do_insn_bits,
.timer_config = i_APCI2016_ConfigWatchdog,
.timer_write = i_APCI2016_StartStopWriteWatchdog,
.timer_read = i_APCI2016_ReadWatchdog,
},
};
static struct comedi_driver apci2016_driver = {
.driver_name = "addi_apci_2016",
.module = THIS_MODULE,
.auto_attach = addi_auto_attach,
.detach = i_ADDI_Detach,
.num_names = ARRAY_SIZE(apci2016_boardtypes),
.board_name = &apci2016_boardtypes[0].pc_DriverName,
.offset = sizeof(struct addi_board),
};
static int __devinit apci2016_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
return comedi_pci_auto_config(dev, &apci2016_driver);
}
static void __devexit apci2016_pci_remove(struct pci_dev *dev)
{
comedi_pci_auto_unconfig(dev);
}
static DEFINE_PCI_DEVICE_TABLE(apci2016_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_ADDIDATA, 0x1002) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, apci2016_pci_table);
static struct pci_driver apci2016_pci_driver = {
.name = "addi_apci_2016",
.id_table = apci2016_pci_table,
.probe = apci2016_pci_probe,
.remove = __devexit_p(apci2016_pci_remove),
};
module_comedi_pci_driver(apci2016_driver, apci2016_pci_driver);
MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver");
MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment