- 13 Oct, 2015 40 commits
-
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-
H Hartley Sweeten authored
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>
-