Commit graph

40 commits

Author SHA1 Message Date
H Hartley Sweeten 40af57a27b staging: comedi: comedi.h: checkpatch.pl --strict cleanup
Fix the checkpatch.pl --strict issues:

CHECK: Please use a blank line after function/struct/union/enum declarations

For aesthetics, convert the inline functions into simple macros.

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-07-18 16:10:40 -07:00
Kinka Huang cb3aadaec8 staging: comedi: removing not useful else after return
Signed-off-by: Kinka Huang <kinkabrain@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15 19:59:16 -07:00
H Hartley Sweeten 5fc391853e staging: comedi: ke_counter: expose clock source options to user space
As pointed out by Ian Abbott, the INSN_CONFIG_SET_CLOCK_SRC options should
be exposed in the user header comedi.h.

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-06-26 20:00:43 -04:00
H Hartley Sweeten 641f064e5d staging: comedi: remove FSF address from boilerplate text
Addresses change...

Remove the paragraph with the FSF address from all the comedi source
files.

Also, remove the paragraph about the finding the complete GPL in the
COPYING file since it's unnecessary.

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>
2013-05-13 17:34:22 -04:00
H Hartley Sweeten d18431325b staging: comedi: deprecate loading firmware with comedi_config
All the comedi drivers have been converted to use the request_firmware()
hotplug interface. The COMEDI_DEVCONFIG ioctl support for passing the
firmware blob as 'aux_data' is no longer required.

Remove the feature and give the user a dev_warn message if it is
attempted.

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>
2013-01-17 16:51:46 -08:00
Ian Abbott 206cb10816 staging: comedi: define operations for INSN_CONFIG_DIGITAL_TRIG
The 'addi_apci_1032' driver recently started supporting the
`INSN_CONFIG_DIGITAL_TRIG` configuration instruction, but as no other
drivers were using it before, there was no existing practice of how the
instruction should look.

Define the format to be something a bit more configurable.  In
particular, a subdevice might have more than one trigger requiring an ID
and/or `COMEDI_EV_...` flags to disambiguate them, a trigger might have
more than 32 inputs, and a trigger might need several
`INSN_CONFIG_DIGITAL_TRIG` configuration instructions to configure
completely (if there are more than 32 inputs or if it uses a combination
of edge-triggered and level-triggered inputs).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-14 16:25:08 -08:00
Ian Abbott c59515a879 staging: comedi: comedi.h: add clock sources for amplc_dio200 timer
Add clock source constants for the timer subdevice of the PCIe cards
supported by the "amplc_dio200" driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 15:25:22 -07:00
Ian Abbott 025d1f675c staging: comedi: comedi.h: extra clock and gate sources for amplc_dio200
Add constants to "comedi.h" for the extra clock and gate sources
allowed by the new PCIe cards supported by the "amplc_dio200" driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24 15:25:22 -07:00
H Hartley Sweeten 9be56c6432 staging: comedi: comedi.h: remove __user tag from chanlist
The 'chanlist' is passed to the kernel from user space with the
COMEDI_CMD and COMEDI_CMDTEST ioctls. The do_cmd_ioctl() and
do_cmdtest_ioctl() functions in comedi_fops.c copy this data
to/from user space to kernel space correctly.

Unfortunately, this data is copied back into a struct comedi_cmd
so when the cmd is passed down to the drivers they still see the
pointer as __user data. This results is a number of sparse errors
such as:

  warning: dereference of noderef expression

  warning: incorrect type in argument 2 (different address spaces)
     expected void const *<noident>
     got unsigned int [noderef] <asn:1>*chanlist

  warning: incorrect type in argument 3 (different address spaces)
     expected unsigned int *chanlist
     got unsigned int [noderef] <asn:1>*chanlist

  warning: incorrect type in assignment (different address spaces)
     expected unsigned int *ai_chanlist
     got unsigned int [noderef] <asn:1>*chanlist

The two functions in comedi_fops are the only ones that need the
__user tag. Remove the tag so that all the drivers see the chanlist
pointer in the correct address space.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-19 09:36:44 +01:00
H Hartley Sweeten 25b73c783d staging: comedi: comedi.h: remove the extra indents
The extra indents in this file cause git diff to not know the
section where changes are being made. This results in diff outputs
like:

@@ -365,7 +365,10 @@

instead of the more informational:

@@ -365,6 +365,7 @@ struct comedi_cmd {

Remove all the extra indents.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-19 09:29:51 +01:00
W. Trevor King 35a36e6505 staging: comedi: COMEDI_CB_EOA is also used to report end-of-output.
Update comments in comedi.h accordingly.

Signed-off-by: W. Trevor King <wking@drexel.edu>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:37:06 -07:00
Ralf Thielow f80d1d22b6 staging: comedi: fixed a declaration coding style issue
Fixed a declaration coding style issue.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:23:56 -07:00
Mark Rankilor 7d8e737dd7 Staging: comedi: Fixed more long line lengths in comedi.h
This patches fixes some long line lengths in comedi.h from checkpatch.pl

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14 13:53:19 -07:00
Mark Rankilor b464f791ca Staging: comedi: Fixed long line lengths in comedi.h
This patches fixes long line lengths in comedi.h that were picked up by
checkpatch.pl

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14 13:51:52 -07:00
Mark a9560a7275 Staging: comedi: Fixed long line lengths in comedi.h
This patch fixes quite a few long line lengths in comedi.h as reported by
checkpatch.pl

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 15:56:19 -07:00
Mark Rankilor e012b4c419 Staging: comedi: Fixed long line lengths in comedi.h
This patches fixes some of the long line lengths that checkpatch.pl was
complaining about in comedi.h

Signed-off-by: Mark Rankilor <reodge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:19 -07:00
Greg Kroah-Hartman 30162d690c Staging: comedi: mark a variable as __user
This is really a userspace pointer, so mark it as such.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:07 -07:00
Greg Kroah-Hartman 92d0127c9d Staging: comedi: __user markup on comedi_fops.c
Hm, what a mess.  I tried to properly mark up the __user pointers,
but for some of these structures, we use them both in the kernel,
and across the user/kernel boundry, which isn't ok.  So we end
up generating a few new sparse warnings in places we were not before,
but the large majority of things are now properly tagged in the fops
file.

The whole ioctl interface needs to be carefully looked at in the future.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:03 -07:00
Greg Kroah-Hartman 3b6b25b5dd Staging: comedi: range.c: properly mark up __user pointers
This is the start of cleaning up the user pointer markings
in the comedi core.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:03 -07:00
Gorskin Ilya 48fe603945 Staging: comedi: fix coding style issue in comedi.h
This is a patch to the comedi.h files that fixes up errors found by the
checkpatch.pl tool

Signed-off-by: Gorskin Ilya <revent82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:39 -07:00
Bernd Porr d103bef451 Staging: comedi: removed "depricated" from COMEDI_CB_BLOCK
The flag COMEDI_CB_BLOCK was marked as "depricated in the header file".
However, this flag is important to wake up the data-reader (and writer)
after new data has arrived from(for) the DAQ card.


Signed-off-by: Bernd Porr <berndporr@f2s.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-23 11:27:45 -08:00
Shawn Bohrer 37a110c049 Staging: comedi: remove __cplusplus check
c++ isn't supported in the kernel.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:02 -08:00
Mithlesh Thukral 0a85b6f0ab Staging: Comedi: Lindent changes to comdi driver in staging tree
Lindent changes to comdi driver in staging tree.
This patch is followed by the checkpatch.pl error fixes.
Did not make them part of this patch as the patch size is already huge.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:33 -07:00
Greg Kroah-Hartman fcea115462 Staging: comedi: remove some RT code that lingered
This removes some pieces of RT code that was part of the main code
paths.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:33 -07:00
Bill Pemberton 9aa5339ac1 Staging: comedi: Remove comedi_bufinfo typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton be6aba4a42 Staging: comedi: Remove comedi_bufconfig typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton 1f6325d629 Staging: comedi: Remove comedi_krange typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton d0a353f637 Staging: comedi: Remove comedi_rangeinfo typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton 0707bb04be Staging: comedi: Remove comedi_devconfig typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton 063db04b89 Staging: comedi: Remove comedi_devinfo typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:58 -07:00
Bill Pemberton bd52efbbcc Staging: comedi: Remove comedi_subdinfo typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton a18b416dc1 Staging: comedi: Remove comedi_chaninfo typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton da613f4fab Staging: comedi: Remove comedi_insnlist typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton 90035c0886 Staging: comedi: Remove comedi_insn typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton ea6d0d4cab Staging: comedi: Remove comedi_cmd typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton b50d88d080 Staging: comedi: Remove comedi_trig typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:57 -07:00
Bill Pemberton 790c55415a Staging: comedi: Remove lsampl_t and sampl_t typedefs
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:55 -07:00
Ian Abbott 1b9f641205 Staging: comedi: Use explicit value for enumerated constant INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE.
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:52 -07:00
Greg Kroah-Hartman e0dcef71f6 Staging: comedi: fix up a lot of checkpatch.pl warnings
Only clean up some of the easier ones in the .h files

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:16 -08:00
David Schleef ed9eccbe89 Staging: add comedi core
This adds the Comedi core to the staging tree.
This is a data acquision infrastructure for Linux, providing a common
interface for these types of drivers.

Taken directly from the comedi git tree, with only minor tweaks
by Greg to get it to build properly within the kernel tree.

From: David Schleef <ds@schleef.org>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:16 -08:00