openwrt/staging/blogic.git
11 years agostaging: comedi: das16: fix das16_detach()
H Hartley Sweeten [Mon, 29 Jul 2013 21:07:10 +0000 (14:07 -0700)]
staging: comedi: das16: fix das16_detach()

The function das16_reset() needs a valid dev->iobase. Since the iobase
is requested after the devpriv has been allocated in the attach, move
the das16_reset() call into the if (devpriv) and add a if (dev->iobase).

Also, move the release of the extra iobase into the if (devpriv) to
prevent an invalid memory access.

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>
11 years agostaging: comedi: das16: change MODULE_DESCRIPTION
H Hartley Sweeten [Mon, 29 Jul 2013 21:06:52 +0000 (14:06 -0700)]
staging: comedi: das16: change MODULE_DESCRIPTION

Change the MODULE_DESCRIPTION to something useful instead of 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>
11 years agostaging: comedi: das16: tidy up private data definition
H Hartley Sweeten [Mon, 29 Jul 2013 21:06:34 +0000 (14:06 -0700)]
staging: comedi: das16: tidy up private data definition

Remove the comments and add some whitespace to help readability.

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>
11 years agostaging: comedi: das16: cleanup comedi_error() messages
H Hartley Sweeten [Mon, 29 Jul 2013 21:06:16 +0000 (14:06 -0700)]
staging: comedi: das16: cleanup comedi_error() messages

Some of these messages are missing the terminating '\n' and most of them
have the quoted string split across lines.

Change all of them to dev_err() messages and fix the issues.

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>
11 years agostaging: comedi: das16: fix a > 80 char line issue
H Hartley Sweeten [Mon, 29 Jul 2013 21:05:59 +0000 (14:05 -0700)]
staging: comedi: das16: fix a > 80 char line issue

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>
11 years agostaging: comedi: das16: absorb das1600_mode_detect() into caller
H Hartley Sweeten [Mon, 29 Jul 2013 21:05:37 +0000 (14:05 -0700)]
staging: comedi: das16: absorb das1600_mode_detect() into caller

This function is only called during the board attach to determine the
pacer clock speed for the boards capable of bursting.

Absorb it into the caller and remove the attach noise.

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>
11 years agostaging: comedi: das16: cleanup printk message in board attach
H Hartley Sweeten [Mon, 29 Jul 2013 21:05:20 +0000 (14:05 -0700)]
staging: comedi: das16: cleanup printk message in board attach

Convert this printk message into a dev_err().

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>
11 years agostaging: comedi: das16: fail attach if board id is incorrect
H Hartley Sweeten [Mon, 29 Jul 2013 21:05:00 +0000 (14:05 -0700)]
staging: comedi: das16: fail attach if board id is incorrect

This driver probes the board id during the attach to ensure that the
user is attempting to attach to the correct board type. Currently an
error message is output if the ids are not consistent but the attach
continues anyway.

Make the attach fail if the id bits do not match. Also, cleanup the
printk messages and use a dev_err() only if the probe fails.

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>
11 years agostaging: comedi: das16: tidy up the register map defines
H Hartley Sweeten [Mon, 29 Jul 2013 21:04:41 +0000 (14:04 -0700)]
staging: comedi: das16: tidy up the register map defines

Add the suffix _REG to all the register defines to better indicate
what they are.

Add a prefix to all the register bit defines to avoid namespace clashes
and to better indicate what they are.

Tidy up the whitesapce.

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>
11 years agostaging: comedi: das16: tidy up 8255 digital i/o subdevice
H Hartley Sweeten [Mon, 29 Jul 2013 21:04:13 +0000 (14:04 -0700)]
staging: comedi: das16: tidy up 8255 digital i/o subdevice

The 8255 digital i/o subdevice is only available on some of the boards
supported by this driver. Currently the 'i8255_offset' member of the
boardinfo is used to indicate that it is available.

To clarify this support, add a 'has_8255' bit-field flag to the boardinfo.
We can then use this flag to conditionally allocate the space for the
subdevice only when it is needed.

Also, make sure to check that subdev_8255_init() is successful and propagate
any errors.

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>
11 years agostaging: comedi: das16: remove 'i8254_offset' from boardinfo
H Hartley Sweeten [Mon, 29 Jul 2013 21:03:46 +0000 (14:03 -0700)]
staging: comedi: das16: remove 'i8254_offset' from boardinfo

All the boards supported by this driver have an 8254 timer at offset
0x0c. Remove this unused information from the 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>
11 years agostaging: comedi: das16: move boardinfo declaration
H Hartley Sweeten [Mon, 29 Jul 2013 21:03:28 +0000 (14:03 -0700)]
staging: comedi: das16: move boardinfo declaration

Now that the boardinfo does not require any forward declarations,
move it near the definition of the struct.

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>
11 years agostaging: comedi: das16: remove unnecessary test in das16_interrupt()
H Hartley Sweeten [Mon, 29 Jul 2013 21:03:11 +0000 (14:03 -0700)]
staging: comedi: das16: remove unnecessary test in das16_interrupt()

The timer is only started by the ai subdevice in das16_cmd_exec()
and this function can only be called if the device is attached.

Remove the unnecessary sanity check.

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>
11 years agostaging: comedi: das16: move some functions to improve readability
H Hartley Sweeten [Mon, 29 Jul 2013 21:02:48 +0000 (14:02 -0700)]
staging: comedi: das16: move some functions to improve readability

For aesthetics, move some of the functions to make the code easier
to follow.

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>
11 years agostaging: comedi: das16: tidy up das16_ai_insn_read()
H Hartley Sweeten [Mon, 29 Jul 2013 21:02:22 +0000 (14:02 -0700)]
staging: comedi: das16: tidy up das16_ai_insn_read()

Factor out the loop that waits for the ai conversion to complete.

Tidy up the function a bit.

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>
11 years agostaging: comedi: das16: introduce das16_ai_{en, dis}able() helpers
H Hartley Sweeten [Mon, 29 Jul 2013 20:58:36 +0000 (13:58 -0700)]
staging: comedi: das16: introduce das16_ai_{en, dis}able() helpers

Introduce a couple helper functions to enable and disable the
analog input interrupt/dma conversions.

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>
11 years agostaging: comedi: das16: remove the register map comments
H Hartley Sweeten [Mon, 29 Jul 2013 20:58:17 +0000 (13:58 -0700)]
staging: comedi: das16: remove the register map comments

This is just extra cruft. 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>
11 years agostaging: comedi: das16: remove unused static const variable
H Hartley Sweeten [Mon, 29 Jul 2013 20:57:58 +0000 (13:57 -0700)]
staging: comedi: das16: remove unused static const variable

This variable is not used in the driver. 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>
11 years agostaging: comedi: das16: remove unused DAS16_SIZE
H Hartley Sweeten [Mon, 29 Jul 2013 20:57:38 +0000 (13:57 -0700)]
staging: comedi: das16: remove unused DAS16_SIZE

This define is not used in the driver. 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>
11 years agostaging: comedi: das16: add a 'can_burst' flag to the private data
H Hartley Sweeten [Mon, 29 Jul 2013 20:57:18 +0000 (13:57 -0700)]
staging: comedi: das16: add a 'can_burst' flag to the private data

If the boardinfo 'size' is > 0x400 it indicates that the board has
additional registers that allow bursting of analog input data.

To better indicate this add a flag to the private data.

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>
11 years agostaging: comedi: das16: remove 'volatile' on private data variables
H Hartley Sweeten [Mon, 29 Jul 2013 20:56:59 +0000 (13:56 -0700)]
staging: comedi: das16: remove 'volatile' on private data variables

As indicated by checkpatch.pl, "WARNING: Use of volatile is usually
wrong: ...". The variables in the private data that are marked
volatile don't need to be. Remove the volatile.

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>
11 years agostaging: comedi: das16: remove DEBUG_PRINT macro
H Hartley Sweeten [Mon, 29 Jul 2013 20:56:38 +0000 (13:56 -0700)]
staging: comedi: das16: remove DEBUG_PRINT macro

This macro outputs some printk() debug info that is just added noise.
Remove it as well as the DEBUG stuff.

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>
11 years agostaging: comedi: das16: remove reg_dump()
H Hartley Sweeten [Mon, 29 Jul 2013 20:56:21 +0000 (13:56 -0700)]
staging: comedi: das16: remove reg_dump()

This function just prints some development debug information. There is
no reason to leave this in the final 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>
11 years agostaging: comedi: das16: remove 'ai_unipolar' and 'ai_singleended'
H Hartley Sweeten [Mon, 29 Jul 2013 20:56:02 +0000 (13:56 -0700)]
staging: comedi: das16: remove 'ai_unipolar' and 'ai_singleended'

These members in the private data are only used during the board attach.

Move the reading of the status register to the board attach and just
check the value where needed when initializing the analog input 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>
11 years agostaging: comedi: das16: remove unused struct definition
H Hartley Sweeten [Mon, 29 Jul 2013 20:55:38 +0000 (13:55 -0700)]
staging: comedi: das16: remove unused struct definition

This struct is not used by the driver. 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>
11 years agostaging: comedi: das16: tidy up the comedi_lrange tables
H Hartley Sweeten [Mon, 29 Jul 2013 20:55:20 +0000 (13:55 -0700)]
staging: comedi: das16: tidy up the comedi_lrange tables

Cleanup the whitespace in the tables.

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>
11 years agostaging: comedi: das16: cleanup analog output subdevice
H Hartley Sweeten [Mon, 29 Jul 2013 20:55:00 +0000 (13:55 -0700)]
staging: comedi: das16: cleanup analog output subdevice

All the boards supported by this driver that have analog outputs use
the same function to handle the (*insn_write) for the subdevice. They
all also have 12-bit resolution (maxdata = 0x0fff).

Remove the 'ao' and 'ao_nbits' members from the boardinfo and replace
them with a simple bit-field flag 'has_ao'.

Tidy up the subdevice init a bit as well as the (*insn_write) 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>
11 years agostaging: comedi: das16: all supported board have digital outputs
H Hartley Sweeten [Mon, 29 Jul 2013 20:54:39 +0000 (13:54 -0700)]
staging: comedi: das16: all supported board have digital outputs

All the boards supported by this driver have digital outputs and all
of then use the same function to handle the (*insn_bits) for the
subdevice.

Remove the 'do_' member from the boardinfo and always initialize the
digital output subdevice during the board attach.

Tidy up the subdevice init a bit as well as the (*insn_bits) function.
Remove SDF_READABLE from the subdev_flags. This is a pure digital output
subdevice and the outputs are not readable.

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>
11 years agostaging: comedi: das16: all supported board have digital inputs
H Hartley Sweeten [Mon, 29 Jul 2013 20:54:09 +0000 (13:54 -0700)]
staging: comedi: das16: all supported board have digital inputs

All the boards supported by this driver have digital inputs and all
of then use the same function to handle the (*insn_bits) for the
subdevice.

Remove the 'di' member from the boardinfo and always initialize the
digital input subdevice during the board attach.

Tidy up the subdevice init a bit as well as the (*insn_bits) function.
The (*insn_bits) function does not need to clear data[0].

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>
11 years agostaging: comedi: das16: change boardinfo 'ai_nbits' to 'ai_maxdata'
H Hartley Sweeten [Mon, 29 Jul 2013 20:49:21 +0000 (13:49 -0700)]
staging: comedi: das16: change boardinfo 'ai_nbits' to 'ai_maxdata'

The subdevice functions that used this boardinfo can use the subdevice
's->maxdata' value instead. Tidy up those functions.

Change the boardinfo so that the calculation is not needed during the
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>
11 years agostaging: comedi: das16: all supported board have analog inputs
H Hartley Sweeten [Mon, 29 Jul 2013 20:49:01 +0000 (13:49 -0700)]
staging: comedi: das16: all supported board have analog inputs

All the boards supported by this driver have analog inputs and all
of then use the same function to handle the (*insn_read) for the
subdevice.

Remove the 'ai' member from the boardinfo and always initalize the
analog input subdevice during the board attach.

Tidy up the subdevice init a bit.

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>
11 years agostaging: comedi: das16: fix DMA init during board attach
H Hartley Sweeten [Mon, 29 Jul 2013 20:48:38 +0000 (13:48 -0700)]
staging: comedi: das16: fix DMA init during board attach

DMA support is optional in this driver. To enable it, the user
passes the desired DMA channel during the board attach. A timer
is then used by the driver to periodically get the analog input
data from the DMA.

Since the DMA support is optional, modify the init code so that
it only fails if the DMA channel is unavailable or the DMA buffers
can not be allocated. Don't fail just because the user passed an
invalid DMA channel (only DMA channels 1 and 3 are valid).

Remove the printk() noise about the DMA. Change the printk() when
the request_dma() fails into a dev_err().

Move the timer initialization so it's only setup if DMA is available.
It's not needed otherwise. Also, only hook up the subdevice command
support functions if DMA is available. This allows removing a couple
sanity checks in the command support.

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>
11 years agostaging: comedi: das16: remove DMA irq support
H Hartley Sweeten [Mon, 29 Jul 2013 20:48:19 +0000 (13:48 -0700)]
staging: comedi: das16: remove DMA irq support

As noted in the driver, a timer is always used by this driver to handle
the DMA because samples could be dropped while waiting for the DMA done
interrupt.

Remove the irq setup code as well as 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>
11 years agostaging: comedi: das16: "timer_mode" is always used for DMA
H Hartley Sweeten [Mon, 29 Jul 2013 20:48:01 +0000 (13:48 -0700)]
staging: comedi: das16: "timer_mode" is always used for DMA

As noted in the driver, a timer is always used by this driver to handle the
DMA due to buggy DMA controllers and the lack of a hardware fifo in some of
the supported boards.

Remove all the non-timer mode specific 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>
11 years agostaging: olpc_dcon: provide detailed FB_OLPC_DCON help section
Jens Frederich [Tue, 30 Jul 2013 18:11:34 +0000 (20:11 +0200)]
staging: olpc_dcon: provide detailed FB_OLPC_DCON help section

The FB_OLPC_DCON help section is to short according to checkpatch.pl.
We want more information about the controller type, its task, its video
pipeline position and so on.

There are no style issues, remove checkpatch.pl TODO entry.

Signed-off-by: Jens Frederich <jfrederich@gmail.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: rtl8192u/ieee80211: add missing single_release()
Li Zefan [Wed, 31 Jul 2013 06:30:13 +0000 (14:30 +0800)]
Staging: rtl8192u/ieee80211: add missing single_release()

The debug file is opened with single_open(), but there's no
single_release().

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: rtl8192e: add missing single_release()
Li Zefan [Wed, 31 Jul 2013 06:29:27 +0000 (14:29 +0800)]
Staging: rtl8192e: add missing single_release()

The debug file is opened with single_open(), but there's no
single_release().

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: gdm724x: depend on CONFIG_TTY
Greg Kroah-Hartman [Mon, 29 Jul 2013 19:27:40 +0000 (12:27 -0700)]
staging: gdm724x: depend on CONFIG_TTY

The driver uses the tty layer, so explicitly say that, to prevent
randomconfig build errors.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: reformat documentation
Aaro Koskinen [Mon, 29 Jul 2013 17:08:00 +0000 (20:08 +0300)]
staging: octeon-usb: cvmx-usb: reformat documentation

Reformat the high-level documentation to human readable plain text by
removing HTML and other tags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete CVS keyword markers
Aaro Koskinen [Mon, 29 Jul 2013 17:07:59 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete CVS keyword markers

Delete CVS keyword markers.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: convert @return
Aaro Koskinen [Mon, 29 Jul 2013 17:07:58 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: convert @return

Convert "@return" to "Returns: ".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: convert @param
Aaro Koskinen [Mon, 29 Jul 2013 17:07:57 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: convert @param

Convert "@param name" inside comments to "@name:".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete duplicated documentation from .h file
Aaro Koskinen [Mon, 29 Jul 2013 17:07:56 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete duplicated documentation from .h file

Delete duplicated function call documentation from the .h file. These
functions are just internal anyway, and the .h file will be completely
removed in the future when the driver will be made a single self-contained
.c file.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete @INTERNAL
Aaro Koskinen [Mon, 29 Jul 2013 17:07:55 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete @INTERNAL

Delete "@INTERNAL" from comments.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: reformat long comments
Aaro Koskinen [Mon, 29 Jul 2013 17:07:54 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: reformat long comments

Reformat long comments according to multi-line comment style.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: fix whitespace issues
Aaro Koskinen [Mon, 29 Jul 2013 17:07:53 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: fix whitespace issues

Fix most of the whitespace issues reported by checkpatch:
- use tabs for indentation
- brace placement vs. newlines
- (foo_t*) -> (foo_t *)
- i=0 -> i = 0

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete __cvmx_usb_complete_to_string()
Aaro Koskinen [Mon, 29 Jul 2013 17:07:52 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete __cvmx_usb_complete_to_string()

Delete a redundant function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: replace cvmx_le16_to_cpu with le16_to_cpu
Aaro Koskinen [Mon, 29 Jul 2013 17:07:51 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: replace cvmx_le16_to_cpu with le16_to_cpu

Replace cvmx_le16_to_cpu() with le16_to_cpu().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: replace cvmx_wait_usec with udelay
Aaro Koskinen [Mon, 29 Jul 2013 17:07:50 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: replace cvmx_wait_usec with udelay

Just use udelay().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: replace long udelays with mdelays
Aaro Koskinen [Mon, 29 Jul 2013 17:07:49 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: replace long udelays with mdelays

Replace long udelays with mdelays.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: eliminate cvmx_likely/unlikely
Aaro Koskinen [Mon, 29 Jul 2013 17:07:48 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: eliminate cvmx_likely/unlikely

Just use likely/unlikely.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: utilize Linux error codes
Aaro Koskinen [Mon, 29 Jul 2013 17:07:47 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: utilize Linux error codes

Use generic Linux error codes to replace cvmx_usb_status_t.

The conversion table:

Before After
cvmx_usb_status_t int
CVMX_USB_SUCCESS 0
CVMX_USB_INVALID_PARAM -EINVAL
CVMX_USB_NO_MEMORY -ENOMEM
CVMX_USB_BUSY -EBUSY
CVMX_USB_TIMEOUT -ETIMEDOUT
CVMX_USB_INCORRECT_MODE Deleted (was never used)

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete __cplusplus
Aaro Koskinen [Mon, 29 Jul 2013 17:07:46 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete __cplusplus

Delete __cplusplus.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete redundant example code
Aaro Koskinen [Mon, 29 Jul 2013 17:07:45 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete redundant example code

Delete redundant example code found in comments. It's already there in
the driver proper.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete redundant debug flags
Aaro Koskinen [Mon, 29 Jul 2013 17:07:44 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete redundant debug flags

Delete redudant debug flags and dead code behind them.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: cvmx-usb: delete driver-specific tracing code
Aaro Koskinen [Mon, 29 Jul 2013 17:07:43 +0000 (20:07 +0300)]
staging: octeon-usb: cvmx-usb: delete driver-specific tracing code

Delete call, parameter, and return value tracing.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: use correct board type for EdgeRouter Lite
Aaro Koskinen [Mon, 29 Jul 2013 17:07:42 +0000 (20:07 +0300)]
staging: octeon-usb: use correct board type for EdgeRouter Lite

Use CVMX_BOARD_TYPE_UBNT_E100 for EdgeRouter Lite.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: octeon-usb: depend on CAVIUM_OCTEON_SOC
Aaro Koskinen [Mon, 29 Jul 2013 17:07:41 +0000 (20:07 +0300)]
staging: octeon-usb: depend on CAVIUM_OCTEON_SOC

The USB driver should depend on SOC instead of CPU.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: LeakyBucket: Fixed a pointer asterisk placement issue
Lilis Iskandar [Sat, 27 Jul 2013 19:34:47 +0000 (03:34 +0800)]
Staging: bcm: LeakyBucket: Fixed a pointer asterisk placement issue

Fixed a pointer asterisk placement issue

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: LeakyBucket: Fixed code indent issues
Lilis Iskandar [Sat, 27 Jul 2013 19:34:46 +0000 (03:34 +0800)]
Staging: bcm: LeakyBucket: Fixed code indent issues

Fixed code indent issues

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: LeakyBucket: Fixed C99 comments
Lilis Iskandar [Sat, 27 Jul 2013 19:34:45 +0000 (03:34 +0800)]
Staging: bcm: LeakyBucket: Fixed C99 comments

Fixed C99 comments

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: LeakyBucket: Fixed brace issues
Lilis Iskandar [Sat, 27 Jul 2013 19:34:44 +0000 (03:34 +0800)]
Staging: bcm: LeakyBucket: Fixed brace issues

Fixed brace issues

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: LeakyBucket: Fixed spacing/tabing issues
Lilis Iskandar [Sat, 27 Jul 2013 19:34:43 +0000 (03:34 +0800)]
Staging: bcm: LeakyBucket: Fixed spacing/tabing issues

This one fixes spacing/tabbing issues.

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: nvec: re-enable the clock on resume
Marc Dietrich [Sat, 27 Jul 2013 16:20:58 +0000 (18:20 +0200)]
staging: nvec: re-enable the clock on resume

On resume the slave controller is reinitialized. The tegra i2c master
controller disables the clock at the end of the initialiation, propably
to save some power, and enables it again on each transfer. We don't
do this yet and also forgot to enable the clock on resume. Fix this
copy-paste error by not disabling the clock after initialization.

This didn't striked us yet because suspend/resume hasn't landed in mainline
yet, but will soon.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: gdm724x: Modified function name conflict set_endian
Won Kang [Sat, 27 Jul 2013 06:42:18 +0000 (15:42 +0900)]
staging: gdm724x: Modified function name conflict set_endian

Conflict resolution for function name set_endian when building for powerpc
The name changed to gdm_set_endian

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Won Kang <wonkang@gctsemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: dt9812: remove duplicated include from dt9812.c
Wei Yongjun [Mon, 29 Jul 2013 04:28:51 +0000 (12:28 +0800)]
staging: comedi: dt9812: remove duplicated include from dt9812.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: gdm724x: remove duplicated include from gdm_lte.c
Wei Yongjun [Mon, 29 Jul 2013 04:33:24 +0000 (12:33 +0800)]
staging: gdm724x: remove duplicated include from gdm_lte.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xillybus: remove duplicated include from xillybus_core.c
Wei Yongjun [Mon, 29 Jul 2013 04:59:30 +0000 (12:59 +0800)]
staging: xillybus: remove duplicated include from xillybus_core.c

Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Fix sparse warnings about use of obsolete initializer
Emil Goode [Sat, 27 Jul 2013 22:38:56 +0000 (00:38 +0200)]
staging: lustre: Fix sparse warnings about use of obsolete initializer

This patch fixes a lot of sparse warnings about use of obsolete
struct and array initializer.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Fix non-ANSI sparse warnings
Emil Goode [Sat, 27 Jul 2013 22:38:55 +0000 (00:38 +0200)]
staging: lustre: Fix non-ANSI sparse warnings

This patch fixes a lot of non-ANSI sparse warnings by adding void to
parameterless functions.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoMerge 3.11-rc3 into staging-next
Greg Kroah-Hartman [Mon, 29 Jul 2013 14:40:10 +0000 (07:40 -0700)]
Merge 3.11-rc3 into staging-next

We want these fixes here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoLinux 3.11-rc3
Linus Torvalds [Mon, 29 Jul 2013 03:53:33 +0000 (20:53 -0700)]
Linux 3.11-rc3

11 years agoMerge tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 29 Jul 2013 01:19:27 +0000 (18:19 -0700)]
Merge tag 'pinctrl-for-v3.11-2' of git://git./linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
 - Driver fixes for AM33xx, SIRF and PFC pin controllers
 - Fix a compile warning from the pinctrl single-register driver
 - Fix a little nasty memory leak

* tag 'pinctrl-for-v3.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: fix a memleak when freeing maps
  pinctrl: pinctrl-single: fix compile warning when no CONFIG_PM
  pinctrl: sh-pfc: fix SDHI0 VccQ regulator on sh73a0 with DT
  arm/dts: sirf: fix the pingroup name mismatch between drivers and dts
  pinctrl: sirf: add usp0_uart_nostreamctrl pin group for usp-uart without flowctrl
  pinctrl: sirf: fix the pin number and mux bit for usp0
  pinctrl: am33xx dt binding: correct include path

11 years agoMerge tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 29 Jul 2013 01:10:39 +0000 (18:10 -0700)]
Merge tag 'trace-fixes-3.11-rc2' of git://git./linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "Oleg is working on fixing a very tight race between opening a event
  file and deleting that event at the same time (both must be done as
  root).

  I also found a bug while testing Oleg's patches which has to do with a
  race with kprobes using the function tracer.

  There's also a deadlock fix that was introduced with the previous
  fixes"

* tag 'trace-fixes-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()
  ftrace: Add check for NULL regs if ops has SAVE_REGS set
  tracing: Kill trace_cpu struct/members
  tracing: Change tracing_fops/snapshot_fops to rely on tracing_get_cpu()
  tracing: Change tracing_entries_fops to rely on tracing_get_cpu()
  tracing: Change tracing_stats_fops to rely on tracing_get_cpu()
  tracing: Change tracing_buffers_fops to rely on tracing_get_cpu()
  tracing: Change tracing_pipe_fops() to rely on tracing_get_cpu()
  tracing: Introduce trace_create_cpu_file() and tracing_get_cpu()

11 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Mon, 29 Jul 2013 01:09:34 +0000 (18:09 -0700)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is five bug fixes, two of which fix long standing problems
  causing crashes (sd and mvsas).  The remaining three are hung (isci
  race) or lost (qla2xxx, isci) devices"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] isci: fix breakage caused by >16byte CDB patch
  [SCSI] mvsas: Fix kernel panic on tile due to unaligned data access
  [SCSI] sd: fix crash when UA received on DIF enabled device
  [SCSI] qla2xxx: Properly set the tagging for commands.
  [SCSI] isci: Fix a race condition in the SSP task management path

11 years agovt6655/trivial: replace numeric with standard PM state macros
Yijing Wang [Thu, 27 Jun 2013 12:57:23 +0000 (20:57 +0800)]
vt6655/trivial: replace numeric with standard PM state macros

Use standard PM state macros PCI_Dx instead of numeric 0/1/2..

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Jiri Kosina <trivial@kernel.org>
Cc: Devendra Naga <devendra.aaru@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agozram: prevent data loss in error cases of function zram_bvec_write()
Sunghan Suh [Wed, 3 Jul 2013 11:10:05 +0000 (20:10 +0900)]
zram: prevent data loss in error cases of function zram_bvec_write()

In function zram_bvec_write(), previous data at the index is
already freed by function zram_free_page().
When failed to compress or zs_malloc, there is no way to restore old data.
Therefore, free previous data when it's about to update.

Also, no need to check whether table is not empty outside of
function zram_free_page(), because the function properly checks inside.

Signed-off-by: Sunghan Suh <sunghan.suh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: asus_oled: delete driver
Greg Kroah-Hartman [Fri, 26 Jul 2013 22:37:54 +0000 (15:37 -0700)]
staging: asus_oled: delete driver

No one has the hardware for it anymore, and there has not been any
development on it in a long time.

If someone shows up with the hardware, and wants to clean it up, this
can be easily reverted.

Reported-by: Lidza Louina <lidza.louina@gmail.com>
Cc: Jakub Schmidtke <sjakub@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: usbdux: consolidate usbduxsub_unlink_{in, out}urbs()
H Hartley Sweeten [Thu, 25 Jul 2013 23:12:30 +0000 (16:12 -0700)]
staging: comedi: usbdux: consolidate usbduxsub_unlink_{in, out}urbs()

These functions are identical other than the which and how many urbs
are unlinked.

Consolidate the functions into one usbdux_unlink_urbs() 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>
11 years agostaging: comedi: usbdux: move and rename the bulk transfer commands
H Hartley Sweeten [Thu, 25 Jul 2013 23:12:05 +0000 (16:12 -0700)]
staging: comedi: usbdux: move and rename the bulk transfer commands

For aesthetic reasons, move the defines used for the bulk transfer
commands out of the middle of the code and rename them so they are
a bit more readable.

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>
11 years agostaging: comedi: usbdux: remove unused define
H Hartley Sweeten [Thu, 25 Jul 2013 23:11:46 +0000 (16:11 -0700)]
staging: comedi: usbdux: remove unused define

This define is not used, and it's actually incorrect. The usbdux device
only has 4 analog output channels.

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>
11 years agostaging: comedi: usbdux: 'dac_commands' does not need to be kzalloc()'d
H Hartley Sweeten [Thu, 25 Jul 2013 23:11:28 +0000 (16:11 -0700)]
staging: comedi: usbdux: 'dac_commands' does not need to be kzalloc()'d

The 'dac_commands' buffer is used to pass the ao channel list from
usbdux_ao_cmd() to the urb callback, usbduxsub_ao_isoc_irq(). This
buffer does not need to be allocated.

Change it into a simple array of the correct size. Rename the variable
to 'ao_chanlist' to clarify what it actually is.

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>
11 years agostaging: comedi: usbdux: remove unnecessary check in usbdux_ao_cmd()
H Hartley Sweeten [Thu, 25 Jul 2013 23:11:10 +0000 (16:11 -0700)]
staging: comedi: usbdux: remove unnecessary check in usbdux_ao_cmd()

This check is not necessary. The cmd->chanlist_len will always be
less than or equal to the subdevice len_chanlist that was setup
during the attach of the device.

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>
11 years agostaging: comedi: usbdux: remove unnecessary check in usbdux_ai_cmd()
H Hartley Sweeten [Thu, 25 Jul 2013 23:10:43 +0000 (16:10 -0700)]
staging: comedi: usbdux: remove unnecessary check in usbdux_ai_cmd()

This check is not necessary. The cmd->chanlist_len will always be
less than or equal to the subdevice len_chanlist that was setup
during the attach of the device.

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>
11 years agostaging: comedi: usbdux: simplify initializing the ao urb transfer_buffer
H Hartley Sweeten [Thu, 25 Jul 2013 23:10:25 +0000 (16:10 -0700)]
staging: comedi: usbdux: simplify initializing the ao urb transfer_buffer

Remove the ugly casting of datap to the ao urb->transfer_buffer. The format
of the data in the buffer is simply.

  [0] = # of channels to update (s->async->cmd.chanlist.len)
  [1] = lsb of value for 1st channel to update
  [2] = msb of value for 1st channel to update
  [3] = 1st channel to update (depvriv->dac_commands[0])

If more than 1 channel is to be updated they are simply added to the buffer:

  [4] = lsb of value for 2st channel to update
  [5] = msb of value for 2st channel to update
  [6] = 1st channel to update (depvriv->dac_commands[1])

etc.

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>
11 years agostaging: comedi: usbdux: cleanup the private data 'outBuffer'
H Hartley Sweeten [Thu, 25 Jul 2013 23:10:07 +0000 (16:10 -0700)]
staging: comedi: usbdux: cleanup the private data 'outBuffer'

This buffer is used to cache the values that are written to the
analog output channels. Currently it only caches the single writes
to the channels using the (*insn_write) callback. The async command
writes are not cached. The buffer is also being kzalloc'ed during
the attach of the driver to a size much larger that required.

Rename the CamelCase buffer and change it to an array in the private
data of the correct size to cache the analog output channel values.

Modify the analog output urb callback so it updates the cached values
with those used for the asynchronous command to allow readback after
the command completes.

The sanity check of the index to dac_commands[] (i.e. the 'chan' being
written) is not needed. The chanlist_len will always be less than the
number of channels.

Also, fix the dev_err() message so it uses the proper device pointer.

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>
11 years agostaging: comedi: usbdux: rename private data variables
H Hartley Sweeten [Thu, 25 Jul 2013 23:09:48 +0000 (16:09 -0700)]
staging: comedi: usbdux: rename private data variables

The usbdux and usbduxsigma drivers are _very_ similar. For aesthetic
reasons, rename the private data variables in this driver to match
the names in the usbduxsigma driver so we can start sharing 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>
11 years agostaging: comedi: usbdux: clarify bipolar ai data in usbduxsub_ai_isoc_irq()
H Hartley Sweeten [Thu, 25 Jul 2013 23:09:30 +0000 (16:09 -0700)]
staging: comedi: usbdux: clarify bipolar ai data in usbduxsub_ai_isoc_irq()

Use the comedi_range_is_bipolar() helper instead of checking the
'range' index against a magic number.

Also, use the s->maxdata to calculate the value needed to munge the
value for bipolar data instead of the magic number.

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>
11 years agostaging: comedi: usbdux: move usbdux_firmware_upload()
H Hartley Sweeten [Thu, 25 Jul 2013 23:09:13 +0000 (16:09 -0700)]
staging: comedi: usbdux: move usbdux_firmware_upload()

For aesthetics, move this function closer to the (*auto_attach).

Also, rename some of the defined constants that are used by the
firmware upload.

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>
11 years agostaging: comedi: usbdux: remove some unused defines
H Hartley Sweeten [Thu, 25 Jul 2013 23:08:52 +0000 (16:08 -0700)]
staging: comedi: usbdux: remove some unused defines

These defines are not used by 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>
11 years agostaging: comedi: usbdux: remove the usb endpoint defines
H Hartley Sweeten [Thu, 25 Jul 2013 23:08:35 +0000 (16:08 -0700)]
staging: comedi: usbdux: remove the usb endpoint defines

The endpoint defines are each only used in one place and don't help
clarify the code. Remove the defines and just 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>
11 years agostaging: comedi: usbdux: use the stop helpers in the detach
H Hartley Sweeten [Thu, 25 Jul 2013 23:08:16 +0000 (16:08 -0700)]
staging: comedi: usbdux: use the stop helpers in the detach

Use the stop helpers instead of duplicating the code in the detach.

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>
11 years agostaging: comedi: usbdux: tidy up unlink and stop helpers
H Hartley Sweeten [Thu, 25 Jul 2013 23:07:57 +0000 (16:07 -0700)]
staging: comedi: usbdux: tidy up unlink and stop helpers

For aesthetic reasons, pass the comedi_device pointer to the unlink
helpers instead of the private data pointer.

All the unlink helpers simply call usb_kill_urb() to cancel any pending
transfer requests. The usb passed to usb_kill_urb() can be NULL so the
extra sanity check is not required.

The unlink helpers will always return success so just make them void
functions.

Since the stop helpers will also always return success, make them void
functions as well.

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>
11 years agostaging: comedi: usbdux: fix usbdux_pwm_start()
H Hartley Sweeten [Thu, 25 Jul 2013 23:07:39 +0000 (16:07 -0700)]
staging: comedi: usbdux: fix usbdux_pwm_start()

Add the missing down/up of the semaphore to prevent other commands
from being issued to the usb device while the pwn is being stopped.

Rename the local variable used for the private data pointer to the
comedi "norm".

Use memset() to initialize the urb transfer 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>
11 years agostaging: comedi: usbdux: fix usbdux_pwm_cancel()
H Hartley Sweeten [Thu, 25 Jul 2013 23:07:20 +0000 (16:07 -0700)]
staging: comedi: usbdux: fix usbdux_pwm_cancel()

Add the missing down/up of the semaphore to prevent other commands
from being issued to the usb device while the pwn is being stopped.

Rename the local variable used for the private data pointer to the
comedi "norm".

Make sure to check that usbdux_pwm_stop() was successful before
sending command to the usb device to stop the pwm.

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>
11 years agostaging: comedi: usbdux: tidy up usbdux_pwm_stop()
H Hartley Sweeten [Thu, 25 Jul 2013 23:07:04 +0000 (16:07 -0700)]
staging: comedi: usbdux: tidy up usbdux_pwm_stop()

For aesthetic reasons, pass the comedi_device pointer to this function
instead of the private data pointer. Rename the local variable used
for the private data pointer to the comedi "norm".

Remove the unnecessary sanity check of the private data pointer. This
function can only be called is the private data was allocated during
the 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>
11 years agostaging: comedi: usbdux: fix usbdux_counter_write()
H Hartley Sweeten [Thu, 25 Jul 2013 23:06:47 +0000 (16:06 -0700)]
staging: comedi: usbdux: fix usbdux_counter_write()

Comedi (*insn_write) operations are supposed to write insn->n values.
Fix this function to work like the core expects.

Rename the local variable used for the private data pointer to the
comedi "norm".

Remove the unnecessary sanity check of the private data pointer. This
function can only be called is the private data was allocated during
the 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>
11 years agostaging: comedi: usbdux: fix usbdux_counter_read()
H Hartley Sweeten [Thu, 25 Jul 2013 23:06:30 +0000 (16:06 -0700)]
staging: comedi: usbdux: fix usbdux_counter_read()

Comedi (*insn_read) operations are supposed to read and return insn->n
values. Fix this function to work like the core expects.

Rename the local variable used for the private data pointer to the
comedi "norm".

Remove the unnecessary sanity check of the private data pointer. This
function can only be called is the private data was allocated during
the attach.

Tidy up the exit path using goto to ensure that the semaphore is
released.

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>
11 years agostaging: comedi: usbdux: tidy up usbdux_dio_insn_bits()
H Hartley Sweeten [Thu, 25 Jul 2013 23:06:11 +0000 (16:06 -0700)]
staging: comedi: usbdux: tidy up usbdux_dio_insn_bits()

Rename the local variable used for the private data pointer to the
comedi "norm".

Remove the unnecessary sanity check of the private data pointer. This
function can only be called is the private data was allocated during
the attach.

Tidy up the exit path using goto to ensure that the semaphore is
released.

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>
11 years agostaging: comedi: usbdux: tidy up usbdux_dio_insn_config()
H Hartley Sweeten [Thu, 25 Jul 2013 23:05:53 +0000 (16:05 -0700)]
staging: comedi: usbdux: tidy up usbdux_dio_insn_config()

Tidy up this function a bit.

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>