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