summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
Commit message (Collapse)AuthorAgeFilesLines
* staging: comedi: change some printk calls to pr_errChase Southwood2014-12-022-8/+8
| | | | | | | | | | | There are a handful of calls to printk in ni_stc.h without specified log levels, as well as one in ni_mio_common.c. This patch converts these calls to pr_err() instead, so that they are now explicitly log level ERR. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: adl_pci9118: eliminate DMA buffer defragmentation stepIan Abbott2014-12-021-21/+46
| | | | | | | | | | | | | | | | | | The DMA operations used by the driver may have been set up to acquire data from unwanted channels in addition to the wanted channels. Currently, `interrupt_pci9118_ai_dma()` calls `defragment_dma_buffer()` to move all the wanted data to the start of the DMA buffer and then calls `comedi_buf_write_samples()` to copy it all to the comedi async buffer. Those two functions used to be called from `move_block_from_dma()` which was absorbed into `interrupt_pci9118_ai_dma()`. Reinstate `move_block_from_dma()` but rewrite it to copy data directly from the wanted fragments of the DMA buffer to the comedi async buffer without defragmenting the buffer first. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: adl_pci9118: try and avoid unnecessary DMA restartIan Abbott2014-12-021-7/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `interrupt_pci9118_ai_dma()` is called on interrupt to transfer data from DMA buffers into the comedi async data buffer. Currently it always restarts DMA. If double buffering, it restarts DMA on the next DMA buffer before processing the current DMA buffer, otherwise it restarts DMA on the same DMA buffer after it has been processed. For single buffering we can avoid restarting the DMA transfer by checking the async event flags after the current buffer has been processed, which is easy. For double buffering, we need to know how many valid samples there are in the current buffer before it has been processed and determine whether there is enough to complete the acquisition. Call new function `valid_samples_in_act_dma_buf()` to determine the number of valid samples in the current DMA buffer, and compare that with the result of `comedi_nsamples_left()` to determine if DMA needs to be restarted. (`comedi_nsamples_left()` needs an upper bound to clamp to, so use the number of valid samples in the DMA buffer plus one for our test.) It is still possible for DMA to be restarted unnecessarily in the double buffer case if a `COMEDI_CB_OVERFLOW` event occurs while copying to the comedi async buffer, but it doesn't really matter. The ongoing DMA operation will get disabled when the subdevice's `cancel()` handler is called when the events are handled later in the interrupt service routine (as it does currently). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: adl_pci9118: simplify interrupt_pci9118_ai_dma() a bitIan Abbott2014-12-021-14/+10
| | | | | | | | | | | Eliminate the `next_dma_buf` variable in `interrupt_pci9118_ai_dma()`. It holds the next value of `devpriv->dma_actbuf` when double buffering is used, but we can just set that to the next value directly at the point where the buffers are switched as the old value is not used anywhere else. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: adv_pci1723: remove comedi_device 'write_subdev' initH Hartley Sweeten2014-11-261-1/+0
| | | | | | | | | The comedi_device 'write_subdev' should only be initialized if the subdevice supports async commands. 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>
* staging: comedi: adv_pci1723: tidy up multi-line commentsH Hartley Sweeten2014-11-261-41/+38
| | | | | | | | Tidy up the multi-line comments to follow the CodingStyle. 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>
* staging: comedi: adv_pci1723: update the MODULE_DESCRIPTIONH Hartley Sweeten2014-11-261-1/+1
| | | | | | | | | Update the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver". 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>
* staging: comedi: adv_pci1723: remove subdevice 'len_chanlist' initializationH Hartley Sweeten2014-11-261-3/+1
| | | | | | | | | The subdevice 'len_chanlist' is only used by subdevices that support async commands. Remove the unnecessary initializations in this driver. 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>
* staging: comedi: adv_pci1723: tidy up DIO io_bits initializationH Hartley Sweeten2014-11-261-16/+7
| | | | | | | | | Tidy up the code that determines the initial io_bits (direction) of the digital I/O subdevice and remove the magic numbers. 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>
* staging: comedi: adv_pci1723: tidy up pci1723_dio_insn_config()H Hartley Sweeten2014-11-261-15/+6
| | | | | | | | | For aesthetics, tidy this function up and use the register defines to remove the magic numbers. 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>
* staging: comedi: adv_pci1723: use comedi_subdevice readback for 'ao_data'H Hartley Sweeten2014-11-261-39/+18
| | | | | | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only analog output subdevice. Remove the then unused 'ao_data' member from the private data. The private data is now unnecessary. Remove it and the allocation. For aesthetics, rename the (*insn_write) function and tidy it up a bit. 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>
* staging: comedi: adv_pci1723: absorb pci1723_reset()H Hartley Sweeten2014-11-261-29/+16
| | | | | | | | | | | | | This function is only called by the (*auto_attach) to reset all the analog output channels. For aesthetics, absorb the function. Fix the range programming for each channel. According to the users manual the "range strobe" register needs to be written after setting the "DAC range control" register in order to load the range setting. 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>
* staging: comedi: adv_pci1723: remove board reset during (*detach)H Hartley Sweeten2014-11-261-8/+1
| | | | | | | | | | | | | The pci1723_reset() function simply resets all the analog output channels to 0V and a +/-10V range. This really isn't necessary when detaching the driver. Remove the board reset and just use comedi_pci_detach() directly for the (*detach). 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>
* staging: comedi: adv_pci1723: remove private data 'da_range'H Hartley Sweeten2014-11-261-3/+1
| | | | | | | | | | | This member of the private data is initialized to 0 by pci1723_reset() and is not used any where else in the driver. Remove it. Use the register map defines to set the range for each output channel. 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>
* staging: comedi: adv_pci1723: tidy up register mapH Hartley Sweeten2014-11-261-69/+48
| | | | | | | | | For aesthetics, rename the defines used for the register map offsets and remove the unnecessary comments. Add the bit defines for the registers. 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>
* staging: comedi: ni_labpc_common: use comedi_timeout() when writing to eepromH Hartley Sweeten2014-11-261-19/+18
| | | | | | | | | Use the comedi_timeout() helper to wait for the eeprom to be ready to accept writes and remove the timeout loop in labpc_eeprom_write(). 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>
* staging: comedi: ni_labpc_common: use subdevice readback for eepromH Hartley Sweeten2014-11-262-22/+10
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the eeprom subdevice. Remove the then unused 'eeprom_data' member from the private data. 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>
* staging: comedi: ni_labpc_common: use subdevice readback for analog outputsH Hartley Sweeten2014-11-262-16/+5
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the analog output subdevice. Remove the then unused 'ao_value' member from the private data. 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>
* staging: comedi: ni_labpc_common: introduce labpc_ao_write()H Hartley Sweeten2014-11-261-17/+15
| | | | | | | | Introduce a helper function to write a value to a given DAC channel. 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>
* staging: comedi: ni_labpc_common: use subdevice readback for 'caldac'H Hartley Sweeten2014-11-262-22/+7
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac' member from the private data. 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>
* staging: comedi: ni_labpc_common: move calib readback value check/save to ↵H Hartley Sweeten2014-11-261-7/+12
| | | | | | | | | | (*insn_write) Move the check/save of the calib subdevice value to the (*insn_write) 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>
* staging: comedi: ni_at_ao: use subdevice readback for 'caldac'H Hartley Sweeten2014-11-261-34/+21
| | | | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac' member from the private data. Tidy up atao_calib_insn_write(). 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>
* staging: comedi: cb_pcidas: use subdevice readback for 'dac08_value'H Hartley Sweeten2014-11-261-19/+13
| | | | | | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only dac08 calib subdevice. Remove the then unused 'dac08_value' member from the private data. The dac08 calib subdevice only has one channel. For consistency in the driver, modify the subdevice init so that a loop is used to initialize the channels and readback values. 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>
* staging: comedi: cb_pcidas: tidy up dac08_write_insn()H Hartley Sweeten2014-11-261-23/+25
| | | | | | | | | | | | For consistency with the other calib subdevices, refactor this (*insn_write) function so that it only writes the final data value to the hardware., For aesthetics, rename the function so it has namespace associated with the driver. 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>
* staging: comedi: cb_pcidas: use subdevice readback for 'trimpot_value'H Hartley Sweeten2014-11-261-18/+8
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only trimpot calib subdevice. Remove the then unused 'trimpot_value' member from the private data. 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>
* staging: comedi: cb_pcidas: fix trimpot_write_insn()H Hartley Sweeten2014-11-261-19/+25
| | | | | | | | | | | | | | The comedi core expects the (*insn_write) functions to write 'insn->n' values to the hardware and return the number of values written. Currently this function only writes the first value. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. 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>
* staging: comedi: cb_pcidas: use subdevice readback for 'caldac_value'H Hartley Sweeten2014-11-261-17/+8
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only caldac subdevice. Remove the then unused 'caldac_value' member from the private data. 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>
* staging: comedi: cb_pcidas: fix caldac_write_insn()H Hartley Sweeten2014-11-261-17/+23
| | | | | | | | | | | | | | The comedi core expects the (*insn_write) functions to write 'insn->n' values to the hardware and return the number of values written. Currently this function only writes the first value. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. 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>
* staging: comedi: cb_pcidas: remove unnecessary check in caldac_8800_write()H Hartley Sweeten2014-11-261-6/+0
| | | | | | | | | | The 'address' passed to this function is actually the comedi channel. This value will always be less than the subdevice n_chan (which is 8). Remove the unnecessary sanity check in caldac_8800_write(). 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>
* staging: comedi: cb_pcidas64: fix ad8402_write_insn()H Hartley Sweeten2014-11-261-13/+18
| | | | | | | | | | | | | | The comedi core expects the (*insn_write) functions to write 'insn->n' values to the hardware and return the number of values written. Currently this function only writes the first value. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. 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>
* staging: comedi: cb_pcidas64: use subdevice readback for 'ad8402_state'H Hartley Sweeten2014-11-261-22/+11
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'ad8402_state' member from the private data. 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>
* staging: comedi: cb_pcidas64: fix calib_write_insn()H Hartley Sweeten2014-11-261-12/+18
| | | | | | | | | | | | | | The comedi core expects the (*insn_write) functions to write 'insn->n' values to the hardware and return the number of values written. Currently this function only writes the first value. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the function so it has namespace associated with the driver. 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>
* staging: comedi: cb_pcidas64: use subdevice readback for 'caldac_state'H Hartley Sweeten2014-11-261-20/+10
| | | | | | | | | | Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'caldac_state' member from the private data. 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>
* staging: comedi: drivers: have core hook up default (*insn_read) for readbackH Hartley Sweeten2014-11-2645-44/+4
| | | | | | | | | | | | | | | 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>
* staging: comedi: adv_pci1724: rename ao_ranges_1724H Hartley Sweeten2014-11-261-2/+2
| | | | | | | | | For aesthetics, rename the analog output comedi_lrange table so it has namespace associated with the driver. 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>
* staging: comedi: adv_pci1724: tidy up multi-line commentsH Hartley Sweeten2014-11-261-50/+44
| | | | | | | | Tidy up the multi-line comments to follow the CodingStyle. 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>
* staging: comedi: adv_pci1724: tidy up the comedi_driver declarationH Hartley Sweeten2014-11-261-4/+4
| | | | | | | | For aesthetics, add some whitespace to the comedi_driver declaration. 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>
* staging: comedi: adv_pci1724: tidy up the pci_driver declarationH Hartley Sweeten2014-11-261-5/+4
| | | | | | | | For aesthetics, add some whitespace to the pci_driver declaration. 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>
* staging: comedi: adv_pci1724: remove unnecessary dev_info()H Hartley Sweeten2014-11-261-2/+0
| | | | | | | | Remove the unnecessary noise at the end of the (*auto_attach). 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>
* staging: comedi: adv_pci1724: absorb setup_subdevices()H Hartley Sweeten2014-11-261-48/+35
| | | | | | | | | | For aesthetics, absorb this function into the (*auto_attach). Add some whitespace to the subdevice init. 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>
* staging: comedi: adv_pci1724: define the board id register bitsH Hartley Sweeten2014-11-261-6/+4
| | | | | | | | For aesthetics, remove the enum and define the bits for this register. 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>
* staging: comedi: adv_pci1724: remove enum sync_output_trigger_contentsH Hartley Sweeten2014-11-261-5/+1
| | | | | | | | | | | This enum is not used in the driver. Remove it. For aesthetics, rename the register define and move the comment that any value will trigger the sync output. 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>
* staging: comedi: adv_pci1724: define the sync output control/status regH Hartley Sweeten2014-11-261-9/+6
| | | | | | | | | Define the bits for the synchronous output control/status register and remove the enum. 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>
* staging: comedi: adv_pci1724: define the dac control register bitsH Hartley Sweeten2014-11-261-40/+15
| | | | | | | | | | | | Define the bits for the DAC control register and remove the enum along with the helper functions. Simplify adv_pci1724_insn_write() a bit. The 'ctrl' bits are based on the 'chan' and 'mode' and do not need to be recalculated for each 'val'. 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>
* staging: comedi: adv_pci1724: tidy up the register I/O mapH Hartley Sweeten2014-11-261-12/+12
| | | | | | | | | For aesthetics, convert the enum board_registers into defines and rename them so they have namespace associated with the driver. 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>
* staging: comedi: adv_pci1724: remove PCI_VENDOR_ID_ADVANTECH defineH Hartley Sweeten2014-11-261-2/+0
| | | | | | | | This define is already in pci_ids.h. Remove the duplicate in this driver. 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>
* staging: comedi: adv_pci1724: absorb set_dac()H Hartley Sweeten2014-11-261-15/+5
| | | | | | | | Absorb this simple function into adv_pci1724_insn_write(). 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>
* staging: comedi: adv_pci1724: use comedi_timeout() to wait for DAC idle stateH Hartley Sweeten2014-11-261-20/+13
| | | | | | | | | Use the comedi_timeout() helper to wait for the DAC to be idle before writing to 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>
* staging: comedi: adv_pci1724: introduce adv_pci1724_insn_write()H Hartley Sweeten2014-11-261-50/+18
| | | | | | | | | | | | | | The analog output, offset calib, and gain calib subdevices all use similar (*insn_write) functions. The onyl difference is the 'mode' that is passed to the set_dac() helper. Introduce a new (*insn_write) function that can be used by all the subdevices. Use the s->private member to pass the 'mode' needed by set_dac(). Remove the subdevice specific (*insn_write) functions. 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>
* staging: comedi: adv_pci1724: remove NUM_AO_CHANNELS defineH Hartley Sweeten2014-11-261-5/+3
| | | | | | | | | This define is now only used to set each of the subdevice 'n_chan'. For clarity, remove the define and open code the values. 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>
OpenPOWER on IntegriCloud