aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/dmm32at.c
AgeCommit message (Collapse)Author
2017-11-28staging: comedi: drivers: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all comedi files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/comedi files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: comedi: dmm32at: usleep_range is preferred over udelaySaber Rezvani
Fix the checkpatch.pl issue: CHECK: usleep_range is preferred over udelay Signed-off-by: Saber Rezvani <irsaber@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17Staging: comedi: dmm32at: fix BIT macro issue.Ravishankar Karkala Mallikarjunayya
This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL_PAGE(x), DMM32AT_AI_CFG_SCINT(x) macros to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro" Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14Staging: comedi: dmm32at: Simplify a trivial if-return sequenceAbdul Hussain
This patch simplify a trivial if-return sequence. Possibly combine with a preceding function call. Signed-off-by: Abdul Hussain <habdul@visteon.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03staging: comedi: dmm32at: remove #include "comedi_fc.h"Ian Abbott
As preparation for removal of "comedi_fc.h", replace calls to the `cfc_check_trigger_...` functions from "comedi_fc.h" with the replacement `comedi_check_trigger_...` functions from "../comedidev.h" and remove the inclusion of "comedi_fc.h". 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-03-06staging: comedi: drivers/*.c: fix common misspellingsH Hartley Sweeten
Fix these common misspellings: s/dependancy/dependency s/occured/occurred s/informations/information s/intialize/initialize s/serveral/several s/interrups/interrupts s/acknowledgement/acknowledgment s/suppport/support s/writting/writing 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: dmm32at: 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>
2015-01-09staging: comedi: dmm32at: fix style issuesDavid Decotigny
Before: 1 ERROR: code indent should use tabs where possible 1 WARNING: please, no spaces at the start of a line After: (none) Signed-off-by: David Decotigny <ddecotig@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> 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-11-26staging: comedi: dmm32at: 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>
2014-11-26staging: comedi: dmm32at: tidy up multi-line commentsH Hartley Sweeten
Reformat the multi-line comments for 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_AIRBACKH Hartley Sweeten
For aesthetics, rename this define used for the Analog I/O Readback register. Define the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_AICONFH Hartley Sweeten
For aesthetics, rename this define used for the Analog Configuration register. Define the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_CNTRDIOH Hartley Sweeten
For aesthetics, rename this define used for the Counter and Digital I/O Configuration register. Define the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_INTCLOCKH Hartley Sweeten
For aesthetics, rename this define used for the Interrupt and A/D Clock Control and Status register. Also, rename the defines for the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_AISTATH Hartley Sweeten
For aesthetics, rename this define used for the A/D Status register. Also, rename the defines for the bits of the register. The probe code in dmm32at_reset() checks this register to make sure the S/D1 and S/D0 bits are set. This check actually verifies that the board is configured (with jumpers on the board) with all the Analog Input channels operating in single-ended mode. Add a comment about this. 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-11-26staging: comedi: dmm32at: rename DMM32AT_CNTRLH Hartley Sweeten
For aesthetics, rename this define used for the Miscellaneous Control register. Also, rename the defines for the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_FIFOSTATH Hartley Sweeten
For aesthetics, rename this define used for the FIFO Status register. Define the bits of the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_FIFOCNTRLH Hartley Sweeten
For aesthetics, rename this define used for the FIFO Control register. Also, rename the defines used for the bits of 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>
2014-11-26staging: comedi: dmm32at: define the FIFO Depth registerH Hartley Sweeten
This driver currently does not use the FIFO. For completeness, define the offset to the FIFO Depth 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_DACMSB_CHANH Hartley Sweeten
For aesthetics, rename this define used to set the DACH[10] bits in the DAC MSB register to select the D/A 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_DACSTATH Hartley Sweeten
For aesthetics, rename this define used for the Status / Auxillary Digital Inputs register. Document the bits in the 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_DAC[LM]SBH Hartley Sweeten
For aesthetics, rename these defines used for the D/A LSB/MSB 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_AI{LOW,HIGH}H Hartley Sweeten
For aesthetics, rename these defines used for the A/D Low/High Channel 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_AUXDOUTH Hartley Sweeten
For aesthetics, rename this define used for the Auxillary Digital Output register. This register is currently not used in the driver. Document the bits of the register for completeness. 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-11-26staging: comedi: dmm32at: rename DMM32AT_AI[LM]SBH Hartley Sweeten
For aesthetics, rename these defines used for the A/D LSB/MSB 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>
2014-11-26staging: comedi: dmm32at: rename DMM32AT_CONVH Hartley Sweeten
For aesthetics, rename this define used for the Start A/D Conversion 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>
2014-11-26staging: comedi: dmm32at: use 8255 module for Digital I/O subdeviceH Hartley Sweeten
The Dimond-MM-32-AT board uses an internal 82C55-type digital I/O circuit to provide the 24 digital I/O lines. The only quirk is the need to set the page selection bits in the control register to select page 1 addresses. Instead of duplicating the 8255 code, provide an (*io) callback and use the 8255 module to support this subdevice. This also removes the need for the private data 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>
2014-11-26staging: comedi: dmm32at: introduce dmm32at_ai_set_chanspec()H Hartley Sweeten
Introduce a helper function to set the analog input channel scan and range control registers. Use the new helper in the analog input (*insn_read) and (*do_cmd) functions. The extra sanity checks in the (*do_cmd) are not necessary. The cmd->chanlist will always be valid and the (*do_cmdtest) validates the channel list in Step 5. 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-11-26staging: comedi: dmm32at: remove unused members of the private dataH Hartley Sweeten
The 'data' and 'ai_inuse' members in the private data are not used in the driver. 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>
2014-11-26staging: comedi: dmm32at: remove dmm32at_ns_to_timer()H Hartley Sweeten
This function is not necessary. It simply returns the 'ns' value that was passed to it. Remove it as well as the unnecessary Step 4 check of the cmd->convert_arg. 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-11-26staging: comedi: dmm32at: tidy up cmd->convert_{src, arg} validationH Hartley Sweeten
This driver only supports a single convert_src, TRIG_TIMER. Tidy up the (*do_cmdtest) validation of the cmd->convert_{src,arg}. 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-11-26staging: comedi: dmm32at: tidy up cmd->scan_begin_{src, arg} validationH Hartley Sweeten
This driver only supports a single scan_begin_src, TRIG_TIMER. Tidy up the (*do_cmdtest) validation of the cmd->scan_begin_{src,arg}. 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-11-26staging: comedi: dmm32at: tidy up subdevice initializationH Hartley Sweeten
For aesthetics, add some whitespace to the subdevice initialization. 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-11-26staging: comedi: dmm32at: introduce dmm32at_reset()H Hartley Sweeten
For aesthetics, factor the board reset and detection code out of the (*attach) 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-11-26staging: comedi: dmm32at: tidy up dmm32at_ai_rinsn()H Hartley Sweeten
For aesthetics, rename this function to dmm32at_ai_insn_read(). Get the 'chan' and 'range' from the chanspec when declaring the local variables. Remove the unecessary masking of the 'chan'. Remove some unnecessary comments. Change the final return to 'insn->n' to clarify the return value. 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-11-26staging: comedi: dmm32at: introduce dmm32_ai_get_sample()H Hartley Sweeten
Introduce a helper function to read the two's complement analog input sample from the hardware and munge it to the offset binary (unsigned) format that comedi expects. Use the comedi_offset_munge() helper to munge the data. Use the new helper in the analog input (*insn_read) and in the interrupt handler for the async command. 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-11-26staging: comedi: dmm32at: use comedi_async 'scans_done' to detect EOAH Hartley Sweeten
Remove the private data member 'ai_scans_left' and use the comedi_async 'scans_done' to detect the end-of-acquisition. This also removes the artifical max limit on the cmd->stop_arg. 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-11-26staging: comedi: dmm32at: make AI (*cancel) actually cancel async commandH Hartley Sweeten
Currently the AI (*cancel) changes a private data member to cause the interrupt handler to cancel the async command after the next interrupt. Move the code that disables the interrupt and terminates the acquisition from the interrunt handler into dmm32at_ai_cancel() so that the async command is terminated instantly. 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-10-29staging: comedi: dmm32at: use comedi_buf_write_samples()H Hartley Sweeten
For aesthetics, use comedi_buf_write_samples() to add the sample to the async buffer. 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-10-20staging: comedi: dmm32at: use comedi_handle_events()H Hartley Sweeten
Use comedi_handle_events() to automatically (*cancel) the async command for an end-of-acquisition or if an error/overflow occurs. 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: dmm32at: 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: dmm32at: cleanup dmm32at_ao_winsn()H Hartley Sweeten
For aesthetics, rename the function and tidy it up a bit. Also rename the registers used by this function and add a macro to set the 'chan' bits in the MSB data 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>
2014-07-21staging: comedi: drivers: remove unnecessary *_{IO, MEM}SIZE definesH Hartley Sweeten
Some of the legacy comedi drivers have a *_{IO,MEM}SIZE define that is only passed to comedi_request_region() to specify the size of the region. For aesthetics, remove these defines. 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-21staging: comedi: drivers: cleanup cmd->flags useH Hartley Sweeten
Most of the comedi drivers that support async commands have some sort of timer to control the acquisition timing. For these drivers, Step 4 of the (*do_cmdtest) operations calls a ns_to_timer() function that converts the desired ns time of the command into a value used to set the timer. These ns_to_timer() functions also typically pass the cmd->flags in order to determine the desired rounding mode. Some of the drivers mask the cmd->flags with TRIG_ROUND_MASK when calling the ns_to_timer() functions. Move all the masking into the ns_to_timer() functions and just pass the cmd->flags directly. The cmd->flags member is an unsigned int, change the parameter type in the the ns_to_timer() functions to match. For aesthetics, rename the parameter in all the ns_to_timer() functions to 'flags'. 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-17staging: comedi: dmm32at: remove use of comedi_error()H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds the dev->driver->driver_name prefix to the message and a terminating new-line character. The addition of the driver_name is just added noise and some of the users of comedi_error() add unnecessary additional new-line characters. Use dev_err() directly instead of comedi_error() to avoid any confusion and so that all the comedi generated kernel messages have the same format. 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-05-28staging: comedi: dmm32at: use comedi_fc helpers to validate timer argsH Hartley Sweeten
Use the comedi_fc helper cfc_check_trigger_arg_is() to validate the trigger arguments when the source is TRIG_TIMER. Use cfc_check_trigger_arg_min() to vaidate the scan_begin_arg when the scan_begin_src and convert_src are both TRIG_TIMER. All the arguments are unsigned int, change the local variable to an unsigned int and rename it for aesthetic reasons. 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-05-23staging: comedi: pass subdevice to comedi_buf_put()Ian Abbott
Change the parameters of `comedi_buf_put()` to pass a pointer to the comedi subdevice instead of a pointer to the "async" structure belonging to the subdevice. The function puts a sample value in the comedi buffer, but currently only deals with 16-bit sample types. A future version could deal with 16 or 32-bit sample types depending on the value of the SDF_LSAMPL subdevice flag. The main aim at the moment is to replace all the `struct comedi_async *` parameters with `struct comedi_subdevice *` parameters in the comedi driver API. 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>