summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
Commit message (Collapse)AuthorAgeFilesLines
* staging/comedi/adl_pci8164: Don't assign stringPeter Huewe2013-01-301-14/+14
| | | | | | | | | Assigning a string is really bad, and since we only have 1 char strings here we can simply use a char to store the value and change the format specifier. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: simplify comedi_set_hw_dev()Ian Abbott2013-01-301-11/+10Star
| | | | | | | | | | | | | | | | | Since `get_device()` and `put_device()` can take a NULL device parameter, `comedi_set_hw_dev()` can be simplified to always call `get_device()` for the new, possibly NULL hardware device, and `put_device()` for the old, possibly NULL hardware device. As long as we do it in that order, there shouldn't be any problem with `kref_release()` getting called unexpectedly when the new hardware device is the old hardware device. Simplify `comedi_set_hw_dev()` and update the comment because the function is used for additional purposes since the old comment was written. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: don't override read/write subdevice if not supportedIan Abbott2013-01-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | For comedi devices that support asynchronous commands on some of their subdevices, the comedi core creates extra device files for each of those subdevices of the form "/dev/comedi%i_subd%i". These use the same comedi device as the corresponding "/dev/comedi%i" but override the default "read" and "write" subdevice for the device. Currently it overrides both the read and write subdevice, but it only makes sense to override the "read" subdevice if the subdevice supports "read" commands, and to override the "write" subdevice if the subdevice supports "write" commands. In `comedi_alloc_subdevice_minor()`, only set `info->read_subdevice` non-NULL if the subdevice has the `SDF_CMD_READ` flag set, and only set `info->write_subdevice` non-NULL if the subdevice has the `SDF_CMD_WRITE` flag set. (`comedi_read_subdevice(info)` will use the device's default read subdevice if `info->read_subdevice` is NULL. `comedi_write_subdevice(info)` will use the device's default write subdevice if `info->write_subdevice` is NULL. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: ni_labpc_cs: remove '#undef LABPC_DEBUG'H Hartley Sweeten2013-01-301-2/+0Star
| | | | | | | | | The LABPC_DEBUG define is not used in any of the code. Just remove the #undef. 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>
* staging: comedi: ni_labpc_cs: cleanup the boardinfo declarationH Hartley Sweeten2013-01-301-27/+21Star
| | | | | | | | | | For aesthetic reasons, reformat the boardinfo declaration and add some whitespace. Remove all the information that is set to '0' as this is the default. 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>
* staging: comedi: ni_labpc_cs: remove thisboard macroH Hartley Sweeten2013-01-301-5/+1Star
| | | | | | | | | | | | The 'thisboard' macro relies on a local variable having a specific name and yields a pointer derived from that local variable. Replace the macro with a local variable and use the comedi_board() helper to get the 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>
* staging: comedi: ni_labpc_cs: move comedi_driver declarationH Hartley Sweeten2013-01-301-12/+10Star
| | | | | | | | | | | | | Move the comedi_driver declaration down in the file. This removes the need for the forward declaration. For aesthetic reasons, add some whitespace to the declaration and remove the unnecessary '&' before the function names. They are already addresses. 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>
* staging: comedi: ni_labpc_cs: remove pcmcia_device private dataH Hartley Sweeten2013-01-301-17/+2Star
| | | | | | | | | | | | The private data, struct local_info_t, is not being used in the driver. Remove it as well as the kzalloc/kfree. Also, don't set the 'pcmcia_cur_dev' variable unless the pcmcia configuration is successful. 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>
* staging: comedi: ni_labpc_cs: cleanup labpc_cs_attach()H Hartley Sweeten2013-01-301-23/+11Star
| | | | | | | | | | | Absorb the code from labpc_config() into this function and properly return the error if the configuration fails. Also, remove the dev_dbg() function trace message. 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>
* staging: comedi: ni_labpc_cs: move pcmcia_driver functionsH Hartley Sweeten2013-01-301-35/+28Star
| | | | | | | | | | For aesthetic reasons, move all the pcmcia_driver functions so they are near the pcmcia_driver declaration. This also removes the need for some of 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>
* staging: comedi: ni_labpc_cs: remove pcmcia_driver suspend/resumeH Hartley Sweeten2013-01-301-14/+0Star
| | | | | | | | | The pcmcia_driver suspend and resume functions in this driver don't do anything. Since they are optional just remove them. 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>
* staging: comedi: ni_labpc_cs: remove 'stop' from private pcmcia dataH Hartley Sweeten2013-01-301-9/+0Star
| | | | | | | | | | | | The pcmcia_driver suspend and remove functions set the 'stop' variable and the resume function clears it. Nothing in the comedi_driver code uses the 'stop' variable. Just remove it so we can get rid of the suspend/resume. 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>
* staging: comedi: ni_labpc_cs: remove labpc_release()H Hartley Sweeten2013-01-301-11/+2Star
| | | | | | | | | The function simply calls pcmcia_disable_device(). Remove it and just call pcmcia_disable_device() where needed. 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>
* staging: comedi: ni_labpc_cs: cleanup pcmcia_driverH Hartley Sweeten2013-01-301-8/+7Star
| | | | | | | | | For aesthetic reasons, reorder the pcmcia_driver variables and add some whitespace. 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>
* staging: comedi: ni_labpc_cs: move MODULE_* info to end of fileH Hartley Sweeten2013-01-301-4/+4
| | | | | | | | | For aesthetic reasons, move all the MODULE_* information to the end of the file. 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>
* staging: comedi: ni_mio_cs: cleanup the boardinfo declarationH Hartley Sweeten2013-01-301-95/+75Star
| | | | | | | | | | For aesthetic reasons, reformat the boardinfo declaration and add some whitespace. Remove all the information that is set to '0' as this is the default. 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>
* staging: comedi: ni_mio_cs: cleanup mio_cs_attach()H Hartley Sweeten2013-01-301-49/+14Star
| | | | | | | | | | | | | | | | | | | | | Remove the DPRINTK() function trace message as well as the #if 0'ed out debug code that dumps the board "fingerprint". Remove the need for the local variable that holds the link->irq passed to request_irq(). Also, return the error code from that function instead of assuming -EINVAL. Use the dev->board_name for the resource string passed to request_irq() instead of the open coded string "ni_mio_cs". For aesthetic reasons, add some whitespace to the initializatio of the devpriv values. Just return the result of ni_E_init() instead of checking it for an error, returning the error, or returning "0". 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>
* staging: comedi: ni_mio_cs: remove last forward declarationH Hartley Sweeten2013-01-301-18/+15Star
| | | | | | | | | Move the ni_getboardtype() function to remove the last forward declaration in this file. 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>
* staging: comedi: ni_mio_cs: move mio_cs_detach()H Hartley Sweeten2013-01-301-7/+7
| | | | | | | | | For aesthetic reasons, move this function down so it's by the comedi_driver declaration. 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>
* staging: comedi: ni_mio_cs: move comedi_driver declarationH Hartley Sweeten2013-01-301-10/+7Star
| | | | | | | | | | | Move the comedi_driver declaration down in the file. This gets rid of the need for a couple forward declarations. For aesthetic reasons, add some whitespace to the declaration. 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>
* staging: comedi: ni_mio_cs: cleanup cs_attach()H Hartley Sweeten2013-01-301-13/+5Star
| | | | | | | | | | | Absorb the code from mio_cs_config() into this function and properly return the error if the configuration fails. Remove the DPRINTK() function trace message. 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>
* staging: comedi: ni_mio_cs: remove cs_release()H Hartley Sweeten2013-01-301-6/+1Star
| | | | | | | | | This function simply calls pcmcia_disable_device(). Remove it and just call pcmcia_disable_device() where needed. 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>
* staging: comedi: ni_mio_cs: move pcmcia_driver functionsH Hartley Sweeten2013-01-301-59/+54Star
| | | | | | | | | | For aesthetic reasons, move all the pcmcia_driver functions so they are near the pcmcia_driver declaration. This also removes the need for a couple 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>
* staging: comedi: ni_mio_cs: remove pcmcia_driver suspend/resumeH Hartley Sweeten2013-01-301-16/+0Star
| | | | | | | | | The pcmcia_driver suspend and resume functions in this driver don't do anything. Since they are optional just remove them. 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>
* staging: comedi: ni_mio_cs: remove setting dev->driverH Hartley Sweeten2013-01-301-1/+0Star
| | | | | | | | | The comedi core sets the dev->driver pointer before calling the comedi_driver attach 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>
* staging: comedi: ni_mio_cs: cleanup pcmcia_driverH Hartley Sweeten2013-01-301-7/+7
| | | | | | | | | | | | For aesthetic reasons, reorder the pcmcia_driver variables and add some whitespace. Also, remove the unnecessary '&' before the function names. They are already addresses. 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>
* staging: comedi: ni_mio_cs: move MODULE_* info to end of fileH Hartley Sweeten2013-01-301-5/+4Star
| | | | | | | | | For aesthetic reasons, move all the MODULE_* information to the end of the file. 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>
* staging: comedi: quatech_daqp_cs: cleanup subdevice initH Hartley Sweeten2013-01-301-35/+30Star
| | | | | | | | | | | | | | | | | | Remove the dev_info() board attach noise. For aesthetic reasons, add some whitespace to the subdevice init. Remove the init of the s->len_chanlist for the subdevices that do not support commands. It's not used by them and the comedi core will handle initializing it properly in the postconfig. Change the return after a successful attach to "0". The comedi core expects a < 0 value to indicate an error and "0" is the typical value returned to indicate 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>
* staging: comedi: quatech_daqp_cs: fix possible memory dereference issueH Hartley Sweeten2013-01-301-7/+8
| | | | | | | | | | | | | | | In daqp_attach(), the first options value passed in the comedi_devconfig is used as an index to the private dev_table[] in this driver. This table is used to pass the pcmcia_device to the comedi_driver. Fix the code so that the index is checked before the table is accessed so that we don't get a possible memory dereference BUG. Change the error returned to the comedi core from -EIO to -ENODEV. 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>
* staging: comedi: quatech_daqp_cs: cleanup the comedi_lrange tablesH Hartley Sweeten2013-01-301-14/+8Star
| | | | | | | | | | | | For aesthetic reasons, cleanup the whitespace of the range_daqp_ai table. Remove the range_daqp_ao table and use the comedi core provided range table for bipolar 5V (range_bipolar5). 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>
* staging: comedi: quatech_daqp_cs: remove #define pr_fmtH Hartley Sweeten2013-01-301-2/+0Star
| | | | | | | | | There are not pr_[level] uses in this file. Remove the pr_fmt define. 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>
* staging: comedi: quatech_daqp_cs: remove debug functionsH Hartley Sweeten2013-01-301-26/+0Star
| | | | | | | | | The functions daqp_dump() and hex_dump() are not used in this driver. Just remove them. 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>
* staging: comedi: quatech_daqp_cs: simplify IRQ_NONE checks in daqp_interrupt()H Hartley Sweeten2013-01-301-27/+3Star
| | | | | | | | | | | Remove all the pr_warn() noise in the sanity checks that make sure the interrupt is for this device. Simplify the sanity checks into one if() condition. 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>
* staging: comedi: quatech_daqp_cs: remove casts of void *H Hartley Sweeten2013-01-301-8/+8
| | | | | | | | Casting a void * is not necessary. 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>
* staging: comedi: quatech_daqp_cs: cleanup daqp_cs_attach()H Hartley Sweeten2013-01-301-32/+21Star
| | | | | | | | | | | | | | | | Absorb the code from daqp_cs_config() into this function and properly return the error if the configuration fails. Remove the dev_dbg() function trace messages. Fix the kzalloc(). The preferred form for passing a size of a struct is: p = kzalloc(sizeof(*p), ...); 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>
* staging: comedi: quatech_daqp_cs: remove daqp_cs_release()H Hartley Sweeten2013-01-301-9/+2Star
| | | | | | | | | | | This function justs emits a dev_dbg() message then calls pcmcia_disable_device(). The dev_dbg() is just added noise. Remove the function and just call pcmcia_disable_device(). 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>
* staging: comedi: quatech_daqp_cs: remove forward declarationsH Hartley Sweeten2013-01-301-68/+52Star
| | | | | | | | | Move some of the 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>
* staging: comedi: quatech_daqp_cs: cleanup pcmcia_driverH Hartley Sweeten2013-01-301-7/+7
| | | | | | | | | For aesthetic reasons, reorder the pcmcia_driver variables and add some whitespace. 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>
* staging: comedi: quatech_daqp_cs: move MODULE_* info to end of fileH Hartley Sweeten2013-01-301-5/+4Star
| | | | | | | | | For aesthetic reasons, move all the MODULE_* information to the end of the file. 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>
* staging: comedi: addi_watchdog: all i/o registers are 32-bitH Hartley Sweeten2013-01-251-3/+3
| | | | | | | | | | | All the i/o registers used by the watchdog device on the addi-data boards are 32-bit. Make sure all the i/o commands use outl/inl to access the registers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: addi_apci_1516: use addi_watchdog moduleH Hartley Sweeten2013-01-252-95/+11Star
| | | | | | | | | | Use the addi_watchdog module to provide support for the watchdog subdevice. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.removePeter Huewe2013-01-2553-318/+53Star
| | | | | | | | | | | | (Almost) all comedi pci drivers have some wrapper for their pci_driver.remove function which simply calls comedi_pci_auto_unconfig which has the same function prototype as the wrapper. -> we can remove these wrappers and call comedi_pci_auto_unconfig directly. This removes a lot some boilerplate code and saves some bytes. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/comedi: Move comedi_pci_auto_unconfig to drivers.cPeter Huewe2013-01-252-4/+7
| | | | | | | | | | Since comedi_pci_auto_unconfig cannot be inlined anymore after staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove is applied, it makes sense to move it drivers.c Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: addi_apci_3501: cleanup comments in hwdrv_apci3501.cH Hartley Sweeten2013-01-251-73/+32Star
| | | | | | | | | | | | | | The watchdog/timer subdevice in this driver is basically broke. The subdevice functions abuse the comedi API and the (*insn_config) simply doesn't work due to it's treating data[0] as a parameter and not as the config "instruction". For now, cleanup the comments for the functions so they are at least readable. Then we can figure out how to fix the subdevice. 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>
* staging: comedi: addi_apci_3501: define the timer i/o registersH Hartley Sweeten2013-01-252-118/+57Star
| | | | | | | | | Create, and use, defines for the i/o registers used with the timer subdevice. 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>
* staging: comedi: addi_apci_3501: change the MODULE_DESCRIPTIONH Hartley Sweeten2013-01-251-1/+1
| | | | | | | | | | Change the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver" so that modinfo provides a better description of the 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>
* staging: comedi: addi_apci_3501: move the copyright informationH Hartley Sweeten2013-01-252-48/+31Star
| | | | | | | | | | Move the copyright information from hwrdv_apci3501.c to the main driver file. Reformat it to fix the > 80 char lines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: comedi: addi_apci_3501: rewrite the analog output supportH Hartley Sweeten2013-01-252-116/+48Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the analog output subdevice has two support functions: (*insn_config) - i_APCI3501_ConfigAnalogOutput() (*insn_write) - i_APCI3501_WriteAnalogOutput() The (*insn_config) function is used to configure the analog outputs in either bipolar or unipolar mode. This function abuses the comedi API since it treats the data[0] value as a parameter instead of as the config "instruction". The (*insn_write) function then writes a single value to the desired analog output channel after doing some sanity checking on the channel number. The sanity checking is not required since the comedi core has already done it. Also, the (*insn_write) functions are supposed to write all the data, indicated by insn->n, to the channel not just a single value. Rewrite the support code so it works properly with the comedi API. The bipolar/unipolar configuration can be determine in the (*insn_write) by checking the passed insn->chanspec. Since the unipolar configuration only has 13-bit resolution, we need to check that the data is in range because the subdevice 'maxdata' is set to 14-bits for the bipolar mode. If the data is out of range, output a dev_warn() and return -EINVAL. 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>
* staging: comedi: addi_apci_3501: cleanup apci3501_reset()H Hartley Sweeten2013-01-251-12/+15
| | | | | | | | | | | | | | Rename the CamelCase local variables. Refactor the code a bit to remove the need for some of the local variables. Add a couple defines to the register map to help make the code more concise. 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>
* staging: comedi: addi_apci_3501: introduce apci3501_wait_for_dac()H Hartley Sweeten2013-01-252-23/+27
| | | | | | | | | | | | | | | Refactor the code that waits for the DAC to be ready into a helper function. A timeout of some sort should be added to this helper so code the users to expect the error condition. In i_APCI3501_WriteAnalogOutput() just return the error and don't actually write the new value to the DAC. In apci3501_reset() output a dev_warn() that the DAC was not ready. 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>