- 16 Jul, 2014 40 commits
-
-
H Hartley Sweeten authored
Currently the PCI6xxx boards use a different (*insn_write) function for the analog output subdevice. Most of the code is identical to the (*insn_write) used by all the other board types. For aesthetics, merge the two (*insn_write) functions and handle the 'is_6xxx' differences in the common 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
Currently ni_m_series_ao_config_chanlist() gets the boardinfo pointer in order to get the number of analog output channels. Get this from the comedi_subdevice instead. The ni_old_ao_config_chanlist() function also gets the boardinfo pointer to get the analog output resolution, 'aobits', in order to calculate the value needed to convert samples from unsigned to two's complement for bipolar ranges. Use the comedi_subdevice 'maxdata' 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>
-
H Hartley Sweeten authored
None of the boardinfo that uses this code sets the 'has_analog_trig' flag so ni_ai_config_analog_trig() always returns -EINVAL. Also, the private data 'atrig_low', 'atrig_high', and 'atrig_mode' values that are set by ni_ai_config_analog_trig() are never used. Remove the incomplete INSN_CONFIG_ANALOG_TRIG support along with the unused boardinfo and private data members. Signed-off-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 bytes_per_sample() helper instead of 'sizeof(short)' to clarify the length calculation. Use comedi_offset_munge() to handle the unsigned to two's complement munge of the data for bipolar ranges. Tidy up the local variables. Signed-off-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 board->reg_type if checked quite often in the ni_mio_common.c code to handle differences in the PCI devices supported by the ni_pcimio driver. Simplify the code a bit by adding some 'is_{board type}' bit-field flags to the private 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
Comedi (*insn_write) functions are expected to write insn->n values to the hardware. Fix this function to work like the core expects. Also, don't rely on the return value of ni_ao_comfig_chanlist() to determine if the values need converted to two's complement before writing to the hardware. Use the comedi_range_is_bipolar() and comedi_offset_munge() helpers to clarify the code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This marco relies on a local variable having a specific name. Remove the macro and just use ni_ao_win_outw() 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>
-
H Hartley Sweeten authored
Comedi (*insn_write) functions are expected to write insn->n values to the hardware. Fix this function to work like the core expects. Also, use the comedi_offset_munge() helper to convert the comedi unsigned values into the two's complement values that the hardware needs. Signed-off-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 member of the boardinfo for the NI MIO drivers is used to indicate if the ranges for the analog output subdevice (ao_range_table in the boardinfo) includes any unipolar ranges. If it's not set, the ao_range_table only has bipolar ranges. The 'ao_unipolar' flag is checked when munging the ao data values from the user so that the values for bipolar ranges are converted to 2's complement values before they are written to the hardware. The flag is also used when programming the analog output configuration on non-M series boards for bipolar/unipolar and external reference operation. Simplify the driver a bit by removing this boardinfo flag and just using the comedi_range_is_bipolar() and comedi_range_is_external() helpers to check the range 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>
-
H Hartley Sweeten authored
The comedi_krange includes a flags member that currently identifies the 'units' of the range (RF_UNIT) and if the range is from an internal or external source (RF_EXTERNAL). Introduce some helper functions to check if a given range is from an external source. Signed-off-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
Convert the inline MITE_* functions, used to calculate the mite channel register offsets, into simple macros. Signed-off-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, factor the code that disables the input filters out of ni_65xx_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>
-
H Hartley Sweeten authored
During the attach of this driver, the digital output ports are all initialized to a known state. Some of the boards supported by this driver have output ports that are inverted from the comedi view of the output state. For these boards the values written to the ports needs to be inverted. Currently, only bit 0 of each port is inverted when the boardinfo indicates that the outputs are inverted. This results in channels 0, 8, 16, etc. being set to '0' and all other channels being set to '1'. If the boardinfo does not indicate that the outputs are inverted, all the channels are set to '0'. This initialization is unnecessary for the input only ports. The input/output ports also do not need to be initialized since they are configured as inputs during the attach. Move the output port initialization so it occurs when the digital output subdevice is setup. Use the 's->io_bits' value to initialize the ports so that the correct inverted/non-inverted state is used for the comedi '0' 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>
-
H Hartley Sweeten authored
Some of the boards supported by this driver have output ports that are inverted from the comedi view of the output state. For these boards the read values from the output ports needs to be inverted before being modified and inverted again before being written back in the (*insn_bits) operation. Currently the subdevice type and the boardinfo is checked in the (*insn_bits) to determine if the inverted outputs need to be handled. Since thise driver does not use the subdevice 'io_bits', simplify the driver a bit by initializing the 'io_bits' during the attach to handle the inversion. Signed-off-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
Remove the need for the 'output_bits' in the private data by just reading the current state of the data port when updating the output channels in the (*insn_bits) function. Add a local variable to handle the inverting of the hardware values when the boardinfo indicates that the outputs are inverted. Rename the local variable 'port_read_bits' to 'bits' so that we can use it for updating the output channels and reading back the actual state to return to the user. Signed-off-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, tidy up the whitespace of this function declarations to follow the form in the rest of 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
Update the MODULE_DESCRIPTION to better describe 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
Clean up the multi-line comments at the beginning of the file so they follow 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
For aesthetics, add some whitespace to the comedi_driver declaration. Signed-off-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 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>
-
H Hartley Sweeten authored
Introduce some convienence macros to handle the port to channel, channel to port, and channel mask calculations based on the 8 channels per port of 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>
-
H Hartley Sweeten authored
Refactor this function to follow the standard (*insn_config) form. Add a sanity check of the number of data parameters (insn->n). Currently the core does not check INSN_CONFIG_CHANGE_NOTIFY. Fix the writes to the rise/fall edge enable registers. The macro expects a "port" value not the port offset 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>
-
H Hartley Sweeten authored
Subdevice 3 is used in this driver to provide edge detection of the input channels. Move the reset/disable of the interrupts and the request_irq() so that when subdevice 3 is setup we can conditionally hookup the async command support only if the irq is available. Also, remove the noise when the irq is not available. Signed-off-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
There is only one member in the subdevice private data, an unsigned value that is the 'base_port' that the subdevice uses to access the port registers. Just cast the appropriate value into s->private instead of allocating the private data for each subdevice. The casts are a bit of a nusance but it removes the unnecessary allocations. Signed-off-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 IO Select registers are readable. Remove the need for the 'dio_direction' member in the private data by just checking the register value for the INSN_CONFIG_DIO_QUERY instruction. Also, refactor the switch statement to return -EINVAL for unhandled instructions and have the (*insn_config) return insn->n normally. Signed-off-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 INSN_CONFIG_FILTER instruction is used to set the deglitch filter interval used to debounce the input channels. Absorb the helper function into the (*insn_config) function and refactor the code to not require the 'filter_interval' and 'filter_enable' members in the private 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
Convert the inline functions used to calculate the offsets to the recurring port registers and rename them to remove the CamelCase. Define all the recurring 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
Rename the CamelCase defines used for the non-recurring registers. Define all the non-recurring registers and 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
According to the register programming manual, the filter interval register is 32-bit. Fix the writes to this 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>
-
Erik Arfvidson authored
This patch adds the virtpci debugfs directory and the info entry inside of it. Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
The mite module provides the DMA interface for the PCI MITE ASIC used on many National Instruments DAQ boards. This driver does not use DMA and only depends on the mite module to initialize the MITE ASIC. Handle the initialization localy and remove the unnecessary dependancies. Signed-off-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 mite module provides the DMA interface for the PCI MITE ASIC used on many National Instruments DAQ boards. This driver does not use DMA and only depends on the mite module to initialize the MITE ASIC. Handle the initialization localy and remove the unnecessary dependancies. Signed-off-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 mite module provides the DMA interface for the PCI MITE ASIC used on many National Instruments DAQ boards. This driver does not use DMA and only depends on the mite module to initialize the MITE ASIC. Handle the initialization localy and remove the unnecessary dependancies. Signed-off-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 mite.h header is included only to pickup the MITE_IODWBSR and WENAB defines needed to set the data window (PCI BAR 1) when initializing the PCI MITE ASIC on the National Instruments boards supported by this driver. Remove the include of mite.h by adding the two defines locally in this 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>
-
Chase Southwood authored
Use the addi_watchdog module to provide support for the watchdog subdevice. Also, rearrange the subdevice init blocks so that the order makes sense. Digital input/output subdevices and subdevices for DI/DO interrupt support, followed by timer/counter/watchdog subdevices is the new order. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Chase Southwood authored
This driver no longer depends on anything in addi_common.h, save for a few headers that it was including indirectly. Remove the include of addi_common.h and add the includes of <linux/interrupt.h> and <linux/sched.h> directly. Signed-off-by: Chase Southwood <chase.southwood@gmail.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
KANG Yuxuan authored
Only fixing errors reported by checkpatch.pl, based on the following rules: 1. '*' should be adjacent to the data name or function name. 2. Don't use C99-style "// ..." comments. Signed-off-by: KANG Yuxuan <stonekyx@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Senna Tschudin authored
This patch cleanup the follwoing coding style issues: - indentation style - new line after declaration Tested by compilation only. Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Senna Tschudin authored
This patch cleanup the follwoing coding style issues: - line over 80 chars - spaces on the beginning of a line - put { and } on the correct places Tested by compilation only. Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Senna Tschudin authored
This patch cleanup coding style issues on comments. Tested by compilation only. Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-