summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)Author
2015-01-28staging: comedi: 8253.h: use usual style for single-line commentsIan Abbott
Use one space after the opening and one space before the closing of the 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>
2015-01-28staging: comedi: 8253.h: reformat other block commentsIan Abbott
Use the usual block comment style. 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-01-28staging: comedi: 8253.h: reformat copyright commentIan Abbott
Use the usual block comment style. 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-01-28staging: comedi: das16: introduce das16_ai_set_mux_range()H Hartley Sweeten
Introduce a helper function to program the mux and gain for analog input single channel (*insn_read) and multi-channel (*do_cmd) operations. 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-28staging: comedi: das16: fix DMA size for short transfersH Hartley Sweeten
Currently this driver alwasy programs the DMA transfer to be the allocated size of the DMA buffer. When the async command 'stop_src' is TRIG_COUNT its possible (likely) for the last transfer to be less than the buffer size. Introduce a helper function, das16_ai_setup_dma(), to calculate the actual size of the DMA transfer based on the number of samples remaining and the number of unread samples. 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-28staging: comedi: das16: use comedi_async 'scans_done' to detect EOAH Hartley Sweeten
Refactor das16_interrupt() to use the comedi_async 'scans_done' member to detect the End-of-Acquisition for the async command. Use the helper function comedi_nsamples_left() to determine if DMA needs to be restarted. This allows the removal of the private data 'adc_byte_count' and fixes a possible integer overflow issue when that value is calculated. 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-28staging: comedi: das16: change type of private data 'timer_running'H Hartley Sweeten
This member of the private data is a true/false flag. For aesthetics, change the type to an unsigned int bit-field to save a bit of space. 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-28staging: comedi: das16: introduce das16_ao_range()H Hartley Sweeten
Clarify the (*attach) a bit by introducing a helper function to handle the setup of the analog output 'range_table'. Some of the boards supported by this driver do not have programmable ranges. The analog output subdevice can use optional range information provided by the user during the attach of the driver. Currently this range data is allocated and stored in the private data. Use the subdevice private data member instead and allocate the memory with comedi_alloc_spriv(). The comedi core will automatically free this memory when the driver is detached. If the allocation fails set the 'range_table' to 'range_unknown' instead of failing the driver 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>
2015-01-28staging: comedi: das16: introduce das16_ai_range()H Hartley Sweeten
Clarify the (*attach) a bit by introducing a helper function to handle the setup of the analog input 'range_table'. Some of the boards supported by this driver do not have programmable ranges. The analog input subdevice can use optional range information provided by the user during the attach of the driver. Currently this range data is allocated and stored in the private data. Use the subdevice private data member instead and allocate the memory with comedi_alloc_spriv(). The comedi core will automatically free this memory when the driver is detached. If the allocation fails set the 'range_table' to 'range_unknown' instead of failing the driver 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>
2015-01-28staging: comedi: das16: absorb das16_ai_disable()H Hartley Sweeten
This function is only called by das16_cancel(). Absorb it to clarify code. 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-28staging: comedi: das16: remove unnecessary das16_ai_disable()H Hartley Sweeten
The das16_ai_disable() function disables interrupts and the pacer clock. This function is called by the subdevice (*cancel) operation. The comedi core will not call a subdevice (*insn_read) operation while an async command is running due to the s->busy check in parse_insn(). Since all async commands are terminated by a (*cancel), the das16_ai_disable() is not necessary in das16_ai_insn_read(). 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>
2015-01-28staging: comedi: das16: absorb das16_ai_enable()H Hartley Sweeten
This function is only called by das16_cmd_exec(). Absorb it to clarify code. 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-25Staging: comedi: fix line over 80 characters warningjitendra kumar khasdev
This is patch to file jr3_pci.h that fix up warning line over 80 character which is found by checkpatch tool. Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25staging: comedi: vmk80xx: tidy up vmk80xx_cnt_insn_config()H Hartley Sweeten
Tidy up this (*insn_config) function to follow the normal format in comedi drivers. INSN_CONFIG_RESET instructions do not have any extra parameters (insn->n is always 1) so the for loop used to write the packet doesn't make any sense. Remove it and just write the single packet. 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-25staging: comedi: vmk80xx: GPCT_RESET is not an (*insn_config) instructionH Hartley Sweeten
The data[0] parameter to (*insn_config) functions is the "configuration instruction" that should be handled. These are defined by the enum configuration_ids in comedi.h. This driver is currently checking the data[0] value to be INSN_CONFIG_RESET or GPCT_RESET in order to reset a counter channel. GPCT_RESET is defined as 0x0001 which would match the configuration instruction INSN_CONFIG_DIO_OUTPUT. That doesn't make any sense for a counter. Remove GPCT_RESET from the insn_cmd test. 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-25staging: comedi: ni_labpc_common: use the cfc_check_trigger_arg_*() helpersH Hartley Sweeten
For aesthetics, use the helper functions to check the min/max divisor values. Remove the const int local variables 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>
2015-01-25staging: comedi: ni_labpc_common: use DIV_ROUND_CLOSEST to round divisor valuesH Hartley Sweeten
Use the DIV_ROUND_CLOSEST macro to clarify the (((x) + ((divisor) / 2)) / (divisor)) calculations. 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-25staging: comedi: ni_labpc_common: use DIV_ROUND_UP to round divisor valuesH Hartley Sweeten
Use the DIV_ROUND_UP macro to clarify the (((n) + (d) - 1) / (d)) calculations. 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-25staging: comedi: ni_labpc: remove unnecessary private data validationH Hartley Sweeten
The labpc_free_dma_chan() function validates the private data. Remove the unnecessary validation in labpc_datach(). 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-25staging: comedi: ni_labpc_cs: remove unnecessary includesH Hartley Sweeten
This driver includes a number of unnecessary headers. Remove them. 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-25staging: comedi: ni_labpc_common: move comedi_alloc_devpriv() to common codeH Hartley Sweeten
The ni_labpc_common module is used by the ni_labpc, ni_labpc_pci, and ni_labpc_cs drivers to provide the common code support. Those drivers currently all call comedi_alloc_devpriv() to allocate the private data before calling the common attach function. For aesthetics, move the private data allocation into the common code. 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-25staging: comedi: adv_pci1710: absorb move_block_from_fifo()H Hartley Sweeten
This function is only called by pci1710_handle_fifo(). Absorb it and clean up pci1710_handle_fifo(). 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-25staging: comedi: adv_pci1710: transfer all ai samples in one stepH Hartley Sweeten
The two step process to transfer the ai samples in pci1710_handle_fifo() doesn't make any sense. If the async buffer does not have enough room for the samples the core will set the async event COMEDI_CB_OVERFLOW which will cause the async command to cancel. Splitting the transfer doesn't add any value. Transfer all the samples in one step to simplify the code. 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-25staging: comedi: adv_pci1710: remove 'turn' param from move_block_from_fifo()H Hartley Sweeten
This parameter is not used in the function. It was only used in some debug messages that were previously removed. Remove the parameter. 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-25staging: comedi: adv_pci1710: do comedi_handle_events() in common code patchH Hartley Sweeten
The pci1710_handle_every_sample() and pci1710_handle_fifo() helpers, called by the interrupt handler, both have multiple comedi_handle_events() calls. Remove these and just do a single comedi_handle_events() at the end of 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>
2015-01-25staging: comedi: adv_pci1710: introduce pci171x_ai_read_sample()H Hartley Sweeten
Introduce a helper function to read an analog input sample, check for channel dropout, and mask the sample to the maxdata of the subdevice. 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-25staging: comedi: adv_pci1710: tidy up setup_channel_list()H Hartley Sweeten
Rename this function so it has namespace associated with the driver. Tidy up the code to clarify the function. Remove the unnecessary static const array muxonechan[]. 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-25staging: comedi: adv_pci1710: clarify the 'act_chanlist'H Hartley Sweeten
This driver saves the channel list of a scan in the private data and uses that list to check analog input samples for data dropout. Currently the channel numbers are shifted 12 bits so that they match the channel number in the samples that are read from the board. All of the shifts make the driver a bit harder to follow. Store the channel numbers directly to the 'act_chanlist' and shift the sample value instead when checking for the dropout. Add a comment for clarity. 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-25staging: comedi: adv_pci1710: refactor boardinfo 'cardtype'H Hartley Sweeten
The 'cardtype' in the boardinfo is only used to: 1) determine if the board is a pci1720 during the attach of the driver and when reseting the board 2) determine is the board is not a pci1713 when checking for analog input data dropout There is also an unnecessary use of the 'cardtype' when canceling an analog input async command. Remove the 'cardtype' member and add two bit-field flags, 'is_pci1713' and 'is_pci1720'. Refactor the driver to use the new flags. Remove the unnecessary cardtype handling in pci171x_ai_cancel(). 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-25staging: comedi: adv_pci1710: remove boardinfo 'rangelist_ao'H Hartley Sweeten
This boardinfo is not necessary. All the boards with analog outputs have the same range options except for the pci1720 board. That board type is already handled specially during the driver attach. Remove the boardinfo and add the subdevice range_table initialization in the cardtype switch. Rename the range tables to clarify that they are "analog output" ranges. 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-25staging: comedi: adv_pci1710: update the MODULE_DESCRIPTIONH Hartley Sweeten
Change 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>
2015-01-25staging: comedi: adv_pci1710: remove function separation commentsH Hartley Sweeten
Remove the remaining, unnecessary, function separation comments. 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-25staging: comedi: adv_pci1710: rename 'this_board' local variablesH Hartley Sweeten
For aesthetics, rename all the 'this_board' local variables to simply 'board'. That's more common in comed drivers. 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-25staging: comedi: adv_pci1710: tidy up analog input subdevice initH Hartley Sweeten
For aesthetics, add some whitespace to the analog input subdevice init and rename the (*insn_read) support function. Also remove the unnecessary comments. 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-25staging: comedi: adv_pci1710: tidy up analog output subdevice initH Hartley Sweeten
For aesthetics, add some whitespace to the analog output 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>
2015-01-25staging: comedi: adv_pci1710: tidy up digital input and output subdevice initH Hartley Sweeten
For aesthetics, add some whitespace to the digital input and output subdevice init and rename the support functions. Also remove the unnecessary comment. 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-25staging: comedi: adv_pci1710: tidy up counter subdevice initH Hartley Sweeten
For aesthetics, add some whitespace to the counter subdevice init and rename the support functions. Also remove the unnecessary comments. 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-25staging: comedi: adv_pci1710: tidy up pci171x_insn_write_ao()H Hartley Sweeten
For aesthetics, rename this function and tidy it up. 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-25staging: comedi: adv_pci1710: tidy up pci1720_insn_write_ao()H Hartley Sweeten
For aesthetics, rename this function and tidy it up. 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-25staging: comedi: adv_pci1710: 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. The board is "reset" prior to the subdevice init. Part of this reset sets all the analog output channels to 0V. Move the initialization of the 'readback' values after the 'readback' member has been allocated. 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-25staging: comedi: adv_pci1710: change boardinfo 'n_aochan' to 'has_ao'H Hartley Sweeten
Some of the boards supported by this driver have analog outputs. The pci1720 board has 4 analog output channels and the others have 2. For aesthetics, change the 'n_aochan' member to a bit-field flag 'has_ao' and refactor the board attach accordingly. Remove the unnecessary initialization of the subdevice 'len_chanlist'. That member is only used by subdevices that support async commands. Also, remove the unnecessary 'number of channels' check in pci171x_reset(). The boards that used this function, and have analog outputs, always have 2 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>
2015-01-25staging: comedi: adv_pci1710: change boardinfo 'fifo_half_size' to ↵H Hartley Sweeten
'has_large_fifo' The boards supported by this driver have a 4K or 1K FIFO that is used when reading analog input samples when running an async command. The maximum number of samples in the FIFO is half the FIFO size due to the 2 bytes/sample (12-bit resolution). For aesthetics, change the 'fifo_half_size' member to a bit-field flag 'has_large_fifo' and add a new member to the private data to hold the 'max_samples' available in the FIFO. Refactor the board attach and pci1710_handle_fifo() accordingly. 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-25staging: comedi: adv_pci1710: remove boardinfo 'ai_ns_min'H Hartley Sweeten
The minimum analog input conversion time is 10000 ns for all board types. Remove this unnecessary boardinfo. 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-25staging: comedi: adv_pci1710: change boardinfo 'n_aichand' to 'has_diff_ai'H Hartley Sweeten
The 'n_aichand' member of the boardinfo is actually a flag indicating that the board supports differential analog inputs. The number of channels is always half the single-ended number of channels. For aesthetics, change the 'n_aichand' member to a bit-field flag 'has_diff_ai'. 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-25staging: comedi: adv_pci1710: remove boardinfo 'ao_maxdata'H Hartley Sweeten
The analog output resolution is always 12-bits in this driver. Remove the unnecessary boardinfo. 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-25staging: comedi: adv_pci1710: remove boardinfo 'ai_maxdata'H Hartley Sweeten
The analog input resolution is always 12-bits in this driver. Remove the unnecessary boardinfo. 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-25staging: comedi: adv_pci1710: rename boardinfo 'have_irq'H Hartley Sweeten
For aesthetics, rename this member of the boardinfo to 'has_irq' and change it to a bit-field flag. 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-25staging: comedi: adv_pci1710: simplify digital input and output boardinfoH Hartley Sweeten
The boards that have digital inputs and outputs always have 16 input channels and 16 output channels. Replace the 'n_dichan' and 'n_dochan' members of the boardinfo with the fit-field flag 'has_di_do' and refactor the board attach accordingly. Remove the unnecessary initialization of the subdevice 'len_chanlist'. That member is only used by subdevices that support 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>
2015-01-25staging: comedi: adv_pci1710: change boardinfo 'n_counter' to 'has_counter'H Hartley Sweeten
The 'n_counter' member of the boardinfo is actually a flag indicating that the board exposes a single channel counter subdevice. For aesthetics, change the 'n_counter' member to a bit-field flag 'has_counter' and refactor the board attach accordingly. Remove the unnecessary initialization of the subdevice 'len_chanlist'. That member is only used by subdevices that support 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>
2015-01-25staging: comedi: pcl818: introduce pcl818_ai_write_sample()H Hartley Sweeten
This driver can acquire analog input samples during the async command with DMA, by using the FIFO, or sample-by-sample using the End-Of-Conversion interrupt. All three methods do the following sequence: 1) check for channel dropout 2) add the sample to the async buffer 3) advance the channel dropout detection and detect the end of the command Merge this sequence into a new helper 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>