openwrt/staging/blogic.git
9 years agostaging: comedi: adq12b: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 18:53:48 +0000 (11:53 -0700)]
staging: comedi: adq12b: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: adq12b: tidy up multi-line comments
H Hartley Sweeten [Fri, 9 Oct 2015 18:53:47 +0000 (11:53 -0700)]
staging: comedi: adq12b: tidy up multi-line comments

Reformat the multi-line comments in the kernel CodingStyle. And
refactor them to follow the normal format for 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>
9 years agostaging: comedi: dt3000: update the MODULE_DESCRIPTION
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:29 +0000 (10:48 -0700)]
staging: comedi: dt3000: update the MODULE_DESCRIPTION

Change the MODULE_DESCRIPTION to something more ueeful 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>
9 years agostaging: comedi: dt3000: remove #if 0'ed out code
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:28 +0000 (10:48 -0700)]
staging: comedi: dt3000: remove #if 0'ed out code

Replace the disabled code in dt3k_dio_config() with a comment in case
it's actually needed.

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>
9 years agostaging: comedi: dt3000: tidy up memory subdevice init
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:27 +0000 (10:48 -0700)]
staging: comedi: dt3000: tidy up memory subdevice init

Remove the unnecessary 'len_chanlist' initialization. This member is
only used by subdevices that support async commands.

For aesthetics, 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>
9 years agostaging: comedi: dt3000: tidy up digital i/o subdevice init
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:26 +0000 (10:48 -0700)]
staging: comedi: dt3000: tidy up digital i/o subdevice init

Remove the unnecessary 'len_chanlist' initialization. This member is
only used by subdevices that support async commands.

For aesthetics, 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>
9 years agostaging: comedi: dt3000: rename dt3k_ai_insn()
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:25 +0000 (10:48 -0700)]
staging: comedi: dt3000: rename dt3k_ai_insn()

For aesthetics, rename this subdevice (*insn_read) function to follow
the normal naming 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>
9 years agostaging: comedi: dt3000: the dt3002 board does not have analog outputs
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:24 +0000 (10:48 -0700)]
staging: comedi: dt3000: the dt3002 board does not have analog outputs

According to the boardinfo, the dt3002 board does not have analog outputs.
The rest of the board have two 12-bit analog output channels.

Replace the 'dachan' and 'dabits' members of the boardinfo with a bit-
field flag 'has_ao'. Use the new member to conditionally initialize
the analog output subdevice.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: dt3000: refactor 'adbits' boardinfo
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:23 +0000 (10:48 -0700)]
staging: comedi: dt3000: refactor 'adbits' boardinfo

All the board supported by this driver have analog inputs. The input
resolution is either 12-bit or 16-bit.

Replace the 'adbits' member of the boardinfo with a bit-field flag
'ai_is_16bits' and just set if for the 16-bit boards.

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>
9 years agostaging: comedi: dt3000: remove proc subdevice
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:22 +0000 (10:48 -0700)]
staging: comedi: dt3000: remove proc subdevice

This subdevice is not allocated or defined in the driver. Remove the
disabled 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>
9 years agostaging: comedi: dt3000: tidy up remaining defines
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:21 +0000 (10:48 -0700)]
staging: comedi: dt3000: tidy up remaining defines

Move the remaining defines and prefix them with 'DPR_' for consistency.

Define a macro to set the analog input trigger bits to fix the
checkpatch.pl issues about:

CHECK: spaces preferred around that '<<' (ctx:VxV)
CHECK: Prefer using the BIT 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>
9 years agostaging: comedi: dt3000: rename the interrupt flag defines
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:20 +0000 (10:48 -0700)]
staging: comedi: dt3000: rename the interrupt flag defines

For aesthetics, rename these defines so they have association
with the register. Move them closer to the register define and
use the BIT macro to define 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>
9 years agostaging: comedi: dt3000: rename the SUBS_* defines
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:19 +0000 (10:48 -0700)]
staging: comedi: dt3000: rename the SUBS_* defines

For aesthetics, rename these defines to avoid any confusion with the
similar comedi defines. Move them closer to the register they are
associated with.

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>
9 years agostaging: comedi: dt3000: tidy up the command mailbox defines
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:18 +0000 (10:48 -0700)]
staging: comedi: dt3000: tidy up the command mailbox defines

For aesthetics, rename these defines so they are associated with
the register. Move the defines closer to the register define.

Define some macros for the "completion" and "cmd" 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>
9 years agostaging: comedi: dt3000: rename dual-ported RAM location defines
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:17 +0000 (10:48 -0700)]
staging: comedi: dt3000: rename dual-ported RAM location defines

Rename these CamelCase defines and fix the checkpatch.pl issues:

CHECK: Avoid CamelCase: <DPR_{various}>
CHECK: spaces preferred around that '*' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)

For aesthetics, move the defines to after the includes.

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>
9 years agostaging: comedi: dt3000: tidy up multi-line comments
H Hartley Sweeten [Thu, 8 Oct 2015 17:48:16 +0000 (10:48 -0700)]
staging: comedi: dt3000: tidy up multi-line comments

Reformat the multi-line comments in the kernel 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>
9 years agostaging: comedi: adl_pci9118: rename Compute_and_setup_dma()
H Hartley Sweeten [Fri, 9 Oct 2015 18:09:35 +0000 (11:09 -0700)]
staging: comedi: adl_pci9118: rename Compute_and_setup_dma()

Rename this CamelCase 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>
9 years agostaging: comedi: adl_pci9118: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 18:09:34 +0000 (11:09 -0700)]
staging: comedi: adl_pci9118: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: addi_apci_2032: document the spinlock_t definition
H Hartley Sweeten [Fri, 9 Oct 2015 17:47:45 +0000 (10:47 -0700)]
staging: comedi: addi_apci_2032: document the spinlock_t definition

Add some comments to the private data tp quiet the checkpatch.pl
issue about:

CHECK: spinlock_t definition without 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>
9 years agostaging: comedi: addi_apci_2032: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 17:47:44 +0000 (10:47 -0700)]
staging: comedi: addi_apci_2032: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: ii_pci20kc: update the MODULE_DESCRIPTION
H Hartley Sweeten [Thu, 8 Oct 2015 17:30:45 +0000 (10:30 -0700)]
staging: comedi: ii_pci20kc: 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>
9 years agostaging: comedi: ii_pci20kc: use comedi_offset_munge()
H Hartley Sweeten [Thu, 8 Oct 2015 17:30:44 +0000 (10:30 -0700)]
staging: comedi: ii_pci20kc: use comedi_offset_munge()

For aesthetics, use the helper function to handle the munging of the
analog output data from offset binary to 2's complement and the analog
input data from 2's complement to offset binary.

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>
9 years agostaging: comedi: ii_pci20kc: prefer using the BIT macro
H Hartley Sweeten [Thu, 8 Oct 2015 17:30:43 +0000 (10:30 -0700)]
staging: comedi: ii_pci20kc: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: dt9812: reword comments to fix checkpatch.pl issues
H Hartley Sweeten [Wed, 7 Oct 2015 22:58:44 +0000 (15:58 -0700)]
staging: comedi: dt9812: reword comments to fix checkpatch.pl issues

Reword the block comments to fix the checkpatch.pl issues about:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

For consistency, also reword the previous comments.

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>
9 years agostaging: comedi: dt9812: rename F020_MASK_DACxCN_DACxEN
H Hartley Sweeten [Wed, 7 Oct 2015 22:58:43 +0000 (15:58 -0700)]
staging: comedi: dt9812: rename F020_MASK_DACxCN_DACxEN

Rename this CamelCase 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>
9 years agostaging: comedi: dt9812: tidy up multi-line comment
H Hartley Sweeten [Wed, 7 Oct 2015 22:58:42 +0000 (15:58 -0700)]
staging: comedi: dt9812: tidy up multi-line comment

Reformat the multi-line comment in the kernel 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>
9 years agostaging: comedi: icp_multi: update the MODULE_DESCRIPTION
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:49 +0000 (14:52 -0700)]
staging: comedi: icp_multi: 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>
9 years agostaging: comedi: icp_multi: remove board reset during (*detach)
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:48 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove board reset during (*detach)

The icp_multi_reset() function currnelt does the following during the
(*auto_attach) and (*detach) of this driver:

  1) disables all interrupts and clears any pending requests
  2) resets the analog output channels to 0V (0..5V range)
  3) sets all digital output channels to 0

Interrupts are not used by this driver so the disable/clear when
detaching is not necessary.

Depending on the use, reseting the analog and digital outputs when the
driver is detached might not be desireable.

Remove the board reset during the (*detach) and use comedi_pci_detach()
directly.

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>
9 years agostaging: comedi: icp_multi: tidy up subdevice init
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:47 +0000 (14:52 -0700)]
staging: comedi: icp_multi: tidy up subdevice init

For aesthetics, add some whitespace to the subdevice initialization.

Remove the unnecessary initialization of the 'len_chanlist' for each
subdevice. That member is only used by subdevices that support async
commands.

Also, remove the initialzation of the dev->read_subdev. That member
is also only used for async command support.

Rename some of the subdevice functions to follow the normal format
used 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>
9 years agostaging: comedi: icp_multi: remove counter subdevice
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:46 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove counter subdevice

The support functions for this subdevice are not complete. Since the
counter is the last subdevice just remove it and it's 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>
9 years agostaging: comedi: icp_multi: fix clock comment CodingStyle
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:45 +0000 (14:52 -0700)]
staging: comedi: icp_multi: fix clock comment CodingStyle

Reword the block comment to fix a CodingStyle issue.

For aesthetics, also rename the icp_multi_ao_eoc() function. It's testing
for the analog output to be 'ready' not for an 'end-of-conversion'.

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>
9 years agostaging: comedi: icp_multi: remove private data member 'DacCmdStatus'
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:44 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove private data member 'DacCmdStatus'

This private data member isn't really needed. The two functions
that use it, icp_multi_ao_insn_write() and icp_multi_reset(), mask
any previous value before setting the bits. The masking just clears
the variable.

Refactor the code to not use the private data member. This also
removes the need for the private data so remove it's allocation
during the attach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: icp_multi: remove check_channel_list()
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:43 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove check_channel_list()

This function would only be needed in the driver supported async
commands. It's #if 0'ed out anyway so 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>
9 years agostaging: comedi: icp_multi: remove useless interrupt disable code
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:42 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove useless interrupt disable code

This driver does not use interrupts and all the interrupt source are
disabled by icp_multi_reset() when the board is first attached.

Remove the unnecessary, and useless, disable and clearing of interrupts
in the analog input and output (*insn_read) and (*insn_write) functions.

This also removes the need for the private data members 'IntEnable' and
'IntStatus'.

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>
9 years agostaging: comedi: icp_multi: remove interrupt support
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:41 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove interrupt support

The interrupt handler in this driver doesn't do anything other than
read the interrupt status register. Since I can't locate a datasheet
for the board, remove the useless interrupt support 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>
9 years agostaging: comedi: icp_multi: absorb setup_channel_list()
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:40 +0000 (14:52 -0700)]
staging: comedi: icp_multi: absorb setup_channel_list()

This function is only called in one place and the 'n_chan' parameter
is always 1. This makes the for() loop a bit silly.

Absorb the function into the caller and simplify the code. This also
removes the need for the private data member 'AdcCmdStatus'.

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>
9 years agostaging: comedi: icp_multi: remove unused members from private data
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:39 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove unused members from private data

These members are either not used at all or they are set but never
used. 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>
9 years agostaging: comedi: icp_multi: remove unnecessary block comment
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:38 +0000 (14:52 -0700)]
staging: comedi: icp_multi: remove unnecessary block comment

This comment doesn't add any value to the code. 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>
9 years agostaging: comedi: icp_multi: rename static variable 'range_analog'
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:37 +0000 (14:52 -0700)]
staging: comedi: icp_multi: rename static variable 'range_analog'

For aesthetics, rename this static variable 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>
9 years agostaging: comedi: icp_multi: tidy up the interrupt enable/status register bits
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:36 +0000 (14:52 -0700)]
staging: comedi: icp_multi: tidy up the interrupt enable/status register bits

For aesthetics, rename these bit defines so they are associated with
the registers and use the BIT macro to define 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>
9 years agostaging: comedi: icp_multi: tidy up the DAC command/status register bits
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:35 +0000 (14:52 -0700)]
staging: comedi: icp_multi: tidy up the DAC command/status register bits

For aesthetics, rename these bit defines so they are associated with
the register and use the BIT macro to define 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>
9 years agostaging: comedi: icp_multi: tidy up the ADC command/status register bits
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:34 +0000 (14:52 -0700)]
staging: comedi: icp_multi: tidy up the ADC command/status register bits

For aesthetics, rename these bit defines so they are associated with
the register and use the BIT macro to define 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>
9 years agostaging: comedi: icp_multi: tidy up multi-line comments
H Hartley Sweeten [Wed, 7 Oct 2015 21:52:33 +0000 (14:52 -0700)]
staging: comedi: icp_multi: tidy up multi-line comments

Reformat the multi-line comments in the kernel 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>
9 years agostaging: comedi: me_daq: fix me_ai_insn_read()
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:44 +0000 (17:23 -0700)]
staging: comedi: me_daq: fix me_ai_insn_read()

The comedi core expects (*insn_read) functions to return insn->n data
values. Refactor the function to work like the core expects. For
aesthetics, use the comedi_offset_munge() helper to munge the 2's
complement data.

This also fixes a minor issue when comedi_timeout() times out. Currently
this function just returns which leaves the ADC mode programmed for
software triggering. With the refactor the ADC mode is always disabled
when the function exits. This allows removing the unnecessary steps to
"stop any running conversions" at the start of the 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>
9 years agostaging: comedi: me_daq: allow differential analog inputs
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:43 +0000 (17:23 -0700)]
staging: comedi: me_daq: allow differential analog inputs

The ai (*insn_read) allows differential analog inputs but the subdevice
initialization is missing the SDF_DIFF subdev_flag to allow the user to
select this mode. Fix the subdevice init.

According to the manual, differential operation only works with the
first 8 channels and bipolar ranges. Add a check to the (*insn_read) to
ensure this.

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>
9 years agostaging: comedi: me_daq: tidy up counter registers
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:42 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up counter registers

For aesthetics, convert the counter registers into macros that take
the counter channel and return the correct register offset.

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>
9 years agostaging: comedi: me_daq: tidy up dac data registers
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:41 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up dac data registers

For aesthetics, use a macro that takes the analog output channel
and returns the correct offset for the data register.

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>
9 years agostaging: comedi: me_daq: use comedi_range_is_bipolar() helper
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:40 +0000 (17:23 -0700)]
staging: comedi: me_daq: use comedi_range_is_bipolar() helper

Use the helper function to determine if the dac bipolar bit needs
to be set.

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>
9 years agostaging: comedi: me_daq: remove useless for() loop
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:39 +0000 (17:23 -0700)]
staging: comedi: me_daq: remove useless for() loop

This for() loop isn't needed. Nothing in the loop uses the 'i'
variable. 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>
9 years agostaging: comedi: me_daq: tidy up dac control register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:38 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up dac control register defines

Redefine the dac control register bits as macros that take the
channel number and return the correct bit values.

This register needs to be read after the new values are written
in order to actually update the dac. For aesthetics, use the same
define to read and write 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>
9 years agostaging: comedi: me_daq: tidy up ai fifo/chanlist register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:37 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up ai fifo/chanlist register defines

Tidy up this register usage by defining some macros to set the channel
and gain bits. Add a define for the bit that enables differential mode.

Writing to this offset puts data in the ai chanlist fifo, reading from
it gets data from the ai data fifo. For aesthetics, use the same define
to read and write 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>
9 years agostaging: comedi: me_daq: tidy up timer data register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:36 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up timer data register defines

For aesthetics, convert the register defines into a macro that takes
the timer channel and returns the correct register offset.

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>
9 years agostaging: comedi: me_daq: tidy up digital i/o port register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:35 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up digital i/o port register defines

For aesthetics, add a _REG suffix to 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>
9 years agostaging: comedi: me_daq: tidy up status register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:34 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up status register defines

Rename the bits of this register so they have association with the
register. Use the BIT macro to define the bits.

Writing to the status register clears any pending interrupts. For
aesthetics, remove the ME_RESET_INTERRUPT define and just use the
ME_STATUS_REG define to write the register.

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>
9 years agostaging: comedi: me_daq: tidy up control 2 register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:33 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up control 2 register defines

Rename the bits of this register so they have association with the
register. Use the BIT macro to define the bits.

Reading the control 2 register updates the DAC registers. For
aesthetics, remove the MC_DAC_UPDATE define and just use the
ME_CTRL2_REG define to read the register.

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>
9 years agostaging: comedi: me_daq: tidy up control 1 register defines
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:32 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up control 1 register defines

Rename the bits of this register so they have association with the
register. Use the BIT macro to define the bits.

Add a macro to select the ADC mode and remove the magic value used
to stop conversion.

Reading the control 1 register starts an analog input conversion.
For aesthetics, remove the MC_ADC_START define and just use the
ME_CTRL1_REG define to read the register.

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>
9 years agostaging: comedi: me_daq: tidy up private data
H Hartley Sweeten [Wed, 7 Oct 2015 00:23:31 +0000 (17:23 -0700)]
staging: comedi: me_daq: tidy up private data

For aesthetics, rename the local variable used to access dev->private.
In comedi drivers this variable is typically named 'devpriv'.

For aesthetics, rename the private data members used to mirror the
write-only register to, slightly, shorter names.

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>
9 years agostaging: comedi: mf6x4: tidy up subdevice init
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:18 +0000 (11:11 -0700)]
staging: comedi: mf6x4: tidy up subdevice init

For aesthetics, add some whitespace to the subdevice initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: change type of local variable
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:17 +0000 (11:11 -0700)]
staging: comedi: mf6x4: change type of local variable

For aesthetics, change the type of this local variable to unsigned int.

This fixes the checkpatch.pl issue about:
CHECK: Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 60 +++++++++++++++++-----------------
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: refactor block comment
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:16 +0000 (11:11 -0700)]
staging: comedi: mf6x4: refactor block comment

Refactor this block comment to fix the checkpatch.pl issues:
WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 2 +-
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: rename private data 'gpio_R'
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:15 +0000 (11:11 -0700)]
staging: comedi: mf6x4: rename private data 'gpio_R'

Rename this CamelCase member of the private data.

For consistency, also rename the register defines associated with
this member.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 4 ++--
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: rename remaining BAR1 register defines
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:14 +0000 (11:11 -0700)]
staging: comedi: mf6x4: rename remaining BAR1 register defines

For consistency, rename the ADSTART and DAC register defines to add
a bit of clarity.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 16 ++++++++--------
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: rename the digital input register defines
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:13 +0000 (11:11 -0700)]
staging: comedi: mf6x4: rename the digital input register defines

For aesthetics, rename these defines to clarify them a bit.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 8 ++++----
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: remove unnecassary masking of digital outputs
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:12 +0000 (11:11 -0700)]
staging: comedi: mf6x4: remove unnecassary masking of digital outputs

THe 's->state' will always be in range for the 8 digital outputs.
Remove the unnecessary masking of the value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 6 +++---
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: A/D converter uses 2's complement coding
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:11 +0000 (11:11 -0700)]
staging: comedi: mf6x4: A/D converter uses 2's complement coding

According to the user's manual, the A/D converter uses 2's complement
coding. Use the comedi_offset_munge() helper to convert the data to
the offset binary format used by comedi.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 5 ++---
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: introduce a macro to select the AI channel
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:10 +0000 (11:11 -0700)]
staging: comedi: mf6x4: introduce a macro to select the AI channel

For aesthetics, use a macro to set the bit in the ADCTRL register that
selects an analog input channel.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 9 +++++----
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: sort the BAR1 register defines
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:09 +0000 (11:11 -0700)]
staging: comedi: mf6x4: sort the BAR1 register defines

For aesthetics, sort the defines in register order.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 10 +++++-----
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: remove unnecessary whitespace
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:08 +0000 (11:11 -0700)]
staging: comedi: mf6x4: remove unnecessary whitespace

For aesthetics, remove the extra whitespace and align all the register
defines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 8 +++-----
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: remove unnecessary defines
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:07 +0000 (11:11 -0700)]
staging: comedi: mf6x4: remove unnecessary defines

The MF6X4_DAC_R macro defines the offsets for all the DAC registers.
Remove the unnecessary defines for each register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 22 +++++++++++-----------
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: mf6x4: prefer using the BIT macro
H Hartley Sweeten [Tue, 6 Oct 2015 18:11:06 +0000 (11:11 -0700)]
staging: comedi: mf6x4: prefer using the BIT macro

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
 drivers/staging/comedi/drivers/mf6x4.c | 9 ---------
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: adv_pci1723: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 20:02:51 +0000 (13:02 -0700)]
staging: comedi: adv_pci1723: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: adv_pci1724: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 20:07:04 +0000 (13:07 -0700)]
staging: comedi: adv_pci1724: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: adl_pci6208: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 18:01:37 +0000 (11:01 -0700)]
staging: comedi: adl_pci6208: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: addi_apci_3xxx: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 17:58:55 +0000 (10:58 -0700)]
staging: comedi: addi_apci_3xxx: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: addi_apci_3120: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 17:56:34 +0000 (10:56 -0700)]
staging: comedi: addi_apci_3120: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: addi_apci_1032: prefer using the BIT macro
H Hartley Sweeten [Fri, 9 Oct 2015 17:32:14 +0000 (10:32 -0700)]
staging: comedi: addi_apci_1032: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: 8255_pci: prefer using the BIT macro
H Hartley Sweeten [Thu, 8 Oct 2015 20:05:02 +0000 (13:05 -0700)]
staging: comedi: 8255_pci: prefer using the BIT macro

As suggested by checkpatch.pl, use the BIT macro to define the
register 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>
9 years agostaging: comedi: fl512: usleep_range is preferred over udelay
H Hartley Sweeten [Wed, 7 Oct 2015 22:43:44 +0000 (15:43 -0700)]
staging: comedi: fl512: usleep_range is preferred over udelay

Fix checkpatch.pl issue:

CHECK: usleep_range is preferred over udelay; see
       Documentation/timers/timers-howto.txt

Replace the udelay() with usleep_range() with a reasonable upper limit.

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>
9 years agostaging: comedi: gsc_hpdi: use preferred kernel types
H Hartley Sweeten [Wed, 7 Oct 2015 22:31:09 +0000 (15:31 -0700)]
staging: comedi: gsc_hpdi: use preferred kernel types

Fix the checkpatch.pl issues about:

CHECK: Prefer kernel type 'u32' over 'uint32_t'
CHECK: Prefer kernel type 'u8' over 'uint8_t'

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>
9 years agostaging: comedi: ke_counter: prefer using the BIT macro
H Hartley Sweeten [Wed, 7 Oct 2015 00:35:18 +0000 (17:35 -0700)]
staging: comedi: ke_counter: prefer using the BIT macro

Use a macro to define the clock source options. This fixes the
checkpatch.pl issue about:

CHECK: Prefer using the BIT 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>
9 years agostaging: comedi: mpc624: change type of private data 'ai_speed'
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:34 +0000 (17:33 -0700)]
staging: comedi: mpc624: change type of private data 'ai_speed'

For aesthetics, change the type of this member to unsigned int.

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>
9 years agostaging: comedi: mpc624: use tabs for whitespace instead of spaces
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:33 +0000 (17:33 -0700)]
staging: comedi: mpc624: use tabs for whitespace instead of spaces

For aesthetics, use tabs instead of spaces for the whitespace in the
register 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>
9 years agostaging: comedi: mpc624: introduce mpc624_ai_get_sample()
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:32 +0000 (17:33 -0700)]
staging: comedi: mpc624: introduce mpc624_ai_get_sample()

Introduce a helper function to read the analog sample from the serially
connected A/D converter and handle the munging of the 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>
9 years agostaging: comedi: mpc624: rename mpc624_ai_rinsn()
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:31 +0000 (17:33 -0700)]
staging: comedi: mpc624: rename mpc624_ai_rinsn()

For aesthetics, rename this function to follow the normal convention
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>
9 years agostaging: comedi: mpc624: there are only 4 analog inputs
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:30 +0000 (17:33 -0700)]
staging: comedi: mpc624: there are only 4 analog inputs

According to the datasheet, this board has 4 differential analog
input channels not 8. Fix the subdevice init.

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>
9 years agostaging: comedi: mpc624: tidy up subdevice init
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:29 +0000 (17:33 -0700)]
staging: comedi: mpc624: tidy up subdevice init

For aesthetics, add some whitespace to the subdevice init. Remove the
unnecessary switch() code used to set the maxdata and range_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>
9 years agostaging: comedi: mpc624: update MODULE_DESCRIPTION
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:28 +0000 (17:33 -0700)]
staging: comedi: mpc624: update 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>
9 years agostaging: comedi: mpc624: tidy up the ai conversion speed code
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:27 +0000 (17:33 -0700)]
staging: comedi: mpc624: tidy up the ai conversion speed code

Rename the CamelCase private data 'ulConvertionRate' and MPC624_SPEED_*
defines.

Create a macro to set the OSR bits that set the ai conversion speed and
use it for the various MPC624_SPEED_* defines. Remove the unnecessary
comment describing the speeds, this information is alread in the comedi
driver 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>
9 years agostaging: comedi: mpc624: tidy up multi-line comments
H Hartley Sweeten [Tue, 6 Oct 2015 00:33:26 +0000 (17:33 -0700)]
staging: comedi: mpc624: tidy up multi-line comments

Reformat the multi-line comments in the kernel 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>
9 years agostaging: comedi: pcl711: prefer using the BIT marco
H Hartley Sweeten [Mon, 5 Oct 2015 22:49:54 +0000 (15:49 -0700)]
staging: comedi: pcl711: prefer using the BIT marco

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: pcl812: rename private data 'IRQbits'
H Hartley Sweeten [Mon, 5 Oct 2015 22:47:27 +0000 (15:47 -0700)]
staging: comedi: pcl812: rename private data 'IRQbits'

Rename this CamelCase symbol.

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>
9 years agostaging: comedi: pcl812: prefer using the BIT macro
H Hartley Sweeten [Mon, 5 Oct 2015 22:47:26 +0000 (15:47 -0700)]
staging: comedi: pcl812: prefer using the BIT macro

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: pcl812: convert hardware type defines into an enum
H Hartley Sweeten [Mon, 5 Oct 2015 22:47:25 +0000 (15:47 -0700)]
staging: comedi: pcl812: convert hardware type defines into an enum

For aesthetics, convert these defines into an enum and rename the
CamelCase. Fix the switch() code to use the enum without warnings.

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>
9 years agostaging: comedi: pcl816: remove #if 0'ed out code
H Hartley Sweeten [Mon, 5 Oct 2015 22:44:04 +0000 (15:44 -0700)]
staging: comedi: pcl816: remove #if 0'ed out code

Remove the #if 0'ed out code that would initialize an analog output
subdevice.

The hardware does not normally support an analog output subdevice.
Analog outputs are only supported with additional "piggyback" modules.
Support for these modules is not included in 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>
9 years agostaging: comedi: pcl816: prefer using the BIT macro
H Hartley Sweeten [Mon, 5 Oct 2015 22:44:03 +0000 (15:44 -0700)]
staging: comedi: pcl816: prefer using the BIT macro

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: pcl816: tidy up multi-line comments
H Hartley Sweeten [Mon, 5 Oct 2015 22:44:02 +0000 (15:44 -0700)]
staging: comedi: pcl816: tidy up multi-line comments

Reformat the multi-line comments in the kernel 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>
9 years agostaging: comedi: pcl818: remove unused "boards constants"
H Hartley Sweeten [Mon, 5 Oct 2015 22:40:23 +0000 (15:40 -0700)]
staging: comedi: pcl818: remove unused "boards constants"

These defines are not used. Remove them to get rid of the
checkpatch.pl issue about avoiding CamelCase.

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>
9 years agostaging: comedi: pcl818: prefer using the BIT macro
H Hartley Sweeten [Mon, 5 Oct 2015 22:40:22 +0000 (15:40 -0700)]
staging: comedi: pcl818: prefer using the BIT macro

Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: multiq3: update the MODULE_DESCRIPTION
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:20 +0000 (15:33 -0700)]
staging: comedi: multiq3: 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>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: multiq3: remove unnecessary include
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:18 +0000 (15:33 -0700)]
staging: comedi: multiq3: remove unnecessary include

This driver does not use interrupts. Remove the include.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>