openwrt/staging/blogic.git
8 years agoStaging: comedi: Fix comment issues in jr3_pci.c
Ravishankar Karkala Mallikarjunayya [Mon, 6 Jun 2016 11:01:17 +0000 (16:31 +0530)]
Staging: comedi: Fix comment issues in jr3_pci.c

This is a patch to the jr3_pci.c file that fixes up a
WARNING: 'Block comments use a trailing */ on a separate line'
found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi:Fix a warning issues in me_daq.c
Ravishankar Karkala Mallikarjunayya [Mon, 6 Jun 2016 11:01:16 +0000 (16:31 +0530)]
Staging: comedi:Fix a warning issues in me_daq.c

This is a patch to the me_daq.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: Indentation issue in mpc624.c
Ravishankar Karkala Mallikarjunayya [Mon, 6 Jun 2016 11:01:15 +0000 (16:31 +0530)]
Staging: comedi: Indentation issue in mpc624.c

This is a patch to the mpc624.c file that fixes up a
WARNING: 'Statements should start on a tabstop' found by
the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: adl_pci9118: fix spelling mistake "acqusition" -> "acquisition"
Colin Ian King [Sat, 4 Jun 2016 05:35:20 +0000 (06:35 +0100)]
staging: comedi: adl_pci9118: fix spelling mistake "acqusition" -> "acquisition"

trivial fix to spelling mistake

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_1564: remove unnecessary wdog register defines
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:43 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: remove unnecessary wdog register defines

The watchdog subdevice is supported using the addi_watchdog module and
it uses the register defines from addi_tcw.h. The only register define
needed it the iobase offset to the register block.

Remove the unnecessary defines and rename the iobase define.

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>
8 years agostaging: comedi: addi_apci_1564: rewrite the counter subdevice support
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:42 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: rewrite the counter subdevice support

Like the timer, the support functions for the counter subdevice are broken.

Rewrite the code to follow the comedi API.

The new implementation is based on the (minimal) datasheet I have from
ADDI-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>
8 years agostaging: comedi: addi_apci_1564: rewrite the timer subdevice support
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:41 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: rewrite the timer subdevice support

The support functions for the timer subdevice are broken.

1) The (*insn_write) assumes that insn->n is always 2 (data[1] is used)
2) The (*insn_read) assumes that insn->n is always 2 (data can be returned in
   data[0] and data[1]).
3) The (*insn_config) does not follow the API. It assumes insn->n is always 4
   (data[1], data[2] and data[3] are used). It also doesn't use data[0] to
   determine what the config "instruction" is.

Rewrite the code to follow the comedi API and add the missing comedi driver
comment block.

The new implementation is based on the (minimal) datasheet I have from
ADDI-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>
8 years agostaging: comedi: addi_apci_1564: use comedi_handle_event() for counters
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:40 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: use comedi_handle_event() for counters

The counter subdevice can generate an interrupt. Currently send_sig() is used
to let the task know when the interrupt occurs. Use the dev->read_subdev and
comedi_handle_events() instead.

Remove the, now unused, 'tsk_current' member from the private data and the
unnecessary include of <linux/sched.h>.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_1564: use comedi_handle_event() for timer
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:39 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: use comedi_handle_event() for timer

The timer subdevice can generate an interrupt. Currently send_sig() is used
to let the task know when the interrupt occurs. Use the dev->read_subdev
and comedi_handle_events() 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>
8 years agostaging: comedi: addi_apci_1564: clarify change-of-state interrupt support
H Hartley Sweeten [Wed, 8 Jun 2016 18:26:38 +0000 (11:26 -0700)]
staging: comedi: addi_apci_1564: clarify change-of-state interrupt support

This board supports change-of-state interrupts on digital inputs 4 to 19
not 0 to 15.

The current code "works" but it could set inappropriate bits in the mode1
and mode2 registers that setup which channels are enabled. It also doesn't
return the status of the upper 4 channels (19 to 16).

Fix the comment and mask the mode1/mode2 values so that only the interrupt
capable channels can be enabled.

Add the SDF_LSAMPL flag to the subdevice so that 32-bit samples are used
instead of 16-bit ones. This allows returning the upper 4 channels. Use
the remaining bits in the sample to return "event" flags to the user.

The timer and counter subdevices can also generate interrupts and are a bit
hacked. They don't currently follow the comedi API and they use send_sig()
to let the task that know that the interrupt occured. The "event" flags will
be used instead when these subdevices are fixed.

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>
8 years agostaging: comedi: plx9080.h: include headers for declarations
Ian Abbott [Fri, 20 May 2016 13:49:22 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: include headers for declarations

Add `#include` lines to declare stuff used by "plx9080.h" itself.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9080.h: Add kerneldoc comments
Ian Abbott [Fri, 20 May 2016 13:49:21 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: Add kerneldoc comments

Document the DMA descriptor `struct plx_dma_desc`, and the DMA abort
function `plx9080_abort_dma()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9080.h: tidy up some comments
Ian Abbott [Fri, 20 May 2016 13:49:20 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: tidy up some comments

Use the usual block comment style and remove some excess spaces from
single-line comments.  Remove some obvious stuff about register offsets
being zero relative.  Remove some text about the original history of the
file, as it bears hardly any resemblance to it now.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: add PLX PCI 9080 DMATHR register values
Ian Abbott [Fri, 20 May 2016 13:49:19 +0000 (14:49 +0100)]
staging: comedi: drivers: add PLX PCI 9080 DMATHR register values

Add macros in "plx9080.h" that define values for the DMATHR register
values.  Use the prefix `PLX_DMATHR_` for the macros.  Make use of the
`BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 DMACSRx register values
Ian Abbott [Fri, 20 May 2016 13:49:18 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 DMACSRx register values

Replace the existing macros in "plx9080.h" that define values for the
DMACSR0 and DMACSR0 registers.  Use the prefix `PLX_DMACSR_` for the
macros.  Make use of the `BIT(x)` macro to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 DMADPRx register values
Ian Abbott [Fri, 20 May 2016 13:49:17 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 DMADPRx register values

Replace the existing macros in "plx9080.h" that define values for the
DMADPR0 and DMADPR1 registers.  (A little-endian version of the register
value is also placed in the `next` member of `struct plx_dma_desc`.)
Use the prefix `PLX_DMADPR_` for the macros.  Make use of the `BIT(x)`
and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register values
Ian Abbott [Fri, 20 May 2016 13:49:16 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register values

Replace the existing macros in "plx9080.h" that define values for the
DMAMODE0 and DMAMODE1 registers.  Use the prefix `PLX_DMAMODE_` for the
macros.  Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define
the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9080.h: add hard-coded PCIHIDR register value
Ian Abbott [Fri, 20 May 2016 13:49:15 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: add hard-coded PCIHIDR register value

For the PLX PCI 9080, the read-only PCIHIDR register is hard-coded with
the value `0x908010b5`.  Add a macro `PLX_PCIHIDR_9080` that expands to
this value.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 CNTRL register values
Ian Abbott [Fri, 20 May 2016 13:49:14 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 CNTRL register values

Replace the existing macros in "plx9080.h" that define values for the
CNTRL register.  Use the prefix `PLX_CNTRL_` for the macros.  Make use
of the `BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 INTCSR register values
Ian Abbott [Fri, 20 May 2016 13:49:13 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 INTCSR register values

Replace the existing macros in "plx9080.h" that define values for the
INTCSR register.  Use the prefix `PLX_INTCSR_` for the macros.  Make use
of the `BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values
Ian Abbott [Fri, 20 May 2016 13:49:12 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values

Replace the existing macros in "plx9080.h" that define values for the
DMCFGA register.  Use the prefix `PLX_DMCFGA_` for the macros.  Make use
of the `BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 DMPBAM register values
Ian Abbott [Fri, 20 May 2016 13:49:11 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 DMPBAM register values

Replace the existing macros in "plx9080.h" that define values for the
DMPBAM register.  Use the prefix `PLX_DMPBAM_` for the macros.  Make use
of the `BIT(x)` and `GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 LBRDx register values
Ian Abbott [Fri, 20 May 2016 13:49:10 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 LBRDx register values

Replace the existing macros in "plx9080.h" that define values for the
LBRD0 and LBRD1 registers.  Use the prefix `PLX_LBRD_` for macros that
apply to both registers, `PLX_LBRD0_` for macros that apply only to the
LBRD0 register, and `PLX_LBRD1_` for macros that apply only to the LBRD1
register.  Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define
the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values
Ian Abbott [Fri, 20 May 2016 13:49:09 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values

Replace `enum bigend_bits` in "plx9080.h" with a bunch of macros
defining values for the BIGEND register.  Use the prefix `PLX_BIGEND_`
for the macro names.  Make use of the `BIT(x)` and `GENMASK(h,l)` macros
to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do PLX PCI 9080 MARBR register values
Ian Abbott [Fri, 20 May 2016 13:49:08 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do PLX PCI 9080 MARBR register values

Replace `enum marb_bits` in "plx9080.h" with a bunch of macros defining
values for the MARBR and DMAARB registers (which are the same
Mode/Arbitation register at two different offsets).  Use the prefix
`PLX_MARBR_` for the macros.  Make use of the `BIT(x)` and
`GENMASK(h,l)` macros to define the values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values
Ian Abbott [Fri, 20 May 2016 13:49:07 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values

Replace the existing macros in "plx9080.h" that define values for the
LAS0BA and LAS1BA registers.  Use the prefix `PLX_LASBA_` for the
macros.  Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define
the macros.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: re-do macros for PLX PCI 9080 LASxRR values
Ian Abbott [Fri, 20 May 2016 13:49:06 +0000 (14:49 +0100)]
staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxRR values

Rename the macros for the PLX PCI 9080 LAS0RR and LAS1RR registers in
"plx9080.h", using the prefix `PLX_LASRR_`.  Make use of the `BIT(x)`
and `GENMASK(h,l)` macros to define the values.

Define a macro `PLX_LASRR_PREFETCH` for the "prefetchable memory" bit in
this register, and define a macro `PLX_LASRR_MLOC_MASK` to mask the PCI
memory location control bits.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: rename PLX PCI 9080 register offsets
Ian Abbott [Fri, 20 May 2016 13:49:05 +0000 (14:49 +0100)]
staging: comedi: drivers: rename PLX PCI 9080 register offsets

Rename the macros in "plx9080.h" that define the offsets of registers,
following the pattern `PLX_REG_<NAME>`, where `<NAME>` is the register
name from the PLX PCI 9080 Data Book.

Add defines for the "Mailbox" registers, and add parameterized macros
for the mailbox registers and the DMA control registers.  Make use of
the parameterized versions of the macros where it seems appropriate.

The registers for supporting the I2O (Intelligent Input/Output) feature
are largely left undefined, just defining enough to allow the I2O
feature to be disabled.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9080.h: remove Power-Up Test Suite stuff
Ian Abbott [Fri, 20 May 2016 13:49:04 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: remove Power-Up Test Suite stuff

The defines related to the Power-Up Test Suite (PUTS) are just cruft that
has nothing to do with the PLX PCI-9080 chip.  They seem to have been
inherited from "drivers/net/plx9060.h" in the kernel 2.2.16 sources for
use by the "wanxl" driver.  Remove them.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: plx9080.h: correct LRNG_IO_MASK and LMAP_IO_MASK
Ian Abbott [Fri, 20 May 2016 13:49:03 +0000 (14:49 +0100)]
staging: comedi: plx9080.h: correct LRNG_IO_MASK and LMAP_IO_MASK

For the PLX local address space range registers, LAS0RR and LAS1RR, bit
0 indicates whether the local address space will be mapped to memory
space or I/O space.  If mapped to I/O space, bit 1 must be set to 0, and
bits 31 to 2 form the address decoding mask, which should be -2^N mod
2^32 for a range of length 2^N.

The `LRNG_IO_MASK` macro is supposed to specify the address decoding
bits for I/O space.  It currently has the value `0xfffffffa`, but should
be `0xfffffffc`, or possibly `0xfffffffe` (it doesn't really matter,
since bit 1 is required to be set to 0).  Change it to `0xfffffffc`.

Similarly, for the PLX local address space local base address (remap)
registers, LAS0BA and LAS1BA, bits 31 to 2, masked with the
corresponding "range" register form the local base address for the local
address space.  The `LMAP_IO_MASK` macro is supposed to mask the valid
bits for I/O space.  Change its value from `0xfffffffa` to `0xfffffffc`
to match `LRNG_IO_MASK`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: prefer usleep_range()
Ian Abbott [Thu, 19 May 2016 18:15:27 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: prefer usleep_range()

The checkpatch.pl warns about two `udelay(x)` calls, one of 100
microseconds, and one of 10 microseconds.  The 100 microseconds one is
used when waiting for FPGA to become ready to accept firmware, and is
not that critical, so replace it with a call to `usleep_range(100,
1000)`.  The 10 microseconds one is called as each 16-bit word of
firmware data is written.  Replace it with a fairly tight
`usleep_range(10, 20)` to avoid slowing down firmware loading too much.
The firmware is fairly short, so this would only slow it down firmware
loading by about 20 milliseconds or so.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename CamelCase functions
Ian Abbott [Thu, 19 May 2016 18:15:26 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename CamelCase functions

Rename functions to avoid CamelCase warnings from checkpatch, and to use
namespace associated with the driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename reference DACs register macros
Ian Abbott [Thu, 19 May 2016 18:15:25 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename reference DACs register macros

Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DB2K_REG_DACS_SET` for the value `0x0080`
that triggers setting one of the references.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename trigger control register macros
Ian Abbott [Thu, 19 May 2016 18:15:24 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename trigger control register macros

Rename the macros that define values for the trigger control register to
avoid CamelCase, and to make it clearer which register they are
associated with.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: redo DAC status macros and fix busy
Ian Abbott [Thu, 19 May 2016 18:15:23 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: redo DAC status macros and fix busy

Rename the macros defining values for the DAC status register to avoid
CamelCase, and to make it clear which register they are associated with.
Refactor the macros defining the regular DAC channel "busy" bits into a
single macro that takes the DAC channel number as a parameter.

Add a macro to define the offset of the read-only DAC status register.
It is the same offset as the DAC control register, which is write-only.

The code in `daqboard2000_ao_eoc()` that checks the status for
completion of the DAC conversion looks wrong.  The register has a "busy"
bit for each channel, but the existing code only works for channels 0
and 1.  The driver only supports two DAC channels at the moment, so the
bug is currently harmless, but fix it so we can support four DAC
channels on some board models.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: redo DAC control register macros
Ian Abbott [Thu, 19 May 2016 18:15:22 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: redo DAC control register macros

Rename the macros used to define values for the DAC control register to
avoid CamelCase and to make it clearer which register they are
associated with.  Refactor the macros used to define values to enable or
disable DAC channels to use the channel number as a parameter.  None of
these macros are currently used by the driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename acq status register macros
Ian Abbott [Thu, 19 May 2016 18:15:21 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename acq status register macros

Rename the macros associated with the acquisition status register to
avoid CamelCase and to make it clear which register they are associated
with.

Add a macro to define the offset of the read-only acquisition status
register.  It's the same offset as the acquisition control register,
which is write-only.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename acquisition control register macros
Ian Abbott [Thu, 19 May 2016 18:15:20 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename acquisition control register macros

Rename the macros defining values for the acquisition control register
to avoid CamelCase, and to make it clearer which register they are
associated with.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename register offset macros
Ian Abbott [Thu, 19 May 2016 18:15:19 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename register offset macros

Rename the macros defining register offsets to avoid CamelCase, and to
use namespace associated with the driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: rename serial EEPROM register macros
Ian Abbott [Thu, 19 May 2016 18:15:18 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: rename serial EEPROM register macros

Rename the macros defining values for the Serial EEPROM Control Register
to avoid CamelCase.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: add blank line after struct declaration
Ian Abbott [Thu, 19 May 2016 18:15:17 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: add blank line after struct declaration

Fix checkpatch issue: "CHECK: Please use a blank line after
function/struct/union/enum declarations".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: CHECK: spaces preferred around that '*'
Ian Abbott [Thu, 19 May 2016 18:15:16 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: CHECK: spaces preferred around that '*'

Fix checkpatch issues of the form "CHECK: spaces preferred around that
'*' (ctx:VxV)".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: use usual block comment style
Ian Abbott [Thu, 19 May 2016 18:15:15 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: use usual block comment style

Reformat one of the block comments to conform to the usual style (it's
the only one that doesn't).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: daqboard2000: remove commented out code
Ian Abbott [Thu, 19 May 2016 18:15:14 +0000 (19:15 +0100)]
staging: comedi: daqboard2000: remove commented out code

Remove some commented out code.  Some of it uses constructs that don't
exist in the driver, and probably come from the source code for the MS
Windows driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: fix CHECK: Prefer using the BIT macro issues in pcmmio.c
Ravishankar Karkala Mallikarjunayya [Wed, 18 May 2016 04:57:29 +0000 (10:27 +0530)]
Staging: comedi: fix CHECK: Prefer using the BIT macro issues in pcmmio.c

This patch Replace all occurences of (1<<x) by BIT(x) in the file pcmmio.c to
get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: Fix WARNING issue in dt2801.c
Ravishankar Karkala Mallikarjunayya [Tue, 17 May 2016 10:13:57 +0000 (15:43 +0530)]
Staging: comedi: Fix WARNING issue in dt2801.c

This is a patch to the dt2801.c file that fixes up a Block comments
issues found by the checkpatch.pl tool.

i.e. Block comments use a trailing */ on a separate line

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: s626: fix comment issue
Ravishankar Karkala Mallikarjunayya [Wed, 8 Jun 2016 09:48:54 +0000 (15:18 +0530)]
Staging: comedi: s626: fix comment issue

This fixes up a WARNING: 'Block comments use a trailing */ on a
separate line'found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt2811: add async command support for AI subdevice
H Hartley Sweeten [Wed, 4 May 2016 22:25:38 +0000 (15:25 -0700)]
staging: comedi: dt2811: add async command support for AI subdevice

The interrupt support available on this board is pretty limited but its
simple enough to give basic async command support.

This allows reading a single channel continuously using either the internal
or an external clock to trigger each conversion. The command can also use
the external trigger input to start the command if the external clock is
being used for 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>
8 years agoStaging: comedi: comedi_fops.c: Fixed coding style issue
Shyam Saini [Tue, 10 May 2016 15:51:07 +0000 (21:21 +0530)]
Staging: comedi: comedi_fops.c: Fixed coding style issue

Fixed following checkpatch.pl warnings
WARNING: Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>

WARNING: Prefer READ_ONCE(<FOO>) over ACCESS_ONCE(<FOO>)

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt2811: update the MODULE_DESCRIPTION
H Hartley Sweeten [Wed, 4 May 2016 19:47:24 +0000 (12:47 -0700)]
staging: comedi: dt2811: update the MODULE_DESCRIPTION

Change the MODULE_DESCRIPTION to something more useful than the generic
"Comedi low-level driver".

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt2811: rename 'boardtypes'
H Hartley Sweeten [Wed, 4 May 2016 19:47:23 +0000 (12:47 -0700)]
staging: comedi: dt2811: rename 'boardtypes'

Rename this array so it has 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>
8 years agostaging: comedi: dt2811: remove unused define
H Hartley Sweeten [Wed, 4 May 2016 19:47:22 +0000 (12:47 -0700)]
staging: comedi: dt2811: remove unused define

This define 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>
8 years agostaging: comedi: dt2811: tidy up analog input subdevice init
H Hartley Sweeten [Wed, 4 May 2016 19:47:21 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up analog input subdevice init

Add some whitespace to the analog output subdevice initialization
and rename the (*insn_read) 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>
8 years agostaging: comedi: dt2811: simplify analog input range options
H Hartley Sweeten [Wed, 4 May 2016 19:47:20 +0000 (12:47 -0700)]
staging: comedi: dt2811: simplify analog input range options

The A/D ranges are not programmable but the gain is. Currently this driver
uses a configuration option to select the comedi_lrange that will be used
for the analog input subdevice. This requires that the user makes sure the
correct option value is used.

The user space library uses the range information to convert between raw
values and physical units. If the user passed an incorrect option when
attaching the driver the conversion will be incorrect.

A previous patch allowed the gain to be set based on the chanspec range.
Prior to that the gain was always set to 1 so any conversion with a gain
that is not 1 would be incorrect anyway.

Simplify the analog input ranges by providing a range_table for the pgh and
pgl boards that contain all the possible range/gain options. The user can
then select the correct range (and gain) when converting values or reading
the analog inputs.

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>
8 years agostaging: comedi: dt2811: remove private data
H Hartley Sweeten [Wed, 4 May 2016 19:47:19 +0000 (12:47 -0700)]
staging: comedi: dt2811: remove private data

The remaining members of the private data are not used by the driver.
Remove it and the allocation.

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>
8 years agostaging: comedi: dt2811: simplify A/D reference configuration
H Hartley Sweeten [Wed, 4 May 2016 19:47:18 +0000 (12:47 -0700)]
staging: comedi: dt2811: simplify A/D reference configuration

The analog inputs are confgured with jumpers on the board to be:
  * 16 single-ended inputs
  * 8 differential inputs
  * 16 pseudo-differential inputs (common ground)

Simplify the handling of this configuration option and properly set
the subdev_flags based on the selected input mode.

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>
8 years agostaging: comedi: dt2811: tidy up analog output subdevice init
H Hartley Sweeten [Wed, 4 May 2016 19:47:17 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up analog output subdevice init

Add some whitespace to the analog output subdevice initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt2811: simplify analog output range options
H Hartley Sweeten [Wed, 4 May 2016 19:47:16 +0000 (12:47 -0700)]
staging: comedi: dt2811: simplify analog output range options

The D/A ranges are not programmable. Currently this driver uses some
configuration options to select the comedi_lrange for each channel.
This is a bit messy and it requires the user to make sure the correct
option value is used.

The range information isn't used by the driver. The user space library
uses it to convert between raw data values and physical units. If the
user passed an incorrect option when attaching the driver the conversion
will be incorrect.

Simplify the analog output ranges by providing a range_table that
contains all the possible output ranges. The user can then select the
correct range when converting 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>
8 years agostaging: comedi: dt2811: tidy up the digital subdevices
H Hartley Sweeten [Wed, 4 May 2016 19:47:15 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up the digital subdevices

Add some whitespace to the digital input and output subdevice
initialization. Reorder the initialization 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>
8 years agostaging: comedi: dt2811: tidy up Timer/Counter register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:14 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up Timer/Counter register defines

This register currently is not being used. For aesthetics, cleanup the
define and the comment about the frequency control.

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>
8 years agostaging: comedi: dt2811: tidy up Digital Input/Output register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:13 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up Digital Input/Output register defines

The digital input and outputs are separate ports even though they share the
same register offset. For aesthetics, define then separately and remove the
redundant information in the comment.

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>
8 years agostaging: comedi: dt2811: tidy up D/A Data register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:12 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up D/A Data register defines

Cleanup the defines for these registers and and remove the redundant
information in the comment.

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>
8 years agostaging: comedi: dt2811: tidy up A/D Data register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:11 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up A/D Data register defines

Cleanup the defines for these registers and and remove the redundant
information in the comment.

Tidy up the reading of the data registers in the (*insn_read).

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>
8 years agostaging: comedi: dt2811: tidy up A/D Gain/Channel register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:10 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up A/D Gain/Channel register defines

Cleanup the defines for this register and its bits and remove the
redundant information in the comment.

Make the (*insn_read) use the range to set the gain bits correctly.
Currently the gain is always set to 1.

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>
8 years agostaging: comedi: dt2811: tidy up A/D Control/Status register defines
H Hartley Sweeten [Wed, 4 May 2016 19:47:09 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up A/D Control/Status register defines

Cleanup the defines for this register and its bits and remove the
redundant information in the comment.

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>
8 years agostaging: comedi: dt2811: remove disabled code
H Hartley Sweeten [Wed, 4 May 2016 19:47:08 +0000 (12:47 -0700)]
staging: comedi: dt2811: remove disabled code

There is no reason the (*attach) should be trying to read an analog
input sample. Remove this disabled 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>
8 years agostaging: comedi: dt2811: remove redundant block comment
H Hartley Sweeten [Wed, 4 May 2016 19:47:07 +0000 (12:47 -0700)]
staging: comedi: dt2811: remove redundant block comment

The configuration options are listed in the comedi comment block.

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>
8 years agostaging: comedi: dt2811: tidy up copyright and comedi comments
H Hartley Sweeten [Wed, 4 May 2016 19:47:06 +0000 (12:47 -0700)]
staging: comedi: dt2811: tidy up copyright and comedi comments

Fix the checkpatch.pl issue:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:comedi:Use unsigned int instead of unsigned
Nikita Eshkeev [Tue, 3 May 2016 15:22:23 +0000 (18:22 +0300)]
staging:comedi:Use unsigned int instead of unsigned

This patch fixed the checkpatch.pl warning:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Nikita Eshkeev <kastolom@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: update the MODULE_DESCRIPTION
H Hartley Sweeten [Tue, 3 May 2016 19:30:03 +0000 (12:30 -0700)]
staging: comedi: das16m1: 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>
8 years agostaging: comedi: das16m1: rename struct das16m1_private_struct
H Hartley Sweeten [Tue, 3 May 2016 19:30:02 +0000 (12:30 -0700)]
staging: comedi: das16m1: rename struct das16m1_private_struct

For aesthetics, remove the redundant '_struct' suffix.

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>
8 years agostaging: comedi: das16m1: convert munge_sample_array() into a subdevice (*munge)
H Hartley Sweeten [Tue, 3 May 2016 19:30:01 +0000 (12:30 -0700)]
staging: comedi: das16m1: convert munge_sample_array() into a subdevice (*munge)

For aesthetics, convert this function into a subdevice (*munge) function and let
the comedi core handle the munging.

Add a comment about why the data needs to be munged.

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>
8 years agostaging: comedi: das16m1: minor cleanup to das16m1_ai_insn_read()
H Hartley Sweeten [Tue, 3 May 2016 19:30:00 +0000 (12:30 -0700)]
staging: comedi: das16m1: minor cleanup to das16m1_ai_insn_read()

The (*insn_read) functions return the number of data values read. The 'n'
value is correct but for clarity change the return to 'insn->n'.

For aesthetics, change the 'n' loop variable name to 'i'. That's more common
in comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: init local variables when declared
H Hartley Sweeten [Tue, 3 May 2016 19:29:59 +0000 (12:29 -0700)]
staging: comedi: das16m1: init local variables when declared

For aesthetics, init the comedi_subdevice, comedi_async, and comedi_cmd
pointers when the local variables are declared.

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>
8 years agostaging: comedi: das16m1: remove an unnecessery comment
H Hartley Sweeten [Tue, 3 May 2016 19:29:58 +0000 (12:29 -0700)]
staging: comedi: das16m1: remove an unnecessery comment

The configuration options are listed in the comedi comment block.

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>
8 years agostaging: comedi: das16m1: tidy up misc. defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:57 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up misc. defines

For aesthetics, move these after the register map defines and rename
the FIFO_SIZE define.

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>
8 years agostaging: comedi: das16m1: tidy up 8254/8255 register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:56 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up 8254/8255 register defines

For aesthetics, rename these defines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: tidy up digital output subdevice init
H Hartley Sweeten [Tue, 3 May 2016 19:29:55 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up digital output subdevice init

Add some whitespace to the subdevice init and rename the support
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>
8 years agostaging: comedi: das16m1: tidy up das16m1_di_insn_bits()
H Hartley Sweeten [Tue, 3 May 2016 19:29:54 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up das16m1_di_insn_bits()

The (*insn_bits) for a digital input subdevice only needs to return the
state of the inputs in data[1]. Remove the cruft.

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>
8 years agostaging: comedi: das16m1: tidy up digital input subdevice init
H Hartley Sweeten [Tue, 3 May 2016 19:29:53 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up digital input subdevice init

Add some whitespace to the subdevice init and rename the support
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>
8 years agostaging: comedi: das16m1: tidy up analog input subdevice init
H Hartley Sweeten [Tue, 3 May 2016 19:29:52 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up analog input subdevice init

Add some whitespace to the subdevice init and rename the support
functions.

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>
8 years agostaging: comedi: das16m1: introduce das16m1_ai_set_queue()
H Hartley Sweeten [Tue, 3 May 2016 19:29:51 +0000 (12:29 -0700)]
staging: comedi: das16m1: introduce das16m1_ai_set_queue()

Introduce a helper function to handle writing the channel/gain data to
the queue for single channel reads, (*insn_read), and multi-channel
scans, (*do_cmd).

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>
8 years agostaging: comedi: das16m1: tidy up queue register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:50 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up queue register defines

Rename these defines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: tidy up interrupt control register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:49 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up interrupt control register defines

Rename these defines and use the BIT macro to define the bits. Define
some macros for the multi-bit fields in the register.

Rename the private data 'control_state' member to better match the
register name.

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>
8 years agostaging: comedi: das16m1: remove unnecessary ai 'cancel' operations
H Hartley Sweeten [Tue, 3 May 2016 19:29:48 +0000 (12:29 -0700)]
staging: comedi: das16m1: remove unnecessary ai 'cancel' operations

The comedi core will only call the (*insn_read) and (*do_cmd) functions
if the subdevice is not "busy". All async commands are terminated by
a (*cancel) operation which clears the INTE and PACER_MASK bits in the
interrupt control register. These bits are also cleared when the driver
first attaches. There is no need for the (*insn_read) or (*do_cmd) to
duplicate the cancel.

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>
8 years agostaging: comedi: das16m1: tidy up clear interrupt register define
H Hartley Sweeten [Tue, 3 May 2016 19:29:47 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up clear interrupt register define

Rename this define and use a consistent comment throughout the code.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: tidy up digital input/output register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:46 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up digital input/output register defines

The digtial inputs and outputs are read/written using the same register
offset but they are different logical registers. Physically they are the
same register with the hi 4 bits returning the inputs and the lo 4 bits
driving the outputs.

For aesthetics, use two different defines for the 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>
8 years agostaging: comedi: das16m1: tidy up control/status register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:45 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up control/status register defines

Rename the defines for the control/status register/bits. Use the BIT
macro to define the bits.

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>
8 years agostaging: comedi: das16m1: tidy up analog input data register defines
H Hartley Sweeten [Tue, 3 May 2016 19:29:44 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up analog input data register defines

Convert the inline helper munge_sample() into a macro and rename the
defines for the analog input data register/bits. Use the register define
when accessing this register instead of just dev->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>
8 years agostaging: comedi: das16m1: tidy up register map comment
H Hartley Sweeten [Tue, 3 May 2016 19:29:43 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up register map comment

The comment about all the registers is not neccessary. The defines
give the same information. This also fixes a checkpatch.pl issue:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: das16m1: remove unnecessary private data comments
H Hartley Sweeten [Tue, 3 May 2016 19:29:42 +0000 (12:29 -0700)]
staging: comedi: das16m1: remove unnecessary private data comments

These comments are just extra cruft. Removing them also fixes a
checkpatch.pl issue:
WARNING: Block comments use a trailing */ on a separate line

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>
8 years agostaging: comedi: das16m1: tidy up comment in das16m1_cmd_exec()
H Hartley Sweeten [Tue, 3 May 2016 19:29:41 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up comment in das16m1_cmd_exec()

Fix the checkpatch.pl issue:
WARNING: Block comments use a trailing */ on a separate line

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>
8 years agostaging: comedi: das16m1: tidy up comments in das16m1_handler()
H Hartley Sweeten [Tue, 3 May 2016 19:29:40 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up comments in das16m1_handler()

Fix the checkpatch.pl issue:
WARNING: Block comments use a trailing */ on a separate line

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>
8 years agostaging: comedi: das16m1: tidy up copyright and comedi comments
H Hartley Sweeten [Tue, 3 May 2016 19:29:39 +0000 (12:29 -0700)]
staging: comedi: das16m1: tidy up copyright and comedi comments

Fix the checkpatch.pl issue:
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/libcfs: Remove "Please contact Oracle" from header
Oleg Drokin [Wed, 15 Jun 2016 03:33:43 +0000 (23:33 -0400)]
staging/lustre/libcfs: Remove "Please contact Oracle" from header

The "Please contact Oracle Corporation" lines are removed since not
only Oracle has nothing to do with Lustre anymore, there's a pointer
to GPL already that's independent of any particular company.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Remove stray line from selftest/selftest.h
Oleg Drokin [Wed, 15 Jun 2016 03:33:42 +0000 (23:33 -0400)]
staging/lustre: Remove stray line from selftest/selftest.h

The 'copy of GPLv2]' is an ending from template that's no longer needed,
so remove it to avoid any extra confusion.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/lov: Fix gpl URL in lov_pool.c
Oleg Drokin [Wed, 15 Jun 2016 03:33:41 +0000 (23:33 -0400)]
staging/lustre/lov: Fix gpl URL in lov_pool.c

There's no longer a matching sun.com URL, so refer to
gnu.org copy.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Replace sun.com GPLv2 URL with gnu.org one.
Oleg Drokin [Wed, 15 Jun 2016 03:33:40 +0000 (23:33 -0400)]
staging/lustre: Replace sun.com GPLv2 URL with gnu.org one.

http://www.sun.com/software/products/lustre/docs/GPLv2.pdf is no
longer around, so replae it with (hopefully more permanent)
http://http://www.gnu.org/licenses/gpl-2.0.html

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre: Remove the "Please contact SUN for GPL" from headers
Oleg Drokin [Wed, 15 Jun 2016 03:33:39 +0000 (23:33 -0400)]
staging/lustre: Remove the "Please contact SUN for GPL" from headers

Since SUN is no longer around and there's no point in contacting them,
just remove that whole thing. Copy of GPL is available online anyway
(URLs to be updated in next patch).

This patch was generated with:
find drivers/staging/lustre -name "*.[ch]" -exec perl -0777 -i -pe 's/ \* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,\n \* CA 95054 USA or visit www.sun.com if you need additional information or\n \* have any questions.\n \*\n//igs' {} \;

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: socklnd: remove typedefs
James Simmons [Fri, 10 Jun 2016 20:14:23 +0000 (16:14 -0400)]
staging: lustre: socklnd: remove typedefs

Remove all remaining typedefs in socklnd driver.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>