Skip to content

Commit 14b93bb

Browse files
bigguinessgregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7cf8e59 commit 14b93bb

File tree

4 files changed

+445
-426
lines changed

4 files changed

+445
-426
lines changed

drivers/staging/comedi/Kconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,23 @@ config COMEDI_ADV_PCI1724
772772
To compile this driver as a module, choose M here: the module will be
773773
called adv_pci1724.
774774

775+
config COMEDI_ADV_PCI1760
776+
tristate "Advantech PCI-1760 support"
777+
---help---
778+
Enable support for Advantech PCI-1760 board.
779+
780+
To compile this driver as a module, choose M here: the module will be
781+
called adv_pci1760.
782+
775783
config COMEDI_ADV_PCI_DIO
776784
tristate "Advantech PCI DIO card support"
777785
select COMEDI_8254
778786
select COMEDI_8255
779787
---help---
780788
Enable support for Advantech PCI DIO cards
781789
PCI-1730, PCI-1733, PCI-1734, PCI-1735U, PCI-1736UP, PCI-1739U,
782-
PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756,
783-
PCI-1760 and PCI-1762
790+
PCI-1750, PCI-1751, PCI-1752, PCI-1753/E, PCI-1754, PCI-1756 and
791+
PCI-1762
784792

785793
To compile this driver as a module, choose M here: the module will be
786794
called adv_pci_dio.

drivers/staging/comedi/drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ obj-$(CONFIG_COMEDI_ADV_PCI1710) += adv_pci1710.o
8181
obj-$(CONFIG_COMEDI_ADV_PCI1720) += adv_pci1720.o
8282
obj-$(CONFIG_COMEDI_ADV_PCI1723) += adv_pci1723.o
8383
obj-$(CONFIG_COMEDI_ADV_PCI1724) += adv_pci1724.o
84+
obj-$(CONFIG_COMEDI_ADV_PCI1760) += adv_pci1760.o
8485
obj-$(CONFIG_COMEDI_ADV_PCI_DIO) += adv_pci_dio.o
8586
obj-$(CONFIG_COMEDI_AMPLC_DIO200_PCI) += amplc_dio200_pci.o
8687
obj-$(CONFIG_COMEDI_AMPLC_PC236_PCI) += amplc_pci236.o

0 commit comments

Comments
 (0)