aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedidev.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-17staging: comedi: comedidev: make bool bit-field unsigned int bit-fields.Giulio Benetti1-2/+2
Checkpatch complains on bool bitfields to be an int or u8/u16/u32 bitfield. Make bool bit-fields to be unsigned int bit-fields. Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-25staging: comedi: comedidev.h: Fix SPDX-License-Identifier tag styleNishad Kamdar1-1/+1
Replace // SPDX-License-Identifier: GPL-2.0+ by /* SPDX-License-Identifier: GPL-2.0+ */ as per licensing rule for C header files. Issue found by checkpatch. Part of Eudyptula Challenge. Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-26staging: comedi: reformat lines to 80 chars or lessEujon Sellers1-4/+8
This is a cleanup patch to fix line length issue found by checkpatch.pl script. In this patch, lines 186, 192 and 199 have been wrapped. Signed-off-by: Eujon Sellers <eujon.sellers@gmail.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21staging: comedi: add identifiers to function parametersMichael Gebhard1-18/+18
Fix these checkpatch.pl warnings in comedidev.h: WARNING: function definition argument '<name>' should also have an identifier name Introduces this checkpatch.pl warning in lines 195 and 205: WARNING: line over 80 characters Breaking these lines would make the code less compact. Signed-off-by: Michael Gebhard <im72ywil@cip.cs.fau.de> Signed-off-by: David Sauerwein <la38vyti@cip.cs.fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: Remove redundant license textGreg Kroah-Hartman1-10/+0
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-Hartman1-0/+1
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-01-03Staging: comedi: comedidev.h: Drop old style zero-length arrayCheah Kok Cheong1-7/+1
According to Documentation/Changes, the minimum gcc version required to compile the kernel is 3.2 (this is probably outdated too). Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: comedi: comedidev.h: add identifiers to function parametersIan Abbott1-22/+25
Fix checkpatch.pl warnings of the form "function definition argument 'foo' should also have an identifier name". 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>
2016-12-08staging: comedi: comedidev.h: Document usage of 'detach' handlerIan Abbott1-0/+12
Document when the "detach" handler function pointed to by the `detach` member of a `struct comedi_driver` is called by the comedi core, and how the "attach" and "auto_attach" handlers can defer clean-up to it when they return an error to the comedi core. This is already mentioned as part of the documentation for `comedi_auto_config()`, but is useful to document it for `struct comedi_driver` as well, since `comedi_auto_config()` is not usually called directly by low-level comedi drivers, and it is not called at all for "legacy" comedi devices that are configured manually. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29Staging: comedi: Fix 'unsigned' warning styleAniket Sharma1-2/+2
This patch fixes the checkpatch.pl warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' + unsigned runflags; WARNING: Prefer 'unsigned int' to bare use of 'unsigned' +struct comedi_device *comedi_dev_get_from_minor(unsigned minor); Signed-off-by: Aniket Sharma <badbuddha91@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13staging: comedi: comedidev.h: spaces preferred around that '*'Ian Abbott1-6/+6
Fix the checkpatch.pl issues: CHECK: spaces preferred around that '*' (ctx:VxV) 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-10-13staging: comedi: comedidev.h: add comments to spin-lock and mutexIan Abbott1-3/+3
Fix the checkpatch.pl issues: CHECK: spinlock_t definition without comment CHECK: struct mutes definition withoug 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-09-29staging: comedi: comedidev.h: document remaining inline functionsIan Abbott1-1/+113
Add kernel-doc headers to the inline functions that do not have them yet. 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-09-29staging: comedi: comedidev.h: tweak docs for inline functionsIan Abbott1-33/+59
Tweak the kernel-doc for already documented inline functions for consistency, and document their return values. 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-09-29staging: comedi: comedidev.h: tweak struct comedi_async documentationIan Abbott1-25/+25
Make the kernel-doc layout for `struct comedi_async` more consistent with the documentation for the other COMEDI data types. 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-09-29staging: comedi: comedidev.h: document struct comedi_lrangeIan Abbott1-0/+11
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-09-29staging: comedi: comedidev.h: document struct comedi_buf_mapIan Abbott1-0/+29
Add kernel-doc for `struct comedi_buf_map` and the associated `struct comedi_buf_page`. 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-09-29staging: comedi: comedidev.h: document struct comedi_subdeviceIan Abbott1-0/+125
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-09-29staging: comedi: comedidev.h: document struct comedi_deviceIan Abbott1-3/+81
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-09-29staging: comedi: comedidev.h: document struct comedi_driverIan Abbott1-5/+33
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-09-29staging: comedi: comedidev.h: tweak kernel-doc for struct comedi_asyncIan Abbott1-7/+12
Tweak the formatting of the kernel-doc formatted comment for `struct comedi_async` in order to stop it generating bogus headings for text before a colon. 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-09-29staging: comedi: comedidev.h: use enum for COMEDI_CB_... constantsIan Abbott1-11/+12
The existing constants `COMEDI_CB_EOS` etc. are in the form of macros and have a bogus kernel-doc comment. Change them to `enum` constants so they can be documented properly with kernel-doc. 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-09-29staging: comedi: comedidev.h: reformat copyright commentIan Abbott1-16/+16
Use the preferred 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-06-17staging: comedi: use BIT macro for bit shift operationHari Prasath Gujulan Elango1-6/+6
This patch silences the Checkpatch.pl warning 'Prefer using the BIT macro' Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: comedi: move COMEDI_SRF_... macros to "comedi_fops.c"Ian Abbott1-17/+0
The `COMEDI_SRF_...` macros define flag combinations in the `runflags` member of `struct comedi_subdevice`. They are only used directly in "comedi_fops.c", so move them to there. 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-04-30staging: comedi: wrap COMEDI_SRF_FREE_SPRIV usageIan Abbott1-0/+1
The `COMEDI_SRF_FREE_SPRIV` flag in the `runflags` member of `struct comedi_subdevice` indicates that the memory pointed to by the `private` member can be automatically freed by the comedi core on subdevice clean-up (when the low-level comedi device is being "detached"). the flag doesn't really belong in `runflags`, but it was somewhere convenient to keep it without having to add a new member to the structure. Rather than access the `COMEDI_SRF_FREE_SPRIV` flag directly, use some new wrapper functions: * comedi_can_auto_free_spriv(s) - checks whether the subdevice's `s->private` points to memory that can be freed automatically. * comedi_set_spriv_auto_free(s) - marks the subdevice as having a `s->private` that points to memory that can be freed automatically. Export `comedi_set_spriv_auto_free()` for use by the low-level comedi driver modules, in particular the "amplc_dio200_common" module. 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-04-03staging: comedi: comedi_fc.h: begin migration to comedidev.hIan Abbott1-0/+78
"comedi_fc.h" contains a few inline functions used by the `do_cmdtest` handler functions for comedi subdevices in several low-level comedi drivers for checking asynchronous command trigger sources and arguments. They all use the prefix `cfc_check_trigger_arg`. Copy them over to "../comedidev.h", but change the `cfc_` prefix to `comedi_`. Change the original functions in "comedi_fc.h" into simple wrappers for their replacements. Once the drivers have been changed to call the replacement functions, "comedi_fc.h" can be removed. 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-20staging: comedi: comedi_pci.h: move PCI stuff out of comedidev.hIan Abbott1-43/+0
Move the PCI-specific stuff out of "comedidev.h" into "comedi_pci.h". Comedi PCI drivers now include "comedi_pci.h" instead of "comedidev.h", which now gets pulled in indirectly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01staging: comedi: add 'pacer' member to struct comedi_deviceH Hartley Sweeten1-0/+1
Add a new member to the comedi_device struct for a comedi_8254 'pacer'. This provides a convient place to store the data allocated by the comedi_8254 module for boards that use an 8254 device to create the data acquisition pacer clock. Automatically free this pointer in comedi_device_detach_cleanup() so that the drivers don't need to do it when then are detached. 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-02-07staging: comedi: comedi_pcmcia.h: move PCMCIA stuff out of comedidev.hIan Abbott1-33/+0
Move the PCMCIA-specific stuff out of "comedidev.h" into "comedi_pcmcia.h". Comedi PCMCIA drivers now include "comedi_pcmcia.h" instead of "comedidev.h", which now gets pulled in indirectly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28staging: comedi: comedi_usb.h: move USB stuff out of comedidev.hIan Abbott1-29/+0
Move the USB-specific stuff out of "comedidev.h" into "comedi_usb.h". Comedi USB drivers now include "comedi_usb.h" instead of "comedidev.h", which now gets pulled in indirectly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25staging: comedi: comedidev.h: add namespace to the subdevice "runflags"H Hartley Sweeten1-9/+16
Tidy up and document the subdevice "runflags". Rename them so they have comedi namespace. 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: comedidev.h: remove unused "polling" function prototypesH Hartley Sweeten1-5/+0
These "polling" functions are not implemented in the comedi core. Remove the unnecessary prototypes. 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: comedidev.h: remove unused "minor bits" informationH Hartley Sweeten1-11/+0
The enum comedi_minor_bits and the COMEDI_SUBDEVICE_MINOR_{SHIFT,OFFSET} defines are not used. 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-07staging: comedi: drivers: introduce comedi_nsamples_left()H Hartley Sweeten1-0/+2
Introduce a helper function to calculate the number of samples remaining when the cmd->stop_src is TRIG_COUNT. 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-07staging: comedi: drivers: introduce comedi_nscans_left()H Hartley Sweeten1-0/+2
Introduce a helper function to determine the number of scans left in 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-07staging: comedi: comedidev.h: remove some #ifdefsIan Abbott1-12/+0
Some declarations and macro definitions in "comedidev.h" are protected by various `#ifdef`s for kernel configuration options, but the header file compiles fine without the `#ifdef`s regardless of whether those config option macros are defined or not. Remove the `#ifdef`s and compile the affected code unconditionally. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07staging: comedi: comedidev.h: remove dummy PCI support functionsIan Abbott1-26/+0
Some low-level Comedi driver modules used to handle PCI devices and ISA devices in the same module with some conditional compilation. To reduce the amount of conditional compilation, some dummy inline versions of `comedi_to_pci_dev()`, `comedi_pci_enable()`, `comedi_pci_disable()`, and `comedi_pci_detach()` are defined in "comedidev.h" if `CONFIG_COMEDI_PCI_DRIVERS` is undefined. Since those Comedi low-level driver modules have since had PCI support split out into separate modules, there is no need to keep the dummy inline functions around any more, so remove them. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05staging: comedi: comedidev.h: add 'scans_done' member to comedi_asyncH Hartley Sweeten1-0/+2
Introduce a new member to comedi_async to count the number of scans completed. This member is cleared by comedi_buf_reset() along with the other comedi_async members. It is incremented in comedi_inc_scan_progress() when the end of scan is detected. This member will be used to clean up the scan counting in the comedi 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>
2014-11-03staging: comedi: remove use of 'bytes_per_sample()'H Hartley Sweeten1-6/+0
This inline helper function has been replaced with comedi_bytes_per_sample(). The same commit (bf33eb4b4f57) introduced a couple other related helper functions a manipulate the sample size. Use the new helper functions to remove the use of 'bytes_per_sample()' and remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: comedi: introduce some sample size manipulation functionsIan Abbott1-4/+59
Introduce a few static inline helper functions: `comedi_bytes_per_sample(s)` is the same as the existing `bytes_per_sample(s)` and determines the size of a comedi sample in bytes. (`bytes_per_sample(s)` will be removed.) `comedi_sample_shift(s)` determines the log2 of the comedi sample size, so it can be used in bit-shift operations to multiply or divide by the sample size. `comedi_bytes_to_samples(s, nbytes)` converts a number of bytes to a number of samples (rounding down). `comedi_samples_to_bytes(s, nsamples)` converts a number of samples to a number of bytes. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: comedi: comedi_buf: don't export comedi_write_array_to_buffer()H Hartley Sweeten1-3/+0
All the comedi drivers have been converted to use comedi_buf_write_samples(). This function is now only used internally by comedi_buf. Remvoe the export. 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: comedi_buf: remove comedi_buf_put()H Hartley Sweeten1-2/+0
All comedi drivers now use comedi_buf_write_samples() to add the samples to the async buffer. Remove this unused 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-10-29staging: comedi: comedi_buf: introduce comedi_buf_write_samples()H Hartley Sweeten1-0/+2
Introduce a generic method to write samples to the async buffer. The number of samples is first checked against the number of samples that would fill the async buffer. The size of each sample is determined using the bytes_per_sample() helper. If all the samples will fit in the async buffer they are written to the buffer using comedi_write_array_to_buffer(). This will allow converting all the comedi drivers to use a common method to write data to the async buffer. Since comedi_write_array_to_buffer() sets the COMEDI_CB_BLOCK event after writing the data, those events can be removed from the drivers. In addition, comedi_inc_scan_progress() will automatically detect the end of scan and set the COMEDI_CB_EOS event. Those events can also be removed from the 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>
2014-10-29staging: comedi: comedi_buf: don't export comedi_buf_memcpy_to()H Hartley Sweeten1-3/+0
This function is only used internally. Remove the export. 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: comedi_buf: dont't export comedi_buf_memcpy_from()H Hartley Sweeten1-2/+1
This function is only used internally. Remove the export. 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: comedi_buf: remove comedi_buf_get()H Hartley Sweeten1-1/+0
This function is no longer used. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: comedi: comedi_buf: remove export of comedi_read_array_from_buffer()H Hartley Sweeten1-2/+0
This function is only used internally. Remove the export. 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: comedi_buf: introduce comedi_buf_read_samples()H Hartley Sweeten1-0/+2
Introduce a generic method to read samples from the async buffer. The number of requested samples is clampled to the number of samples that would fill the async buffer. The size of each sample is determined using the bytes_per_sample() helper. The number of bytes need are then read from the async buffer using comedi_read_array_from_buffer(). This will allow converting all the comedi drivers to use a common method to read data from the async buffer. Since comedi_read_array_from_buffer() sets the COMEDI_CB_BLOCK event after reading the data, those events can be removed from the drivers. In addition, comedi_inc_scan_progress() will automatically detect the end of scan and set the COMEDI_CB_EOS event. Those events can also be removed from the 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>
2014-10-29staging: comedi: comedidev.h: clarify async->event error/cancel detectionH Hartley Sweeten1-0/+6
Introduce COMEDI_CB_ERROR_MASK and COMEDI_CB_CANCEL_MASK to clarify the async->events that indicate errors and cancel an async command. Use the new defines to tidy up and clarify 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>