summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/mf6x4.c
AgeCommit message (Collapse)Author
2015-10-12staging: comedi: mf6x4: tidy up subdevice initH Hartley Sweeten
For aesthetics, add some whitespace to the subdevice initialization. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: change type of local variableH Hartley Sweeten
For aesthetics, change the type of this local variable to unsigned int. This fixes the checkpatch.pl issue about: CHECK: Prefer kernel type 'u32' over 'uint32_t' Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 60 +++++++++++++++++----------------- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: refactor block commentH Hartley Sweeten
Refactor this block comment to fix the checkpatch.pl issues: WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 2 +- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: rename private data 'gpio_R'H Hartley Sweeten
Rename this CamelCase member of the private data. For consistency, also rename the register defines associated with this member. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 4 ++-- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: rename remaining BAR1 register definesH Hartley Sweeten
For consistency, rename the ADSTART and DAC register defines to add a bit of clarity. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 16 ++++++++-------- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: rename the digital input register definesH Hartley Sweeten
For aesthetics, rename these defines to clarify them a bit. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 8 ++++---- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: remove unnecassary masking of digital outputsH Hartley Sweeten
THe 's->state' will always be in range for the 8 digital outputs. Remove the unnecessary masking of the value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 6 +++--- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: A/D converter uses 2's complement codingH Hartley Sweeten
According to the user's manual, the A/D converter uses 2's complement coding. Use the comedi_offset_munge() helper to convert the data to the offset binary format used by comedi. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 5 ++--- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: introduce a macro to select the AI channelH Hartley Sweeten
For aesthetics, use a macro to set the bit in the ADCTRL register that selects an analog input channel. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 9 +++++---- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: sort the BAR1 register definesH Hartley Sweeten
For aesthetics, sort the defines in register order. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 10 +++++----- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: remove unnecessary whitespaceH Hartley Sweeten
For aesthetics, remove the extra whitespace and align all the register defines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 8 +++----- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: remove unnecessary definesH Hartley Sweeten
The MF6X4_DAC_R macro defines the offsets for all the DAC registers. Remove the unnecessary defines for each register. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 22 +++++++++++----------- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: comedi: mf6x4: prefer using the BIT macroH Hartley Sweeten
Fix the checkpatch.pl issues. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> drivers/staging/comedi/drivers/mf6x4.c | 9 --------- Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging: comedi: mf6x4: include new "comedi_pci.h" headerIan Abbott
Include the new "../comedi_pci.h" header instead of <linux/pci.h> and "../comedidev.h", which will now get included indirectly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: comedi: drivers/*.c: remove unnecessary blank linesH Hartley Sweeten
Blank lines are not needed before a close brace '}' or after an open brace '{'. Also remove any multiple blank lines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09staging: comedi: mf6x4: rewrite "Devices:" lineIan Abbott
Rewrite the "Devices:" line in the comedi "driver" comment to conform to the usual comedi format for this line. The line should be a comma-separated list where the first item is in the following format: [Manufacturer] BOARD-NAME (comedi-board-name) The "[Manufacturer]" and/or "(comedi-board-name)" parts may be omitted from following items, in which case the parts from the preceding item are used. The "Devices:" line may be continued continued over several lines by using one or more spaces at the start of each continuation line (not counting the space after the "*" in the block comment). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: comedi: drivers: have core hook up default (*insn_read) for readbackH Hartley Sweeten
Most of the comedi drivers that provide readback for write only subdevices now use the comedi core comedi_alloc_subdev_readback() helper to allocate the subdevice 'reaback' member instead of using some member in their private data. These drivers also hook up the (*insn_read) callback to the comedi_readback_insn_read() helper to provide the readback. Have the core automatically hook up the (*insn_read) callback after allocating the memory if the driver has not already hooked it up to a private function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: comedi: comedi_pci: introduce comedi_pci_detach()H Hartley Sweeten
Introduce a generic (*detach) function for comedi PCI drivers to handle the boilerplate code needed to detach a PCI driver. This function works similar to comedi_legacy_detach() where it will: * free the dev->irq if it has been requested * iounmap the dev->mmio addres if it has been ioremap'ed The helper then calls comedi_pci_disable() to release the regions and disable the PCI device. Use the new helper directly for the (*detach) in the following cases: * where comedi_pci_disable() is used directly for the (*detach) * where the detach function is just boilerplate Use the new helper in the (*detach) of the simpler PCI drivers. Call the helper after disabling interrupts (reset) and before any additional cleanup (kfree) to avoid any race conditions with the interrupt handler. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: comedi: mf6x4: use comedi_subdevice 'readback'H Hartley Sweeten
Use the new comedi_subdevice 'readback' member and the core provided (*insn_read) for the readback of the analog output subdevice channels. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: comedi: mf6x4: analog output data does not need extra maskingH Hartley Sweeten
The comedi core validates that all the data values are <= s->maxdata before calling the (*insn_write) function. The extra masking is not needed. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-30staging: comedi: mf6x4: use the comedi_device 'mmio' memberH Hartley Sweeten
Use the new 'mmio' member in the comedi_device for the ioremap'ed base address. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-14staging: comedi: mf6x4: use comedi_timeout()H Hartley Sweeten
Use comedi_timeout() to wait for the analog input end-of-conversion. 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>
2014-01-13comedi: Humusoft MF634 and MF624 DAQ cards driverRostislav Lisovy
This patch adds Comedi driver for Humusoft MF634 (PCIe) and MF624 (PCI) data acquisition cards. The legacy card Humusoft MF614 is not supported. More info about the cards may be found at http://humusoft.cz/produkty/datacq/ The driver was tested with both cards. Everything seems to work properly. Just the basic functionality of the card (DIO, ADC, DAC) is supported by this driver. Signed-off-by: Rostislav Lisovy <lisovy@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>