From 14b93bb6bbf08c5002eddda1af1916e72e542eb8 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 13 Nov 2015 12:39:26 -0700 Subject: staging: comedi: adv_pci_dio: separate out PCI-1760 support The PCI-1760 is board unique. It uses an outgoing/incoming mailbox programming sequence to access the hardware. The other boards supported by this driver use simple register mapping. Including support for the PCI-1760 in this driver just makes it harder to understand. Separate out the PCI-1760 support into a new driver, adv_pci1760. Clean up the new driver. The original code had a bunch of CamelCase and other checkpatch.pl issues. The code used to access the outgoing/incoming mailboxes was also a bit awkward with the passing of the arrays for the outgoing and incoming mailbox bytes. Replace them with two new functions that send a command and return the feedback data from the command based on the programming flow chart in the datasheet for the PCI-1760. The new adv_pci1760 driver also fixes the incomplete timer subdevice. This subdevice is actually the 2 PWM outputs so the subdevice type has been changed to COMEDI_SUBD_PWM. The counter subdevice support was not complete in the original code. They are also a bit strange since they are up counters connected to each of the digital inputs. For now that subdevice has been disabled (COMEDI_SUBD_UNUSED). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/Kconfig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/staging/comedi/Kconfig') diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig index 945c85a10793..e7255f811611 100644 --- a/drivers/staging/comedi/Kconfig +++ b/drivers/staging/comedi/Kconfig @@ -772,6 +772,14 @@ config COMEDI_ADV_PCI1724 To compile this driver as a module, choose M here: the module will be called adv_pci1724. +config COMEDI_ADV_PCI1760 + tristate "Advantech PCI-1760 support" + ---help--- + Enable support for Advantech PCI-1760 board. + + To compile this driver as a module, choose M here: the module will be + called adv_pci1760. + config COMEDI_ADV_PCI_DIO tristate "Advantech PCI DIO card support" select COMEDI_8254 @@ -779,8 +787,8 @@ config COMEDI_ADV_PCI_DIO ---help--- Enable support for Advantech PCI DIO cards PCI-1730, PCI-1733, PCI-1734, PCI-1735U, PCI-1736UP, PCI-1739U, - PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756, - PCI-1760 and PCI-1762 + PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756 and + PCI-1762 To compile this driver as a module, choose M here: the module will be called adv_pci_dio. -- cgit v1.2.3