summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-07-06staging: comedi: das_08: use the 8253 helper functionsH Hartley Sweeten
Instead of open-coding the 8254 timer io, use the helper functions provided by 8253.h. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: removve unused 'ao_bits'H Hartley Sweeten
All the NI 670x boards have 16-bit anaolog output DACs. The 'ao_bits' in the boardinfo is not used so remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: cleanup ni_670x_dio_insn_bits()H Hartley Sweeten
Add local variable for the io_addr, mask. and bits used in this function so that the comments are not needed and the writel/readl calls are a bit cleaner. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: cleanup the boardinfoH Hartley Sweeten
For aesthetic reasons, reorder the boardinfo struct so that the 'name' pointer is first. Also, add some whitespace to the boardinfo to improve readability. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: fix dereference of an invalid pointerH Hartley Sweeten
The attach if this driver can fail before the subdevices are allocated. If the attach fails the comedi core will call the detach routine to allow the driver to do it's cleanup. We need to make sure that the subdevice allocation was successful before trying to dereference subdevice[0] to free the allocated range table list. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: return '0' for successful attachH Hartley Sweeten
The comedi core expects a < 0 value during the attach to indicate an error. The normal 'success' return for the kernel is '0' so use that here. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: change printk's to cleaned up dev_printk'sH Hartley Sweeten
Convert all the prink's in this file to dev_prink's. Change the INFO message in ni_670x_find_device into a dev_warn(). This message is only displayed if a matching device was not found. A warning is more appropriate here than info. Consolidate the attach messages into one dev_info() output after the successful attach. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: remove n_ni_670x_boards macroH Hartley Sweeten
This macro is simply the ARRAY_SIZE() of the boardinfo. Just use the ARRAY_SIZE and remove the macro. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: remove thisboard and devpriv macrosH Hartley Sweeten
The 'thisboard' and 'devpriv' macros rely on a local variable having a specific name and yield pointers derived from that local variable. Replace the macros with local variables where used. Use the comedi_board() helper to get the 'thisboard' pointer. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: remove forward declarationsH Hartley Sweeten
Move the attach and detach functions to remove the need for the forward declarations. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: ni_670x: use module_comedi_pci_driverH Hartley Sweeten
Refactor the driver to use the module_comedi_pci_driver() helper. This gets rid of some of the module boilerplate code. For aesthetic reasons, rename the comedi_driver and pci_driver to follow the convention of the other comedi pci drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: use the driver_name for the resource nameH Hartley Sweeten
Use the dev->driver->driver_name for the resource name passed to pci_request_regions(), by way of comedi_pci_enable(), instead of the open coded string "adl_pci6208". Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: cleanup pci6208_attach()H Hartley Sweeten
For aesthetic reasons, set the dev->board_name as soon as the thisboard pointer is available. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: cleanup pci6208_ao_rinsn()H Hartley Sweeten
For aesthetic reasons, reorder the local variables and change the return value to 'insn->n'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: cleanup pci6208_ao_winsn()H Hartley Sweeten
Use the defines for the register map to make the code a bit clearer. Shorten or rename some of the local variables for the same reason. Only the last value written to the DAC needs to be cached in the ao_readback variable. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: fix the ao_readback variable sizeH Hartley Sweeten
The 'ao_readback' variable in the private data struct is used to cache the last value written to the analog output DAC channels. The PCI-6208 has 8 analog output channels but the variable only allowed space to cache 2 values. Since the PCI-6216 board could be supported by this driver and it has 16 analog outputs, create a define for the maximum number of channels and use that to set the size of 'ao_readback'. For now, set the max to 8 to save space since the PCI-6216 is not currently supported. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove unused variable in the private dataH Hartley Sweeten
The 'data' variable in the private data struct is not used by the driver. Remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove some useless commentsH Hartley Sweeten
Remove a number of useless comments that are cut-and-paste from the skel driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove the bogus pci devicesH Hartley Sweeten
Remove the commented out pci device entries in the MODULE_DEVICE_TABLE as well as the associated boardinfo, which is also commented out. Add some whitespace to the boardinfo to improve readability. This driver should also support the pci-6216 card which has an additional 8 analog outputs (16 total). But the device id needs to be determined. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: return '0' for successful attachH Hartley Sweeten
The comedi core expects a < 0 value during the attach to indicate an error. The normal 'success' return for the kernel is '0' so use that here. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: add whitespace to the subdev initH Hartley Sweeten
Add whitespace to the subdev initialization and remove the unnecessary comments to improve readability. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: fix the digital i/o subdeviceH Hartley Sweeten
The PCI-6208 board has 4 digital outputs and 4 digital inputs. The support for the digital i/o subdevice was commented out and the code was just cut-and-paste from the skel driver. Enable the digital i/o subdevice by uncommenting the code and fixing the insn_bits and insn_config functions. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: consolidate the attach messagesH Hartley Sweeten
Consolidate the attach messages into one dev_info() output at the end of a successful attach. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: pass on the error code from comedi_pci_enableH Hartley Sweeten
Return the actual error code from comedi_pci_enable instead of assuming -EIO on failure. Also, shorten the local variable name 'retval' to 'ret'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove pci6208_pci_setup()H Hartley Sweeten
Refactor pci6208_pci_setup() into the attach function. This function simply enables the pci device and gets the PCI iobase address used by the driver. There's no need for a separate function to handle this. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: cleanup pci6208_pci_setup()H Hartley Sweeten
The "local configuration register" stuff is not required. The io base/range are only queried for use in a kernel message that it just added noise. Similar with the io range for the actual io base used by the driver. Remove both printk's and all the unnecessary code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: document the register map of the deviceH Hartley Sweeten
Add defines for the register map of the device. These will be used to clarify the code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove the boardinfo 'ao_bits'H Hartley Sweeten
All the boards supported by this driver have 16-bit DACs. The ao_bits variable in the boardinfo is commented out anyway. Just remove it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: refactor pci6208_find_device()H Hartley Sweeten
Make the "find pci device" functions consistent in the comedi drivers. Hopefully well be able to move it into the core... Refactor the "find pci device" function to return a pointer to the found struct pci_dev instead of an error code. Also, change some of the tests to reduce the indent level of the code. Pass the struct comedi_devconfig pointer to the function instead of the bus/slot numbers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: adl_pci6208: remove thisboard and devpriv macrosH Hartley Sweeten
The 'thisboard' and 'devpriv' macros rely on a local variable having a specific name and yield pointers derived from that local variable. Replace the macros with local variables where used. Use the comedi_board() helper to get the 'thisboard' pointer. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix dac08_write_insn()H Hartley Sweeten
As pointed out by Ian Abbott, the comedi INSN_WRITE instructions are meant to iterate over, and write, all the data[] passed from the comedi core. Modify dac08_write_insn() to work as intended. Since doc08_write_insn() now returns the proper response to the core, make the dac08_write() helper return void. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup dac08_write()H Hartley Sweeten
Reverse the logic of the test against the cached value so that the function only has one exit point. Make the logic of the dac write a bit clearer by create a local variable for the address used in the outw() calls and masking the value to write and setting the enable bits before doing the outw() calls. Add a comment just to make sure it's clear. Also, add a comment about the 'return 1;'. This should be insn->n which is the number of data parameters used to do the dac08_write_insn() but the insn is not a parameter to this function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup cb_pcidas_ai_rinsn()H Hartley Sweeten
Create local variables for the channel, range, and aref in order to make the remaining code a bit cleaner. Remove the extra space in all the comments. Remove the 'static const int timeout' and just use the open coded value in the loop. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup cb_pcidas_ao_nofifo_winsn()H Hartley Sweeten
Create local variables for the channel and range in order to cleanup to mask/set of the ao_control_bits. Remove the extra space in all the comments. Return the number of data parameters used (insn->n) to indicate success instead of the open coded '1'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup cb_pcidas_ao_fifo_winsn()H Hartley Sweeten
Create local variables for the channel and range in order to cleanup to mask/set of the ao_control_bits. Remove the extra space in all the comments. Return the number of data parameters used (insn->n) to indicate success instead of the open coded '1'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix remaining checkpatch.pl issuesH Hartley Sweeten
Fix the remaining three "WARNING: line over 80 characters" issues reported by checkpatch.pl. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: add whitespace to all the #define'sH Hartley Sweeten
Add whitespace to all the #define's in the driver in order to improve the readability. Fix all the comments that are, or already were, > 80 characters. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: change dac bit enums into definesH Hartley Sweeten
The 'bits' for the DAC_CSR register are currently defined as enums. All the other registers use defines for the bit definitions. Change the dac bit enums to defines to follow the other registers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix comments in private data structH Hartley Sweeten
A number of the comments in the private data struct definition are causing checkpatch.pl to complain about "WARNING: line over 80 characters". Fix the comments. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: remove 'volatile' on private data variablesH Hartley Sweeten
As indicated by checkpatch.pl, "WARNING: Use of volatile is usually wrong: ...". The variables in the private data that are marked volatile don't need to be. Remove the volatile. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix comments in *_cmdtest functionsH Hartley Sweeten
Remove some cut-and-paste comments from the skel driver in the *_cmdtest functions. Shorten some others to fix the checkpatch.pl complaints about WARNING: line over 80 characters. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix some > 80 char linesH Hartley Sweeten
Fix some of the comments that cause checkpatch.pl to complain about WARNING: line over 80 characters. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: fix a space before tab issueH Hartley Sweeten
As reported by checkpatch.pl, spaces should not be used before tabs. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: check for failure of subdev_8255_initH Hartley Sweeten
It's possible for subdev_8255_init() to fail due to its kzalloc(). Make sure to check for this failure and pass on the error code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: use the driver_name for the resource nameH Hartley Sweeten
Use the dev->driver->driver_name for the resource name passed to pci_request_regions(), by way of comedi_pci_enable(), and to request_irq() instead of the open coded "cb_pcidas". Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: move the "find pci" dev_printk messagesH Hartley Sweeten
Move the dev_printk messages associated with the "find pci device" from the *attach function into the *find_pci_device function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup ai_config_insn()H Hartley Sweeten
Absorb the helper function ai_config_calibration_source() into ai_config_insn() and remove the static const variable that was in the helper function. Return an error code (-EINVAL) when appropriate and the number of data values used (insn->n) for success. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup the boardinfo 4H Hartley Sweeten
For aesthetic reasons, rename the ai_se_chans variable to ai_nchan. It's a bit shorter and provides the necessary information about the variable. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup the boardinfo 3H Hartley Sweeten
Remove the ai_diff_chans variable. This option is not used in the driver. If it is used later, the value can be easily found by using ai_se_chans/2. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: comedi: cb_pcidas: cleanup the boardinfo 2H Hartley Sweeten
Remove all the boardinfo values that are = 0. They will default to that value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>