aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-26staging: comedi: adv_pci1723: tidy up DIO io_bits initializationH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: tidy up pci1723_dio_insn_config()H Hartley Sweeten1-15/+6
For aesthetics, tidy this function up and use the register defines to remove the magic numbers. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: use comedi_subdevice readback for 'ao_data'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: absorb pci1723_reset()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: remove board reset during (*detach)H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: remove private data 'da_range'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1723: tidy up register mapH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: use comedi_timeout() when writing to eepromH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: use subdevice readback for eepromH Hartley Sweeten2-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: use subdevice readback for analog outputsH Hartley Sweeten2-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: introduce labpc_ao_write()H Hartley Sweeten1-17/+15
Introduce a helper function to write a value to a given DAC channel. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: use subdevice readback for 'caldac'H Hartley Sweeten2-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_labpc_common: move calib readback value check/save to ↵H Hartley Sweeten1-7/+12
(*insn_write) Move the check/save of the calib subdevice value to the (*insn_write) function. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: ni_at_ao: use subdevice readback for 'caldac'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: use subdevice readback for 'dac08_value'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: tidy up dac08_write_insn()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: use subdevice readback for 'trimpot_value'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: fix trimpot_write_insn()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: use subdevice readback for 'caldac_value'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: fix caldac_write_insn()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas: remove unnecessary check in caldac_8800_write()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas64: fix ad8402_write_insn()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas64: use subdevice readback for 'ad8402_state'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas64: fix calib_write_insn()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: cb_pcidas64: use subdevice readback for 'caldac_state'H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: drivers: have core hook up default (*insn_read) for readbackH Hartley Sweeten45-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: rename ao_ranges_1724H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: tidy up multi-line commentsH Hartley Sweeten1-50/+44
Tidy up the multi-line comments to follow the CodingStyle. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: tidy up the comedi_driver declarationH Hartley Sweeten1-4/+4
For aesthetics, add some whitespace to the comedi_driver declaration. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: tidy up the pci_driver declarationH Hartley Sweeten1-5/+4
For aesthetics, add some whitespace to the pci_driver declaration. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: remove unnecessary dev_info()H Hartley Sweeten1-2/+0
Remove the unnecessary noise at the end of the (*auto_attach). Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: absorb setup_subdevices()H Hartley Sweeten1-48/+35
For aesthetics, absorb this function into the (*auto_attach). Add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: define the board id register bitsH Hartley Sweeten1-6/+4
For aesthetics, remove the enum and define the bits for this register. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: remove enum sync_output_trigger_contentsH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: define the sync output control/status regH Hartley Sweeten1-9/+6
Define the bits for the synchronous output control/status register and remove the enum. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: define the dac control register bitsH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: tidy up the register I/O mapH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: remove PCI_VENDOR_ID_ADVANTECH defineH Hartley Sweeten1-2/+0
This define is already in pci_ids.h. Remove the duplicate in this driver. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: absorb set_dac()H Hartley Sweeten1-15/+5
Absorb this simple function into adv_pci1724_insn_write(). Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: use comedi_timeout() to wait for DAC idle stateH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: introduce adv_pci1724_insn_write()H Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: remove NUM_AO_CHANNELS defineH Hartley Sweeten1-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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: use subdevice readback for 'gain_value'H Hartley Sweeten1-40/+6
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only gain calib subdevice. Remove the then unused 'gain_value' member from the private data. The private data is now unnecessary. Remove it and the allocation. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: use subdevice readback for 'offset_value'H Hartley Sweeten1-25/+6
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only offset calib subdevice. Remove the then unused 'offset_value' member from the private data. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: adv_pci1724: use subdevice readback for 'ao_value'H Hartley Sweeten1-24/+5
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_value' member from the private data. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: me4000: Fixed code style issueMarcus Hufvudsson1-1/+1
Fixed checkpatch.pl error message. Space prohibited before that ',' Signed-off-by: Marcus Hufvudsson <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: das6402: add (*do_cmd) for AI async commandsH Hartley Sweeten1-1/+19
Flesh out the (*do_cmd) function to support timed analog input acquisitions. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: das6402: read analog input samples in interrupt handlerH Hartley Sweeten1-7/+35
Currently the interrupt handler just clears the interrupt. Add the code necessary to read the analog input samples when running an async command. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: das6402: introduce das6402_ai_set_mode()H Hartley Sweeten1-11/+20
Introduce a helper function to set the analog input acquisition mode. This will be needed when the (*do_cmd) function is completed to support async commands. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-11-26staging: comedi: das6402: add basic (*do_cmdtest) for AI async commandsH Hartley Sweeten1-1/+104
Currently the async command support in this driver consists of just the stubbed in functions. Flesh out the (*do_cmdtest) function for basic support of timed analog input acquisitions. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>