GitHub/moto-9609/android_kernel_motorola_exynos9610.git
10 years agostaging: comedi: adl_pci9111: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:27 +0000 (17:31 -0700)]
staging: comedi: adl_pci9111: tidy up comedi_lrange tables

Tidy up the format of the comedi_lrange table.

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>
10 years agostaging: comedi: adv_pci1724: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:26 +0000 (17:31 -0700)]
staging: comedi: adv_pci1724: tidy up comedi_lrange tables

Tidy up the format of the comedi_lrange table.

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>
10 years agostaging: comedi: usbduxfast: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:25 +0000 (17:31 -0700)]
staging: comedi: usbduxfast: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: ni_at_a2150: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:24 +0000 (17:31 -0700)]
staging: comedi: ni_at_a2150: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE macro instead of the more generic RANGE macro to
reduce the potential for typos.

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>
10 years agostaging: comedi: comedi_test: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:23 +0000 (17:31 -0700)]
staging: comedi: comedi_test: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: dyna_pci10xx: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:22 +0000 (17:31 -0700)]
staging: comedi: dyna_pci10xx: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: me4000: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:21 +0000 (17:31 -0700)]
staging: comedi: me4000: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: icp_multi: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:20 +0000 (17:31 -0700)]
staging: comedi: icp_multi: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: aio_aio12_8: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:19 +0000 (17:31 -0700)]
staging: comedi: aio_aio12_8: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: pcl816: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:18 +0000 (17:31 -0700)]
staging: comedi: pcl816: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: fl512: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:17 +0000 (17:31 -0700)]
staging: comedi: fl512: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: das16m1: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:16 +0000 (17:31 -0700)]
staging: comedi: das16m1: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: adq12b: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:15 +0000 (17:31 -0700)]
staging: comedi: adq12b: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: dmm32at: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:14 +0000 (17:31 -0700)]
staging: comedi: dmm32at: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: amplc_pci230: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:13 +0000 (17:31 -0700)]
staging: comedi: amplc_pci230: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: ni_pcimio: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:12 +0000 (17:31 -0700)]
staging: comedi: ni_pcimio: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: amplc_pci224: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:11 +0000 (17:31 -0700)]
staging: comedi: amplc_pci224: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: adl_pci9118: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:10 +0000 (17:31 -0700)]
staging: comedi: adl_pci9118: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: das1800: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:09 +0000 (17:31 -0700)]
staging: comedi: das1800: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: dt282x: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:08 +0000 (17:31 -0700)]
staging: comedi: dt282x: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: dt2811: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:07 +0000 (17:31 -0700)]
staging: comedi: dt2811: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: ni_atmio16d: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:06 +0000 (17:31 -0700)]
staging: comedi: ni_atmio16d: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: cb_pcidas: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:05 +0000 (17:31 -0700)]
staging: comedi: cb_pcidas: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: dt2801: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:04 +0000 (17:31 -0700)]
staging: comedi: dt2801: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: das08: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:03 +0000 (17:31 -0700)]
staging: comedi: das08: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: adv_pci1710: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:02 +0000 (17:31 -0700)]
staging: comedi: adv_pci1710: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: pcl818: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:01 +0000 (17:31 -0700)]
staging: comedi: pcl818: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: cb_pcidas64: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:31:00 +0000 (17:31 -0700)]
staging: comedi: cb_pcidas64: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: ni_mio_common: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:30:59 +0000 (17:30 -0700)]
staging: comedi: ni_mio_common: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange tables.

Use the BIP_RANGE and UNI_RANGE macros instead of the more generic
RANGE macro to reduce possible typo 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>
10 years agostaging: comedi: pcl812: tidy up comedi_lrange tables
H Hartley Sweeten [Tue, 10 Dec 2013 00:30:58 +0000 (17:30 -0700)]
staging: comedi: pcl812: tidy up comedi_lrange tables

Tidy up the whitespace in the comedi_lrange 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>
10 years agostaging: comedi: addi_apci_1032: fix subdevice type/flags bug
H Hartley Sweeten [Mon, 9 Dec 2013 23:06:41 +0000 (16:06 -0700)]
staging: comedi: addi_apci_1032: fix subdevice type/flags bug

The SDF_CMD_READ should be one of the s->subdev_flags not part of
the s->type.

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>
10 years agostaging: comedi: pcmmio: fix final checkpatch warning
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:24 +0000 (15:31 -0700)]
staging: comedi: pcmmio: fix final checkpatch warning

Fis the last checkpatch.pl warning in this driver:

WARNING: space prohibited between function name and open parenthesis '('
+           comedi_buf_put (s->async, val >> 16)) {

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>
10 years agostaging: comedi: pcmmio: tidy up the multi-line comments
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:23 +0000 (15:31 -0700)]
staging: comedi: pcmmio: tidy up the multi-line comments

Tidy up the multi-line comments are the beginning of the file to 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>
10 years agostaging: comedi: pcmmio: update the MODULE_DESCRIPTION
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:22 +0000 (15:31 -0700)]
staging: comedi: pcmmio: update the MODULE_DESCRIPTION

Change the MODULE_DESCRIPTION to something more usefull 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>
10 years agostaging: comedi: pcmmio: return '0' after successful attach
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:21 +0000 (15:31 -0700)]
staging: comedi: pcmmio: return '0' after successful attach

The comedi core expects the (*attach) functions to return < 0 to indicate
an error or >= 0 for success. Change the return to '0' as that is more
typical.

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>
10 years agostaging: comedi: pcmmio: cleanup the private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:20 +0000 (15:31 -0700)]
staging: comedi: pcmmio: cleanup the private data

Fix the types of some of the private data members. The 'enabled_mask' and
'stop_count' should be unsigned int values. The 'active' and 'continuous'
members are flags, change them to unsigned int bit fields.

Remove the 'sprivs' pointer. This should have been removed when the subdevice
private data was removed.

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>
10 years agostaging: comedi: pcmmio: remove unused defines
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:19 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove unused defines

These defines are not longer 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>
10 years agostaging: comedi: pcmmio: tidy up pcmmio_start_intr()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:18 +0000 (15:31 -0700)]
staging: comedi: pcmmio: tidy up pcmmio_start_intr()

Refactor the function to remove some indent levels.

Use pcmmio_dio_write() to write the polarity and enable paged registers
instead of using the for () loop to write each register in the pages.

The for () loop actually has a bug. It switches the page to the 'enab'
registers for the first port then switches to the 'pol' registers for
all remaining writes. It also was not using the pagelock spinlock to
protect the writes to the page registers. Using the pcmmio_dio_write()
helper ensures that the writes to the paged registers complete correctly.

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>
10 years agostaging: comedi: pcmmio: setup irq routing during (*attach)
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:17 +0000 (15:31 -0700)]
staging: comedi: pcmmio: setup irq routing during (*attach)

To use interrupts the IRQ routing must be configured and interrupts
enabled. Currently both steps are being handled in pcmmio_start_intr().

Move the code that sets the IRQ routing into the attach of the board.
At this point interrupts are still disabled. The enable and polarity
bits just need to be set in pcmmio_start_intr() to enable 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>
10 years agostaging: comedi: pcmmio: only hook up async command support if irq is available
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:16 +0000 (15:31 -0700)]
staging: comedi: pcmmio: only hook up async command support if irq is available

Refactor the board attach so that the async commands support is only
hooked up if the irq is actually available.

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>
10 years agostaging: comedi: pcmmio: tidy up pcmmio_handle_dio_intr()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:15 +0000 (15:31 -0700)]
staging: comedi: pcmmio: tidy up pcmmio_handle_dio_intr()

Refactor the code to remove some of the indent levels.

Remove 'mytrig', the shift and mask end up making it the same as 'triggered'
anyway.

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>
10 years agostaging: comedi: pcmmio: factor the trigger handling out of interrupt_pcmmio()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:14 +0000 (15:31 -0700)]
staging: comedi: pcmmio: factor the trigger handling out of interrupt_pcmmio()

Factor the code that actually handles the digital input triggers out of
the interrupt handler.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: pcmmio: use pcmmio_dio_{read, write}() in interrupt_pcmmio()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:13 +0000 (15:31 -0700)]
staging: comedi: pcmmio: use pcmmio_dio_{read, write}() in interrupt_pcmmio()

Use the helper functions to read/write the PCMMIO_PAGE_INT_ID registers. This
allows removing the need to lock/unlock the spinlock 'pagelock' and removes the
need for the for () loop that did the read/write of the 3 paged registers.

Also, remove the need for the 'got1' local variable by just returning 'IRQ_NONE'
if there are not interrupts pending.

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>
10 years agostaging: comedi: pcmmio: cleanup indent levels in interrupt_pcmmio()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:12 +0000 (15:31 -0700)]
staging: comedi: pcmmio: cleanup indent levels in interrupt_pcmmio()

Remove the extra indent levels in this function that resulted from
code removed in previous patches.

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>
10 years agostaging: comedi: pcmmio: use comedi_legacy_detach() for (*detach)
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:11 +0000 (15:31 -0700)]
staging: comedi: pcmmio: use comedi_legacy_detach() for (*detach)

The (*detach) of this driver just calls comedi_legacy_detach(). Use that
directly for 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>
10 years agostaging: comedi: pcmmio: remove subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:10 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove subdevice private data

Only subdevice[2], the dio interrupt subdevice, uses the subdevice private data.
Move the members from struct pcmmio_subdev_private to struct pcmmio_private and
remove the subdevice private data. This also allows removing the allocation and
freeing of devpriv->sprivs.

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>
10 years agostaging: comedi: pcmmio: remove 'num_asic_chans' from subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:09 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove 'num_asic_chans' from subdevice private data

The 'num_asic_chans' that support interrupts in the interrupt subdevice is
always initialized to '24'. Remove this unneeded information from the subdevice
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>
10 years agostaging: comedi: pcmmio: remove 'asic_chan' from subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:08 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove 'asic_chan' from subdevice private data

The first 'asic_chan' that supports interrupts in the interrupt subdevice is
always initialized to '0'. Remove this unneeded information from the subdevice
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>
10 years agostaging: comedi: pcmmio: remove 'first_chan' from subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:07 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove 'first_chan' from subdevice private data

The 'first_chan' that supports interrupts in the interrupt subdevice is always
initialized to '0'. Remove this unneeded information from the subdevice 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>
10 years agostaging: comedi: pcmmio: remove 'asic' member from subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:06 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove 'asic' member from subdevice private data

This member of the subdevice private data is always initialized to '0' by
the only subdevice that uses it. Since we only have one asic on the board
it's really not needed. Just 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>
10 years agostaging: comedi: pcmmio: remove unnecessary for () loop and sanity check
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:05 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove unnecessary for () loop and sanity check

There is only one asic on the board so the for () loop in the interrupt
handler to check multiple asics is not needed.

The sanity check of the 'irq' in the interrupt handler is also not needed.
If it _is_ wrong we have bigger problems in the kernel.

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>
10 years agostaging: comedi: pcmmio: unwind the digital i/o subdevice init
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:04 +0000 (15:31 -0700)]
staging: comedi: pcmmio: unwind the digital i/o subdevice init

The board supported by this driver only has one asic that provides the
two digital i/o subdevices. The first dio subdevice has 24 channels that
support interrupts. The second dio subdevice also has 24 channels but no
interrupt support.

To make the code clearer and easier to maintain, remove the for () loop
that initialized these subdevices.

Also, correctly initialize the interrupt subdevice. The current code does
not set the SDF_CMD_READ subdev_flag and does not set the dev->read_subdev
pointer in the comedi_device.

Use the dev->read_subdev pointer in the interrupt handler to get the
interrupt subdevice and private data pointer instead of searching for
them. To keep this patch reviewable, the extra indents in interrupt_pcmmio()
will be removed later.

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>
10 years agostaging: comedi: pcmmio: simplify pcmmio_stop_intr()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:03 +0000 (15:31 -0700)]
staging: comedi: pcmmio: simplify pcmmio_stop_intr()

This function is only called by the interrupt subdevice so the sanity
check of the 'asic' is not necessary. Remove it.

The 'nports' is always 3 and the 'firstport' is always 0. Remove the
for () loop that clears the registers to disable the interrupts and
just use the pcmmio_dio_write() helper to write to the three page
registers.

This also fixes a bug where the write to the page registers is not
protected with the spinlock.

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>
10 years agostaging: comedi: pcmmio: remove 'iobases' from the subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:02 +0000 (15:31 -0700)]
staging: comedi: pcmmio: remove 'iobases' from the subdevice private data

This member of the subdevice private data is not 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>
10 years agostaging: comedi: pcmmio: simplify pcmmio_dio_insn_bits()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:01 +0000 (15:31 -0700)]
staging: comedi: pcmmio: simplify pcmmio_dio_insn_bits()

Currently this function uses the subdevice private data to get the
iobase address needed to update the dio output channel state and
read the current state of the input channels. This subdevice private
data is in the process of being removed.

Use the subdevice 'index' to determine the base 'port' needed to
access the correct digital i/o registers. The pcmmio_dio_write()
function can then be used to update the outputs.

Introduce a new helper function, pcmmio_dio_read(), to read the
current state of the input 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>
10 years agostaging: comedi: pcmmio: simplify pcmmio_dio_insn_config()
H Hartley Sweeten [Mon, 9 Dec 2013 22:31:00 +0000 (15:31 -0700)]
staging: comedi: pcmmio: simplify pcmmio_dio_insn_config()

Currently this function uses the subdevice private data to get the
iobase address needed to update the channel configuration. This
subdevice private data is in the process of being removed.

Use the subdevice 'index' to determine the base 'port' needed to
access the correct digital i/o registers. The pcmmio_dio_write()
function can then be used to update the configuration.

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>
10 years agostaging: comedi: pcmmio: introduce pcmmio_dio_write()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:59 +0000 (15:30 -0700)]
staging: comedi: pcmmio: introduce pcmmio_dio_write()

The paged registers in the asic need to be spinlock protected to
ensure that the page is not changed while writing to the registers.

Introduce a helper function to make sure the spinlock is used.

Use the new helper in pcmmio_reset(). This is one of the places where
the spinlock is not used.

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>
10 years agostaging: comedi: pcmmio: rename 'spinlock' in the private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:58 +0000 (15:30 -0700)]
staging: comedi: pcmmio: rename 'spinlock' in the private data

This spinlock_t is meant to protect the page registers in the asic.
Rename it to make this clear.

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>
10 years agostaging: comedi: pcmmio: remove 'subpriv' macro
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:57 +0000 (15:30 -0700)]
staging: comedi: pcmmio: remove 'subpriv' macro

This macro relies on a local variable having a specific name. Remove
the macro and add a local variable where used.

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>
10 years agostaging: comedi: pcmmio: cleanup the digital i/o register defines
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:56 +0000 (15:30 -0700)]
staging: comedi: pcmmio: cleanup the digital i/o register defines

Redefine the registers used to access the digital i/o so that they
are based on the dev->iobase of the board instead of the 'asic_iobase'
that is stored in the private data.

Remove the then unused 'asic_iobase'.

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>
10 years agostaging: comedi: pcmmio: tidy up init_asics()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:55 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up init_asics()

Rename this function so it has namespace associated with the driver.

The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o. Remove the unnecessary for () loop
that would reset multiple asics.

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>
10 years agostaging: comedi: pcmmio: remove 'asic' parameter from switch_page()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:54 +0000 (15:30 -0700)]
staging: comedi: pcmmio: remove 'asic' parameter from switch_page()

The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o.

Remove the unnecessary 'asic' parameter that is passed to switch_page().

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>
10 years agostaging: comedi: pcmmio: there is only one asic
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:53 +0000 (15:30 -0700)]
staging: comedi: pcmmio: there is only one asic

The board supported by this driver only has one WinSystems WS16C48 asic
on it that handles the digital i/o.

Remove the 'asics' struct array in the private data and add members for
the single 'asic_iobase' and the spinlock used by the asic.

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>
10 years agostaging: comedi: pcmmio: remove unused members in private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:52 +0000 (15:30 -0700)]
staging: comedi: pcmmio: remove unused members in private data

The 'pol' and 'enab' members in the private data are never used. The
'num' member is set during the attach but never 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>
10 years agostaging: comedi: pcmmio: tidy up the irq request
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:51 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up the irq request

The for () loop that does the request_irq() in this driver is a bit of
an overkill. The code appears to have been copied from the pcmuio driver
which supports boards with 1 or 2 ASIC devices. The board supported by
this driver only has 1 ASIC.

Simplify the code and store the irq number in the comedi_device. This
allows the core to automatically do the free_irq() when the driver is
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>
10 years agostaging: comedi: pcmmio: tidy up the ao subdevice init
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:50 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up the ao subdevice init

Add some whitespace to the analog output subdevice init and reorder the
init to follow the "norm" in comedi drivers.

Remove the init of len_chanlist. This member is only used for subdevices
the support async commands. The core will default the value correctly.

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>
10 years agostaging: comedi: pcmmio: tidy up ao_rinsn()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:49 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up ao_rinsn()

Rename this function so it has namespace associated with the driver.

Move the 'chan' local variable out of the for () loop. The 'chan' is
constant for the comedi_insn and only needs to be fetched once from
the insn->chanspec.

Also, remove the sanity check of the chan. The comedi core will ensure
that the chan is valid for the subdevice before calling this 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>
10 years agostaging: comedi: pcmmio: return error if ao conversion times out
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:48 +0000 (15:30 -0700)]
staging: comedi: pcmmio: return error if ao conversion times out

Rename wait_dac_ready() so it has namespace associated with the
driver.

Fix the function so it returns an errno if the conversion times
out. Propogate this errno if it happens.

Define the analog output status register to remove the magic numbers.

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>
10 years agostaging: comedi: pcmmio: cleanup ao_winsn()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:47 +0000 (15:30 -0700)]
staging: comedi: pcmmio: cleanup ao_winsn()

Rename this function to have namespace associated with the driver.

Refactor the function to remove the extra write to the command register
to set the range before writing the DAC value. Since the range is constant
for the entire comedi_insn it only needs to be set once. All writes to the
DAC after that will use the same range.

Define the register map for the analog output 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>
10 years agostaging: comedi: pcmmio: remove 'iobase' from subdevice private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:46 +0000 (15:30 -0700)]
staging: comedi: pcmmio: remove 'iobase' from subdevice private data

The 'iobase' is only used to pass the iobase address of the analog output
registers to ao_winsn(). This address is simply dev->iobase + 8.

Use that instead and remove the 'iobase' from the subdevice private data.
This removes a couple more uses of the ugly 'subpriv' macro.

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>
10 years agostaging: comedi: pcmmio: move ao shadow data to device private data
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:45 +0000 (15:30 -0700)]
staging: comedi: pcmmio: move ao shadow data to device private data

There is only one ai subdevice in this driver so there is no reason
to hold the last sample written to each channel in the subdevice
private data. Move the data into the device private data,

This gets some of the data out of the subdevice private data union
and removes some of the uses of the ugly 'subpriv' macro.

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>
10 years agostaging: comedi: pcmmio: tidy up the ai subdevice init
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:44 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up the ai subdevice init

Add some whitespace to the ai subdevice init and reorder it a bit
to follow the "norm" in comedi drivers.

Remove the init of s->len_chanlist. This member is only used with
subdevices that support async commands. The core will default the
value correctly..

The ai subdevice only uses the s->private member to pass the iobase
to the analog input registers. It's just a copy of the dev->iobase,
use that instead.

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>
10 years agostaging: comedi: pcmmio: define the offset to the 2nd ADC device
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:43 +0000 (15:30 -0700)]
staging: comedi: pcmmio: define the offset to the 2nd ADC device

There are two ADC devices on this board. The first one handles ai
channels 0-7 and the second one channels 8-15.

Define the offset that is added to the iobase to access the 2nd
ADC 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>
10 years agostaging: comedi: pcmmio: return error if ai conversion times out
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:42 +0000 (15:30 -0700)]
staging: comedi: pcmmio: return error if ai conversion times out

Rename adc_wait_ready() so it has namespace associated with the
driver.

Fix the function so it returns an errno if the conversion times
out. Propogate this errno if it happens.

Define the analog input status register to remove the magic numbers.

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>
10 years agostaging: comedi: pcmmio: cleanup ai_rinsn()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:41 +0000 (15:30 -0700)]
staging: comedi: pcmmio: cleanup ai_rinsn()

Rename this function to have namespace associated with the driver.

Refactor the function to remove the extra write to the command register
between each ADC conversion. We only need to do one dummy conversion in
order to flush the serial ADC. After that each command will return the
result of the previous conversion.

Define the register map for the analog input 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>
10 years agostaging: comedi: pcmmio: use core helpers to munge bipolar ai data
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:40 +0000 (15:30 -0700)]
staging: comedi: pcmmio: use core helpers to munge bipolar ai data

Use the comedi_range_is_bipolar() and comedi_offset_munge() helpers to
munge the bipolar analog input 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>
10 years agostaging: comedi: pcmmio: cleanup comedi_lrange tables
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:39 +0000 (15:30 -0700)]
staging: comedi: pcmmio: cleanup comedi_lrange tables

Use the BIP_RANGE and UNI_RANGE macros where appropriate instead of
the more generic RANGE macro.

Rename the range tables so they have namespace associated with the
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>
10 years agostaging: comedi: pcmmio: tidy up switch_page()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:38 +0000 (15:30 -0700)]
staging: comedi: pcmmio: tidy up switch_page()

All the I/O ports are left unlocked in the driver so the 'pagelock'
in the private data is not necessary. The paranoia sanity checks
are also unnecessary, 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>
10 years agostaging: comedi: pcmmio: remove unused {lock, unlock}_port()
H Hartley Sweeten [Mon, 9 Dec 2013 22:30:37 +0000 (15:30 -0700)]
staging: comedi: pcmmio: remove unused {lock, unlock}_port()

These functions are #ifdef'ed out and not needed in the driver.
Just 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>
10 years agoStaging: bcm: DDRInit: fixed issues w/ indentation.
Gary Rookard [Fri, 13 Dec 2013 12:05:56 +0000 (07:05 -0500)]
Staging: bcm: DDRInit: fixed issues w/ indentation.

restructured the levels of indentation to follow the linux
kernel coding style thus fixing checkpatch errors and warnings
respectfully.

Signed-off-by: Gary Alan Rookard <garyrookard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: gdm72xx: Fix WARNING space prohibited before semicolon in gdm_qos.c
Masanari Iida [Fri, 13 Dec 2013 18:32:53 +0000 (03:32 +0900)]
staging: gdm72xx: Fix WARNING space prohibited before semicolon in gdm_qos.c

Fixed WARNING: space prohibited before semicolon
found by checkpatch.pl in gdm_qos.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rts5139: fix parantheses coding style issue in ms.c
Preetam D'Souza [Sat, 14 Dec 2013 03:13:47 +0000 (19:13 -0800)]
Staging: rts5139: fix parantheses coding style issue in ms.c

This patch fixes an unnecessary return statement parantheses error
found in ms.c by the checkpatch.pl tool.

Signed-off-by: Preetam D'Souza <preetamjdsouza@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgrp: Fix space prohibited before semicolon
Masanari Iida [Tue, 17 Dec 2013 12:14:16 +0000 (21:14 +0900)]
staging: dgrp: Fix space prohibited before semicolon

This patch fixed "WARNING: space prohibited before semicoloni"
found by checkpatch.pl within dgrp_tty.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: xillybus: fix error return code in xilly_probe()
Wei Yongjun [Mon, 16 Dec 2013 05:51:16 +0000 (13:51 +0800)]
staging: xillybus: fix error return code in xilly_probe()

Fix to return negative error code -EIO from the error handling
case instead of 0.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lustre/libcfs
Masanari Iida [Fri, 13 Dec 2013 17:24:06 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lustre/libcfs

Correct spelling typo in lustre/lustre/libcfs

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lustre/fld and ldlm
Masanari Iida [Fri, 13 Dec 2013 17:24:05 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lustre/fld and ldlm

Correct spelling typo in luster/lustre/fld and ldlm.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lustre/osc
Masanari Iida [Fri, 13 Dec 2013 17:24:04 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lustre/osc

Correct spelling typo in lustre/lustre/osc

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lustre/lmv
Masanari Iida [Fri, 13 Dec 2013 17:24:03 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lustre/lmv

Fix spelling typo in lustre/lustre/lmv

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lustre/lov
Masanari Iida [Fri, 13 Dec 2013 17:24:02 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lustre/lov

Correct spelling typo in lustre/lustre/lov

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Fix typo in lustre/lnet/selftest
Masanari Iida [Fri, 13 Dec 2013 17:24:01 +0000 (02:24 +0900)]
staging: lustre: Fix typo in lustre/lnet/selftest

Correct spelling typo in lustre/lnet/selftest

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: dgap: Fixed trailing white space from dgap_conf.h
Masanari Iida [Fri, 13 Dec 2013 17:49:25 +0000 (02:49 +0900)]
staging: dgap: Fixed trailing white space from dgap_conf.h

This patch fixes "ERROR: trailing whitespace" found by
checkpatch.pl.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Fix possible null pointer dereference
John Stultz [Tue, 17 Dec 2013 05:07:52 +0000 (21:07 -0800)]
staging: ion: Fix possible null pointer dereference

The kbuild test robot reported:

drivers/staging/android/ion/ion_system_heap.c:122 alloc_largest_available() error: potential null dereference 'info'.  (kmalloc returns null)

Where the pointer returned from kmalloc goes unchecked for failure.

This patch checks the return for NULL, and reworks the logic, as
suggested by Colin, so we allocate the page_info structure first.

Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: ion: Add HAVE_MEMBLOCK config dependency
John Stultz [Tue, 17 Dec 2013 05:07:51 +0000 (21:07 -0800)]
staging: ion: Add HAVE_MEMBLOCK config dependency

The kbuild test robot reported a build issue w/ ION on m68k:

drivers/staging/android/ion/ion.c: In function 'ion_reserve':
drivers/staging/android/ion/ion.c:1526:4: error: implicit declaration of function 'memblock_alloc_base' [-Werror=implicit-function-declaration]
drivers/staging/android/ion/ion.c:1528:11: error: 'MEMBLOCK_ALLOC_ANYWHERE' undeclared (first use in this function)
drivers/staging/android/ion/ion.c:1528:11: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/android/ion/ion.c:1537:4: error: implicit declaration of function 'memblock_reserve' [-Werror=implicit-function-declaration]
   cc1: some warnings being treated as errors

This is caused by ION using memblock functionality which m68k doesn't support.

This patch adds a HAVE_MEMBLOCK dependency to the ION config.

Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agogpu: ion: fix sparse non static symbol warnings
Wei Yongjun [Tue, 17 Dec 2013 03:20:22 +0000 (11:20 +0800)]
gpu: ion: fix sparse non static symbol warnings

Fixes the following sparse warnings:

drivers/staging/android/ion/tegra/tegra_ion.c:23:19: warning:
 symbol 'idev' was not declared. Should it be static?
drivers/staging/android/ion/tegra/tegra_ion.c:24:19: warning:
 symbol 'tegra_user_mapper' was not declared. Should it be static?
drivers/staging/android/ion/tegra/tegra_ion.c:25:5: warning:
 symbol 'num_heaps' was not declared. Should it be static?
drivers/staging/android/ion/tegra/tegra_ion.c:26:17: warning:
 symbol 'heaps' was not declared. Should it be static?
drivers/staging/android/ion/tegra/tegra_ion.c:28:5: warning:
 symbol 'tegra_ion_probe' was not declared. Should it be static?
drivers/staging/android/ion/tegra/tegra_ion.c:66:5: warning:
 symbol 'tegra_ion_remove' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agogpu: ion: use module_platform_driver to simplify the code
Wei Yongjun [Tue, 17 Dec 2013 03:16:41 +0000 (11:16 +0800)]
gpu: ion: use module_platform_driver to simplify the code

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoion: remove ion_user_handle_t from ion_test.h
Colin Cross [Tue, 17 Dec 2013 00:48:17 +0000 (16:48 -0800)]
ion: remove ion_user_handle_t from ion_test.h

ion_test.h should not define ion_user_handle_t, and defining it
causes a warning:
In file included from drivers/staging/android/ion/ion_test.c:31:
drivers/staging/android/ion/../uapi/ion_test.h:23: error: redefinition of typedef 'ion_user_handle_t'
drivers/staging/android/ion/../uapi/ion.h:23: note: previous declaration of 'ion_user_handle_t' was here

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoMerge 3.13-rc4 into staging-next.
Greg Kroah-Hartman [Tue, 17 Dec 2013 01:12:04 +0000 (17:12 -0800)]
Merge 3.13-rc4 into staging-next.

We want the fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoLinux 3.13-rc4
Linus Torvalds [Sun, 15 Dec 2013 20:31:33 +0000 (12:31 -0800)]
Linux 3.13-rc4

11 years agonull_blk: mem garbage on NUMA systems during init
Matias Bjorling [Tue, 10 Dec 2013 15:50:38 +0000 (16:50 +0100)]
null_blk: mem garbage on NUMA systems during init

For NUMA systems, initializing the blk-mq layer and using per node hctx.
We initialize submit queues to 1, while blk-mq nr_hw_queues is
initialized to the number of NUMA nodes.

This makes the null_init_hctx function overwrite memory outside of what
it allocated.  In my case it lead to writing garbage into struct
request_queue's mq_map.

Signed-off-by: Matias Bjorling <m@bjorling.me>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoradeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh()
Sergey Senozhatsky [Thu, 12 Dec 2013 23:25:57 +0000 (02:25 +0300)]
radeon_pm: fix oops in hwmon_attributes_visible() and radeon_hwmon_show_temp_thresh()

Since commit ec39f64bba34 ("drm/radeon/dpm: Convert to use
devm_hwmon_register_with_groups") radeon_hwmon_init() is using
hwmon_device_register_with_groups(), which sets `rdev' as a device
private driver_data, while hwmon_attributes_visible() and
radeon_hwmon_show_temp_thresh() are still waiting for `drm_device'.

Fix them by using dev_get_drvdata(), in order to avoid this oops:

  BUG: unable to handle kernel paging request at 0000000000001e28
  IP: [<ffffffffa02ae8b4>] hwmon_attributes_visible+0x18/0x3d [radeon]
  PGD 15057e067 PUD 151a8e067 PMD 0
  Oops: 0000 [#1] PREEMPT SMP
  Call Trace:
    internal_create_group+0x114/0x1d9
    sysfs_create_group+0xe/0x10
    sysfs_create_groups+0x22/0x5f
    device_add+0x34f/0x501
    device_register+0x15/0x18
    hwmon_device_register_with_groups+0xb5/0xed
    radeon_hwmon_init+0x56/0x7c [radeon]
    radeon_pm_init+0x134/0x7e5 [radeon]
    radeon_modeset_init+0x75f/0x8ed [radeon]
    radeon_driver_load_kms+0xc6/0x187 [radeon]
    drm_dev_register+0xf9/0x1b4 [drm]
    drm_get_pci_dev+0x98/0x129 [drm]
    radeon_pci_probe+0xa3/0xac [radeon]
    pci_device_probe+0x6e/0xcf
    driver_probe_device+0x98/0x1c4
    __driver_attach+0x5c/0x7e
    bus_for_each_dev+0x7b/0x85
    driver_attach+0x19/0x1b
    bus_add_driver+0x104/0x1ce
    driver_register+0x89/0xc5
    __pci_register_driver+0x58/0x5b
    drm_pci_init+0x86/0xea [drm]
    radeon_init+0x97/0x1000 [radeon]
    do_one_initcall+0x7f/0x117
    load_module+0x1583/0x1bb4
    SyS_init_module+0xa0/0xaf

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>