platform/kernel/linux-rpi.git
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>
9 years agostaging: comedi: multiq3: tidy up multiq3_encoder_insn_read()
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:17 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up multiq3_encoder_insn_read()

Encoders are not a "normal" subdevice in comedi. For aesthetics, tidy
up this function and add a couple comments to clarify the function and
explain the strange munging of the data.

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 define
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:16 +0000 (15:33 -0700)]
staging: comedi: multiq3: remove unnecessary define

This define is not needed. Remove it.

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: allow user to reset encoder channels
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:15 +0000 (15:33 -0700)]
staging: comedi: multiq3: allow user to reset encoder channels

Currently this driver resets all the encoder channels when the driver
is first attached. Add a (*insn_config) to the subdevice to allow the
use to reset the channels manually.

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: document the encoder chip commands
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:14 +0000 (15:33 -0700)]
staging: comedi: multiq3: document the encoder chip commands

Add some comments to document the commands that are sent to the
encoder chips.

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: tidy up control register bit defines
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:13 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up control register bit defines

For aesthetics, move these defines closer to the register define and
use the BIT macro to define the bits.

Add macros to set the bits needed to select the channel for the analog
output, analog input, and encoder (counter) subdevices as well as the
realtime clock registers.

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: introduce multiq3_set_ctrl()
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:12 +0000 (15:33 -0700)]
staging: comedi: multiq3: introduce multiq3_set_ctrl()

According to the programming manual. the 'SH' and 'CLK' bits in the
control register need to be kept high at all times. Clarify this by
introducing a helper function to set the control register.

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: tidy up status register bit defines
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:11 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up status register bit defines

For aesthetics, move these defines closer to the register define and
use the BIT macro to define the bits.

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: tidy up register map defines
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:10 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up register map defines

For auesthetics, rename the register map defines. Convert the offset
values to hex and add some whitespace.

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: tidy up subdevice init
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:09 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up subdevice init

For aesthetics, add some whitespace to the subdevice init and rearrange
the initialization a bit.

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: tidy up multiq3_ai_insn_read()
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:08 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up multiq3_ai_insn_read()

For aesthetics, use the proper symbol when reading the A/D data register
to get the 16-bit sample data.

Use the comedi_offset_munge() to do the 2's complement to offset binary
munging of the sample data.

Tidy up the function a bit.

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: tidy up multi-line comments
H Hartley Sweeten [Mon, 5 Oct 2015 22:33:07 +0000 (15:33 -0700)]
staging: comedi: multiq3: tidy up multi-line comments

Reformat the multi-line comments in the kernel CodingStyle.

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: quatech_daqp_cs: avoid calculating pacer divisor multiple times
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:11 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: avoid calculating pacer divisor multiple times

The pacer will either be used to trigger each conversion or to start each
scan. Modify the (*do_cmdtest) so that one one divisor calculation is needed.
Save the divisor value in the private data so that the (*do_cmd) does not
have to do the calculation again.

Signed-off-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: quatech_daqp_cs: ai async command requires a pacer
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:10 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: ai async command requires a pacer

The ai (*do_cmd) assumes that either the convert_src is TRIG_TIMER or
the scan_begin_src is TRIG_TIMER and always programs the pacer clock
with the appropriate trigger argument.

Add a Step 2b check to the (*do_cmdtest) to ensure that at least one
of the triggers is TRIG_TIMER.

Signed-off-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: quatech_daqp_cs: cleanup Step 3 of ai (*do_cmdtest)
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:09 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: cleanup Step 3 of ai (*do_cmdtest)

Step 3 of the (*do_cmdtest) trivially validates the async command arguments.
The validations also modify the arguments if they are invalid so that the
user gets valid values if the test fails.

Reorder the checks so that if any of the checks fail proper values are
used for subsequent checks.

Signed-off-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: quatech_daqp_cs: fix daqp_ai_cancel()
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:08 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: fix daqp_ai_cancel()

Make sure interrupts are disabled and the event flags are cleared when
an analog input async command is canceled.

Remove the unnecessary calls to stop any running conversions in the
(*insn_read) and (*do_cmd) functions. The comedi core will only call
these functions if the subdevice is not busy (it has already been
canceled).

Signed-off-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: quatech_daqp_cs: handle shared interrupt
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:07 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: handle shared interrupt

This is a PCMCIA driver and interrupts are always shared. Detect if
the hardware did not produce the interrupt and return IRQ_NONE so
that other drivers might handle 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: quatech_daqp_cs: remove 'interrupt_mode'
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:06 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: remove 'interrupt_mode'

The interrupt handler is now only used for the ai async command.
Remove the unnecessary 'interrupt_mode' from the private data and
tidy up the interrupt handler.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: quatech_daqp_cs: only hook up cmd support if we have an IRQ
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:05 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: only hook up cmd support if we have an IRQ

Interrupts are only needed by this driver to support the analog input async
commands. Don't hook up the command support if pcmcia_request_irq() fails
instead of completely failing the (*auto_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: quatech_daqp_cs: don't use interrupts for ai (*insn_read)
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:04 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: don't use interrupts for ai (*insn_read)

The comedi (*insn_read) functions are supposed to do simple one-shot
reading of an analog input channel. Currently this driver enables
interrupts and uses wait_for_completion_interruptible() to allow the
interrupt routine to let the analog input (*insn_read) know that
the end-of-conversion has occured.

Simplify the function by using the comedi_timeout() helper to check
the aux status register to see when the conversion is finished.

Signed-off-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: quatech_daqp_cs: tidy up aux register bitss
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:03 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: tidy up aux register bitss

For aesthetics, and use the BIT macro to define the bits and
define some macros for the timer mode and d/a update 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: quatech_daqp_cs: document the 16-bit registers
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:02 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: document the 16-bit registers

All the registers are 8-bit except for the analog output and timer
registers. For clarity, add some 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: quatech_daqp_cs: tidy up command register bits
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:01 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: tidy up command register bits

For aesthetics, move the bit defines for this register and use the
BIT macro to define the bits. Define a macro for the scanrate bits
and use it to remove the CamelCase. Rename the defines to match 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: quatech_daqp_cs: tidy up status register bits
H Hartley Sweeten [Mon, 5 Oct 2015 21:23:00 +0000 (14:23 -0700)]
staging: comedi: quatech_daqp_cs: tidy up status register bits

For aesthetics, move the bit defines for this register and 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>
9 years agostaging: comedi: quatech_daqp_cs: tidy up control register bits
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:59 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: tidy up control register bits

For aesthetics, move the bit defines for this register and use the
BIT macro to define the bits. Rename the defines to match 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: quatech_daqp_cs: tidy up scanlist register bits
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:58 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: tidy up scanlist register bits

For aesthetics, move the bit defines for this register and 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>
9 years agostaging: comedi: quatech_daqp_cs: rename register offsets
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:57 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: rename register offsets

For aesthetics, rename the register map defines and convert the
values to hex. Also, move the private data definition and
DAQP_FIFO_SIZE define after the register definitions.

Signed-off-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: quatech_daqp_cs: tidy up multi-line comments
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:56 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: 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: quatech_daqp_cs: introduce daqp_clear_events()
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:55 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: introduce daqp_clear_events()

Introduce a helper function for the common code used to clear any
pending interrupts.

Signed-off-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: quatech_daqp_cs: redefine pacer clock options
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:54 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: redefine pacer clock options

For aesthetics, define a macro for the pacer clock options and rename
the CamelCase.

Remove the unnecessary local variables used to set the control 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: quatech_daqp_cs: spaces preferred around that '<<'
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:53 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: spaces preferred around that '<<'

Fix the checkpatch.pl issues about:
CHECK: spaces preferred around that '<<' (ctx:VxV)

Signed-off-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: quatech_daqp_cs: use comedi_timeout() in ao (*insn_write)
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:52 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: use comedi_timeout() in ao (*insn_write)

The data link between the D/A data port and the D/A converter is a serial
link. The serial link requires about 8ms to complete a transfer. Use the
comedi_timeout() helper to ensure that there is not a previous transfer
still happening before trying to write new data to the channel.

For aesthetics, save the readback value after updating the hardware.

Signed-off-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: quatech_daqp_cs: use comedi_offset_munge() in ao (*insn_write)
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:51 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: use comedi_offset_munge() in ao (*insn_write)

Use the comedi_offset_munge() helper to do the offset binary to two's
complement conversion when writing a new analog output value.

Signed-off-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: quatech_daqp_cs: introduce daqp_ai_get_sample()
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:50 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: introduce daqp_ai_get_sample()

Introduce a helper function to get a two's complement sample from
the FIFO and munge it to the offset binary format that comedi uses.

Signed-off-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: quatech_daqp_cs: there are 4 digital inputs
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:49 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: there are 4 digital inputs

This board has 4 digital inputs not 1. Fix the subdevice init.

The digital input lines are shared with other functions. Add a
comment about 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: quatech_daqp_cs: there are 4 digital outputs
H Hartley Sweeten [Mon, 5 Oct 2015 21:22:48 +0000 (14:22 -0700)]
staging: comedi: quatech_daqp_cs: there are 4 digital outputs

This board has 4 digital outputs not 1. Fix the subdevice init.

The digital output lines are used for the external channel selection
when the expansion mode is enabled. Add a comment about 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: pcm3724: update the MODULE_DESCRIPTION
H Hartley Sweeten [Thu, 1 Oct 2015 18:59:29 +0000 (11:59 -0700)]
staging: comedi: pcm3724: 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>
9 years agostaging: comedi: pcm3724: tidy up register map defines
H Hartley Sweeten [Thu, 1 Oct 2015 18:59:28 +0000 (11:59 -0700)]
staging: comedi: pcm3724: tidy up register map defines

For aesthetics, rename the register map defines so they have namespace
associated with the driver and use the BIT macro to define the bits.

Add the missing defines for the registers and use them to remove the
magic values from the driver.

Add a comment about the extra registers to explain why this driver
doesn't just use the standard 8255 driver 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>
9 years agostaging: comedi: pcm3724: tidy up multi-line comments
H Hartley Sweeten [Thu, 1 Oct 2015 18:59:27 +0000 (11:59 -0700)]
staging: comedi: pcm3724: 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 agodrivers/staging: make emxx_udc.c explicitly non-modular
Paul Gortmaker [Sun, 11 Oct 2015 19:47:34 +0000 (15:47 -0400)]
drivers/staging: make emxx_udc.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/staging/emxx_udc/Kconfig:config USB_EMXX
drivers/staging/emxx_udc/Kconfig:       bool "EMXX USB Function Device Controller"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

The .remove function was declared __exit, so it wouldn't have been
available for a sysfs bind/unbind anyway, so lets be explicit here and
use ".suppress_bind_attrs = true" to prevent root from doing something
silly.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Vincenzo Scotti <vinc94@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Cc: Tapasweni Pathak <tapaswenipathak@gmail.com>
Cc: Peter Chen <peter.chen@freescale.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>
Cc: Chris Rorvick <chris@rorvick.com>
Cc: "Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers/staging: make android timed_output.c explicitly non-modular
Paul Gortmaker [Sun, 11 Oct 2015 19:47:33 +0000 (15:47 -0400)]
drivers/staging: make android timed_output.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/staging/android/Kconfig:config ANDROID_TIMED_OUTPUT
drivers/staging/android/Kconfig:        bool "Timed output class driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We replace module.h with init.h and export.h ; the latter since this
file does actually export some symbols.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: "Arve Hjønnevåg" <arve@android.com>
Cc: Riley Andrews <riandrews@android.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>