summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
AgeCommit message (Collapse)AuthorFilesLines
2014-04-23staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private dataH Hartley Sweeten1-6/+3
In usbdux_ao_cmd(), the channels for the command are transfered from the cmd->chanlist and stored in the private data 'ao_chanlist'. The channel numbers are bit-shifted when stored so that they become the "command" that is transfered to the device. The channel to command conversion results in the 'ao_chanlist' having these values for the channels: channel 0 -> ao_chanlist = 0x00 channel 1 -> ao_chanlist = 0x40 channel 2 -> ao_chanlist = 0x80 channel 3 -> ao_chanlist = 0xc0 The problem is, the usbduxsub_ao_isoc_irq() function uses the 'chan' value from 'ao_chanlist' to access the 'ao_readback' array in the private data. So instead of accessing the array as 0, 1, 2, 3, it accesses it as 0x00, 0x40, 0x80, 0xc0. Fix this by storing the raw channel number in 'ao_chanlist' and doing the bit-shift when creating the command. Fixes: a998a3db530bff80 "staging: comedi: usbdux: cleanup the private data 'outBuffer'" Cc: stable <stable@vger.kernel.org> # 3.12 Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Acked-by: Bernd Porr <mail@berndporr.me.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16staging: comedi: fix circular locking dependency in comedi_mmap()Ian Abbott3-6/+51
Mmapping a comedi data buffer with lockdep checking enabled produced the following kernel debug messages: ====================================================== [ INFO: possible circular locking dependency detected ] 3.5.0-rc3-ija1+ #9 Tainted: G C ------------------------------------------------------- comedi_test/4160 is trying to acquire lock: (&dev->mutex#2){+.+.+.}, at: [<ffffffffa00313f4>] comedi_mmap+0x57/0x1d9 [comedi] but task is already holding lock: (&mm->mmap_sem){++++++}, at: [<ffffffff810c96fe>] vm_mmap_pgoff+0x41/0x76 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_sem){++++++}: [<ffffffff8106d0e8>] lock_acquire+0x97/0x105 [<ffffffff810ce3bc>] might_fault+0x6d/0x90 [<ffffffffa0031ffb>] do_devinfo_ioctl.isra.7+0x11e/0x14c [comedi] [<ffffffffa003227f>] comedi_unlocked_ioctl+0x256/0xe48 [comedi] [<ffffffff810f7fcd>] vfs_ioctl+0x18/0x34 [<ffffffff810f87fd>] do_vfs_ioctl+0x382/0x43c [<ffffffff810f88f9>] sys_ioctl+0x42/0x65 [<ffffffff81415c62>] system_call_fastpath+0x16/0x1b -> #0 (&dev->mutex#2){+.+.+.}: [<ffffffff8106c528>] __lock_acquire+0x101d/0x1591 [<ffffffff8106d0e8>] lock_acquire+0x97/0x105 [<ffffffff8140c894>] mutex_lock_nested+0x46/0x2a4 [<ffffffffa00313f4>] comedi_mmap+0x57/0x1d9 [comedi] [<ffffffff810d5816>] mmap_region+0x281/0x492 [<ffffffff810d5c92>] do_mmap_pgoff+0x26b/0x2a7 [<ffffffff810c971a>] vm_mmap_pgoff+0x5d/0x76 [<ffffffff810d493f>] sys_mmap_pgoff+0xc7/0x10d [<ffffffff81004d36>] sys_mmap+0x16/0x20 [<ffffffff81415c62>] system_call_fastpath+0x16/0x1b other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_sem); lock(&dev->mutex#2); lock(&mm->mmap_sem); lock(&dev->mutex#2); *** DEADLOCK *** To avoid the circular dependency, just try to get the lock in `comedi_mmap()` instead of blocking. Since the comedi device's main mutex is heavily used, do a down-read of its `attach_lock` rwsemaphore instead. Trying to down-read `attach_lock` should only fail if some task has down-write locked it, and that is only done while the comedi device is being attached to or detached from a low-level hardware device. Unfortunately, acquiring the `attach_lock` doesn't prevent another task replacing the comedi data buffer we are trying to mmap. The details of the buffer are held in a `struct comedi_buf_map` and pointed to by `s->async->buf_map` where `s` is the comedi subdevice whose buffer we are trying to map. The `struct comedi_buf_map` is already reference counted with a `struct kref`, so we can stop it being freed prematurely. Modify `comedi_mmap()` to call new function `comedi_buf_map_from_subdev_get()` to read the subdevice's current buffer map pointer and increment its reference instead of accessing `async->buf_map` directly. Call `comedi_buf_map_put()` to decrement the reference once the buffer map structure has been dealt with. (Note that `comedi_buf_map_put()` does nothing if passed a NULL pointer.) `comedi_buf_map_from_subdev_get()` checks the subdevice's buffer map pointer has been set and the buffer map has been initialized enough for `comedi_mmap()` to deal with it (specifically, check the `n_pages` member has been set to a non-zero value). If all is well, the buffer map's reference is incremented and a pointer to it is returned. The comedi subdevice's spin-lock is used to protect the checks. Also use the spin-lock in `__comedi_buf_alloc()` and `__comedi_buf_free()` to protect changes to the subdevice's buffer map structure pointer and the buffer map structure's `n_pages` member. (This checking of `n_pages` is a bit clunky and I [Ian Abbott] plan to deal with it in the future.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 3.14.x, 3.15.x Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-20staging: comedi: poc: remove obsolete driverH Hartley Sweeten3-167/+0
The DAC02 board, which is the only board supported by this driver, now has its own comedi driver (dac02). Remove this obsolete 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>
2014-03-19Staging: comedi: Fix line over 80 characters in s626.cEbru Akagunduz1-2/+4
Fix checkpatch.pl issues line over 80 characters in s626.c Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19Staging: comedi: Fix missing space after return type in s626.cEbru Akagunduz1-4/+4
Fix checkpatch.pl issues with missing space after return type in s626.c Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19Staging: comedi: proc: title block updateMichael Welling1-1/+0
Follow up patch for "STAGING: comedi: style and checkpatch fixes". Removes the file name in the comment block per suggestions. Signed-off-by: Michael Welling <mwelling@ieee.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18STAGING: comedi: style and checkpatch fixesMichael Welling1-26/+23
Updates block comment per Documentation/CodingStyle. Also updated due to checkpatch warnings about qouted string after Lindent modified the spacing slightly. Signed-off-by: Michael Welling <mwelling@ieee.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging: comedi: das6402: rewrite broken driverH Hartley Sweeten1-223/+449
This driver is _really_ broken. It initializes an analog input subdevice that only has a (*cancel) function. It also does a request_irq() to hookup an interrupt handler using it->options[0] as the IRQ. This option is actually the base address of the I/O region used by the board. If the interrupt handler actually did get hooked up, the rest of the code assumes that IRQ 10 is being used. Rewrite the driver to properly support the hardware. The DAS6402-12/16 boards have 64 single-ended / 32 differential analog inputs, 2 analog outputs, 8 digital inputs, and 8 digital outputs. Add proper support for these subdevices. Stub in the analog input async command support. 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>
2014-03-17staging: comedi: rti802: update the MODULE_DESCRIPTIONH Hartley Sweeten1-1/+1
Change the generic MODULE_DESCRIPTION text to something more specific for 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>
2014-03-17staging: comedi: rti802: tidy up the multi-line commentsH Hartley Sweeten1-30/+28
Tidy up the milti-line comments so they follow the 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>
2014-03-17staging: comedi: rti802: tidy up the register map definesH Hartley Sweeten1-3/+6
For aesthetics, add some whitespace to the register map defines and convert the offsets to hex. 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>
2014-03-17staging: comedi: rti802: tidy up the subdevice initH Hartley Sweeten1-10/+9
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>
2014-03-17staging: comedi: rti802: tidy up rti802_ao_insn_write()H Hartley Sweeten1-9/+18
Use comedi_offset_munge() to handle munging the offset binary to two's complement. Tidy up the function a bit. 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>
2014-03-17staging: comedi: rti802: tidy up rti802_ao_insn_read()H Hartley Sweeten1-3/+5
To clarify the function a bit, add a local variable for the 'chan' that is being read and change the final return to 'insn->n'. 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>
2014-03-17staging: comedi: rti802: remove RTI802_SIZE defineH Hartley Sweeten1-3/+1
This define is only used in the attach to specify the I/O region size passed to comedi_request_region(). Remove the define and just open code the 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up multi-line commentH Hartley Sweeten1-20/+20
Tidy up the comment to follow the 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>
2014-03-17staging: comedi: gsc_hpdi: remove pr_fmt() defineH Hartley Sweeten1-2/+0
This driver no longer has any pr_{level} messages. Remove the pr_fmt(). 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>
2014-03-17staging: comedi: gsc_hpdi: convert comedi_error() messages to dev_err()H Hartley Sweeten1-2/+2
For aesthetics, convert the comedi_error() messages to dev_err(). 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up the boardinfoH Hartley Sweeten1-9/+9
Remove the unnecessary comments in the boardinfo definition and tidy up the declaration. FWIW, I'm not sure this boardinfo is really needed... 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up the register mapH Hartley Sweeten1-116/+82
For aesthetics, convert the various enums into simple defines to describe the register map for the board. Group the bit defines with the associated register define. Convert the helper functions for the register bit/shift/mask stuff into simple 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>
2014-03-17staging: comedi: gsc_hpdi: rename 'hpdi_iobase' in private dataH Hartley Sweeten1-24/+22
This member in the private data holds the ioremaped PCI BAR2 address which is the primary base address for the boards registers. For aesthetics, rename this member simply 'mmio'. 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>
2014-03-17staging: comedi: gsc_hpdi: rename 'plx9080_iobase' in private dataH Hartley Sweeten1-26/+25
Rename this member to fix two checkpatch.pl warnings about lines > 80 characters. Also remove the unnecessary comment. 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up gsc_hpdi_drain_dma()H Hartley Sweeten1-32/+28
Refactor this function to clarify the loop that reads all the full buffers. 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>
2014-03-17staging: comedi: gsc_hpdi: remove 'volatile' from the private data membersH Hartley Sweeten1-3/+3
As reported by checkpatch.pl, the private data members do not need the volatile tag. 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>
2014-03-17staging: comedi: gsc_hpdi: remove hpdi_writel()H Hartley Sweeten1-15/+3
This helper function is used to OR bits with a software copy of a register value then writel() the new value to the register. The software copies are never updated in the driver so they are always 0 due to the kzalloc. Remove the unnecessary 'bits' from the private data and replace the hpdi_writel() calls with writel(). 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>
2014-03-17staging: comedi: gsc_hpdi: remove disable_plx_interrupts()H Hartley Sweeten1-9/+2
This helper function is just a simple writel(). 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>
2014-03-17staging: comedi: gsc_hpdi: rename init_hpdi()H Hartley Sweeten1-2/+2
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: rename init_plx9080()H Hartley Sweeten1-2/+2
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: rename hpdi_find_board()H Hartley Sweeten1-2/+2
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: rename the (*auto_attach) and (*detach) functionsH Hartley Sweeten1-5/+5
For aesthetics, rename these functions so they have 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>
2014-03-17staging: comedi: gsc_hpdi: rename drain_dma_buffers()H Hartley Sweeten1-2/+2
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: rename handle_interrupt()H Hartley Sweeten1-2/+2
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: rename abort_dma()H Hartley Sweeten1-7/+5
For aesthetics, rename this function so it has namespace associated with the driver. Also, remove the unnecessary forward 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>
2014-03-17staging: comedi: gsc_hpdi: rename hpdi_cancel()H Hartley Sweeten1-2/+3
For aesthetics, rename this function 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up hpdi_cmd_test()H Hartley Sweeten1-82/+71
For aesthetics, rename this function so it has namespace associated with the driver and move it so that it is not in the middle of the interrupt support code. Absorb the di_cmd_test() helper and tidy up the function a bit. 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up hpdi_cmd()H Hartley Sweeten1-60/+58
For aesthetics, rename this function so it has namespace associated with the driver and move it so that it is not in the middle of the interrupt support code. Absorb the di_cmd() helper and tidy up the function a bit. 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up setup_dma_descriptors()H Hartley Sweeten1-53/+46
For aesthetics, rename this function so it has namespace associated with the driver and move it so that it is not in the middle of the async command support code. Tidy up the function a bit. 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>
2014-03-17staging: comedi: gsc_hpdi: tidy up dio_config_insn()H Hartley Sweeten1-38/+26
For aesthetics, rename this function so it has namespace associated with the driver and move it so that it is not in the middle of the async command support code. Absorb the dio_config_block_size() helper function and remove the forward 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>
2014-03-17staging: comedi: gsc_hpdi: move the (*auto_attach) helper functionsH Hartley Sweeten1-82/+81
For aesthetics, move a couple helper functions that are only called by the (*auto_attach) closer to that 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>
2014-03-17staging: comedi: gsc_hpdi: absorb setup_subdevices()H Hartley Sweeten1-36/+18
This function is only called by the (*auto_attach). Absorb it into that function to clarify the attach and remove the need for some of the forward declarations. 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>
2014-03-17staging: comedi: gsc_hpdi: move the (*auto_attach) and (*detach) functionsH Hartley Sweeten1-111/+110
Move these functions closer to the comedi_driver declaration. This removes the need for one of the forward declarations. 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>
2014-03-17staging: comedi: fl512: tidy up the multi-line commentsH Hartley Sweeten1-14/+27
Tidy up the multi-line comments to follow the CodingStyle. Add the GPL boilerplate comment found in other 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>
2014-03-17staging: comedi: fl512: tidy up fl512_ao_insn_read()H Hartley Sweeten1-13/+17
Tidy up this 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>
2014-03-17staging: comedi: fl512: tidy up fl512_ao_insn_write()H Hartley Sweeten1-12/+13
Tidy up this function. Only save the last value written for readback. 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>
2014-03-17staging: comedi: fl512: define the register mapH Hartley Sweeten1-9/+18
Define the register map and remove the magic values and some unnecessary comments. For aesthetics, remove the 'iobase' local variable and use dev->iobase 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>
2014-03-17staging: comedi: fl512: tidy up fl512_ao_insn_read()H Hartley Sweeten1-5/+5
For aesthetics, tidy up this function to match the style used in most of the comedi drivers for analog output (*insn_read) functions. 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>
2014-03-17staging: comedi: fl512: remove Fl512_SIZE defineH Hartley Sweeten1-2/+1
This define is only used in the comedi_request_region() call to specify the size of the I/O region to request. Remove the define and just open code the 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>
2014-03-17staging: comedi: fl512: rename the subdevice (*insn_{read, write}) functionsH Hartley Sweeten1-22/+15
For aesthetics, rename these functions and remove the unnecessary comments. 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>
2014-03-17staging: comedi: fl512: tidy up subdevice initH Hartley Sweeten1-32/+16
Remove the obvious comments and 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>
2014-03-17staging: comedi: 8255_pci: initialize MITE data windowIan Abbott1-0/+34
According to National Instruments' PCI-DIO-96/PXI-6508/PCI-6503 User Manual, the physical address in PCI BAR1 needs to be OR'ed with 0x80 and written to register offset 0xC0 in the "MITE" registers (BAR0). Do so during initialization of the National Instruments boards handled by the "8255_pci" driver. The boards were previously handled by the "ni_pcidio" driver, where the initialization was done by `mite_setup()` in the "mite" module. The "mite" module comes with too much extra baggage for the "8255_pci" driver to deal with so use a local, simpler initialization function. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 3.10.y, 3.11.y, 3.12.y, 3.13.y, 3.14.y Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>