]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agostaging: comedi: addi_apci_1564: move boilerplate text to addi_apci_1564.c
Chase Southwood [Sat, 30 Aug 2014 05:55:01 +0000 (00:55 -0500)]
staging: comedi: addi_apci_1564: move boilerplate text to addi_apci_1564.c

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>
10 years agoStaging: comedi: Fix code style in jr3_pci.c
Vladimir A. Nazarenko [Wed, 27 Aug 2014 06:48:21 +0000 (17:48 +1100)]
Staging: comedi: Fix code style in jr3_pci.c

Static variables are initialised to 0 by GCC.
Fixes checkpatch.pl error:
  ERROR: do not initialise statics to 0 or NULL
  #684: FILE: jr3_pci.c:684:
  + static const struct jr3_pci_board *board = NULL;

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: usbduxsigma: fix sparse endianness warnings
Chase Southwood [Sat, 30 Aug 2014 01:40:55 +0000 (20:40 -0500)]
staging: comedi: usbduxsigma: fix sparse endianness warnings

Sparse has many warnings like:

drivers/staging/comedi/drivers/usbduxsigma.c:293:21: warning: cast to
restricted __be32

on lines on which devpriv->in_buf is passed to be32_to_cpu().  This
suggests that this variable should actually be of type __be32.

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>
10 years agostaging: comedi: usbdux: fix sparse endianness warnings
Chase Southwood [Sat, 30 Aug 2014 01:40:32 +0000 (20:40 -0500)]
staging: comedi: usbdux: fix sparse endianness warnings

Sparse has many warnings like:

drivers/staging/comedi/drivers/usbdux.c:366:32: warning: cast to
restricted __le16

on lines on which devpriv->in_buf or devpriv->insn_buf are passed to
le16_to_cpu().  This suggests that both of these variables should actually
be of type __le16.

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>
10 years agostaging: comedi: Kconfig: make COMEDI_BOND select COMEDI_KCOMEDILIB
Ian Abbott [Wed, 27 Aug 2014 19:37:18 +0000 (20:37 +0100)]
staging: comedi: Kconfig: make COMEDI_BOND select COMEDI_KCOMEDILIB

Currently, to select the "comedi_bond" driver, the "kcomedilib" support
has to be selected first.  It seems more natural to allow the
"comedi_bond" driver to be selected on its own and to automatically
select the "kcomedilib" module as a result of that.  Change the
dependency/select relationship between the two configuration options to
do that.

Also, make "kcomedilib" a module that can be selected independently,
perhaps for use by out-of-tree modules, although it is not terribly
useful for anything other than "comedi_bond" currently.

Also, improve the help text for the config options.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci230: fix a precedence bug
Dan Carpenter [Tue, 26 Aug 2014 07:55:51 +0000 (10:55 +0300)]
staging: comedi: amplc_pci230: fix a precedence bug

The addition operation has higher precedence than ?: so this would write
to PCI230_DACOUT1 instead of devpriv->daqio + PCI230_DACOUT1.

Fixes: 4f9c63fe5333 ('staging: comedi: amplc_pci230: refactor iobase addresses')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: s626: use comedi_pci_detach()
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:52 +0000 (17:55 -0700)]
staging: comedi: s626: use comedi_pci_detach()

Use comedi_pci_detach() to handle the boilerplate part of the (*detach)
for this PCI 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>
10 years agostaging: comedi: s626: tidy up freeing of the dma buffers
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:51 +0000 (17:55 -0700)]
staging: comedi: s626: tidy up freeing of the dma buffers

Currently the dma buffers are freed during the detach of the driver using
the function s626_close_dma_b(). The buffers are also freed while the
interrupt handler is still attached. This could result in a race condition.

Refactor the code so that the buffers are freed after the interrupt handler
is released and the PCI device is disabled.

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>
10 years agostaging: comedi: gsc_hpdi: tidy up freeing of the dma buffers
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:54 +0000 (17:55 -0700)]
staging: comedi: gsc_hpdi: tidy up freeing of the dma buffers

Factor the freeing of the dma buffers out of the (*detach).

Move the freeing of the buffers so that it occurs after the PCI device
has been disabled to avoid any race condition.

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>
10 years agostaging: comedi: cb_pcidas64: tidy up freeing of the dma buffers
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:53 +0000 (17:55 -0700)]
staging: comedi: cb_pcidas64: tidy up freeing of the dma buffers

Factor the freeing of the dma buffers out of the (*detach).

Move the freeing of the buffers so that it occurs after the PCI device
has been disabled to avoid any race condition.

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>
10 years agostaging: comedi: icp_multi: remove 'valid' member from private data
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:50 +0000 (17:55 -0700)]
staging: comedi: icp_multi: remove 'valid' member from private data

This member is set at the end of the driver attach and is only used to
verify that icp_multi_reset() can be called in the (*detach). The only
requirement for icp_multi_reset() to work is that the dev->mmio is valid.

Remove the 'valid' member from the private data and use 'dev->mmio' to
see if the reset can be done.

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>
10 years agostaging: comedi: adv_pci_dio: remove 'valid' member from private data
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:49 +0000 (17:55 -0700)]
staging: comedi: adv_pci_dio: remove 'valid' member from private data

This member is set at the end of the driver attach and is only used to
verify that pci_dio_reset() can be called in the (*detach). The only
requirement for pci_dio_reset() to work is that the dev->iobase is valid.

Remove the 'valid' member from the private data and use 'dev->iobase' to
see if the reset can be done.

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>
10 years agostaging: comedi: comedi_pci: introduce comedi_pci_detach()
H Hartley Sweeten [Tue, 26 Aug 2014 00:55:48 +0000 (17:55 -0700)]
staging: comedi: comedi_pci: introduce comedi_pci_detach()

Introduce a generic (*detach) function for comedi PCI drivers to handle
the boilerplate code needed to detach a PCI driver.

This function works similar to comedi_legacy_detach() where it will:

  * free the dev->irq if it has been requested
  * iounmap the dev->mmio addres if it has been ioremap'ed

The helper then calls comedi_pci_disable() to release the regions and
disable the PCI device.

Use the new helper directly for the (*detach) in the following cases:

  * where comedi_pci_disable() is used directly for the (*detach)
  * where the detach function is just boilerplate

Use the new helper in the (*detach) of the simpler PCI drivers. Call
the helper after disabling interrupts (reset) and before any additional
cleanup (kfree) to avoid any race conditions with the interrupt handler.

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>
10 years agostaging: comedi: me4000: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:55 +0000 (16:04 -0700)]
staging: comedi: me4000: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: me4000: remove sanity checks in me4000_ao_insn_write()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:54 +0000 (16:04 -0700)]
staging: comedi: me4000: remove sanity checks in me4000_ao_insn_write()

The comedi core does the sanity checking of the comedi_insn before
calling the (*insn_write). Remove the unnecessary checks.

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>
10 years agostaging: comedi: rtd520: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:53 +0000 (16:04 -0700)]
staging: comedi: rtd520: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: dt2801: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:52 +0000 (16:04 -0700)]
staging: comedi: dt2801: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: cb_pcidas64: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:51 +0000 (16:04 -0700)]
staging: comedi: cb_pcidas64: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: cb_pcidas: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:50 +0000 (16:04 -0700)]
staging: comedi: cb_pcidas: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: mf6x4: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:49 +0000 (16:04 -0700)]
staging: comedi: mf6x4: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: mf6x4: analog output data does not need extra masking
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:48 +0000 (16:04 -0700)]
staging: comedi: mf6x4: analog output data does not need extra masking

The comedi core validates that all the data values are <= s->maxdata
before calling the (*insn_write) function. The extra masking is not
needed. 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>
10 years agostaging: comedi: cb_pcimdas: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:47 +0000 (16:04 -0700)]
staging: comedi: cb_pcimdas: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: cb_pcimdas: cleanup cb_pcimdas_ao_winsn()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:46 +0000 (16:04 -0700)]
staging: comedi: cb_pcimdas: cleanup cb_pcimdas_ao_winsn()

The comedi core validates the insn->chanspec and data values before
calling the (*insn_write) functions. The 'chan' will always be valid
and the data values do not need to be masked.

Tidy up this function and remove the unnecessary code.

For aesthetics, rename 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>
10 years agostaging: comedi: ni_670x: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:45 +0000 (16:04 -0700)]
staging: comedi: ni_670x: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: ni_670x: cleanup ni_670x_ao_winsn()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:44 +0000 (16:04 -0700)]
staging: comedi: ni_670x: cleanup ni_670x_ao_winsn()

For aesthetics, rename this function and tidy it up 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>
10 years agostaging: comedi: dmm32at: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:43 +0000 (16:04 -0700)]
staging: comedi: dmm32at: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: dmm32at: cleanup dmm32at_ao_winsn()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:42 +0000 (16:04 -0700)]
staging: comedi: dmm32at: cleanup dmm32at_ao_winsn()

For aesthetics, rename the function and tidy it up a bit. Also rename the
registers used by this function and add a macro to set the 'chan' bits in
the MSB 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>
10 years agostaging: comedi: daqboard2000: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:41 +0000 (16:04 -0700)]
staging: comedi: daqboard2000: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, tidy up the (*insn_write) 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>
10 years agostaging: comedi: daqboard2000: remove #if 0'ed out code in ao (*insn_write)
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:40 +0000 (16:04 -0700)]
staging: comedi: daqboard2000: remove #if 0'ed out code in ao (*insn_write)

This code has been disabled since it's initial commit. It must not be
needed so just 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>
10 years agostaging: comedi: rti800: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:39 +0000 (16:04 -0700)]
staging: comedi: rti800: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: rti800: save unmunged data for ao readback
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:38 +0000 (16:04 -0700)]
staging: comedi: rti800: save unmunged data for ao readback

The unmunged data should be saved for readback not the munged 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>
10 years agostaging: comedi: das08: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:37 +0000 (16:04 -0700)]
staging: comedi: das08: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

The das08_ao_initialize() function is only called when the subdevice
is first setup during the attach. It is used to initialize the channels
to a known state. Absorb that function to simplify the code 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>
10 years agostaging: comedi: das08: fix bug in das08_ao_winsn()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:36 +0000 (16:04 -0700)]
staging: comedi: das08: fix bug in das08_ao_winsn()

The comedi core expects (*insn_write) functions to write insn->n values
to the hardware and return the number of values written.

Currently, this function only writes the first value. Fix it to work
like the core expects.

For aesthetics, rename the function and tidy it up 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>
10 years agostaging: comedi: pcl818: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:35 +0000 (16:04 -0700)]
staging: comedi: pcl818: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: quatech_daqp_cs: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:34 +0000 (16:04 -0700)]
staging: comedi: quatech_daqp_cs: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: quatech_daqp_cs: fix bug in daqp_ao_insn_write()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:33 +0000 (16:04 -0700)]
staging: comedi: quatech_daqp_cs: fix bug in daqp_ao_insn_write()

The comedi core expects (*insn_write) functions to write insn->n values
to the hardware and return the number of values written.

Currently, this function only writes the first value. Fix it to work
like the core expects.

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>
10 years agostaging: comedi: dt3000: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:32 +0000 (16:04 -0700)]
staging: comedi: dt3000: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up 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>
10 years agostaging: comedi: ii_pci20kc: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:31 +0000 (16:04 -0700)]
staging: comedi: ii_pci20kc: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

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>
10 years agostaging: comedi: ii_pci20kc: save unmunged data for ao readback
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:30 +0000 (16:04 -0700)]
staging: comedi: ii_pci20kc: save unmunged data for ao readback

The unmunged data should be saved for readback not the munged 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>
10 years agostaging: comedi: me_daq: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:29 +0000 (16:04 -0700)]
staging: comedi: me_daq: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: me_daq: fix bug in me_ao_insn_write()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:28 +0000 (16:04 -0700)]
staging: comedi: me_daq: fix bug in me_ao_insn_write()

The comedi core expects (*insn_write) functions to write insn->n values
to the hardware and return the number of values written.

Currently, this function only writes the first value. The core also
validates all the data values so the extra masking with s->maxdata is
not needed. Fix this function to work like the core expects.

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>
10 years agostaging: comedi: ni_atmio16d: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:27 +0000 (16:04 -0700)]
staging: comedi: ni_atmio16d: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: ni_atmio16d: cleanup atmio16d_ao_insn_write()
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:26 +0000 (16:04 -0700)]
staging: comedi: ni_atmio16d: cleanup atmio16d_ao_insn_write()

The comedi core validates the insn->chanspec and data values before
calling the (*insn_write) functions. The 'chan' will always be valid.

Tidy up this function up a bit and remove the unnecessary 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>
10 years agostaging: comedi: addi_apci_3xxx: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:25 +0000 (16:04 -0700)]
staging: comedi: addi_apci_3xxx: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: amplc_pci230: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:24 +0000 (16:04 -0700)]
staging: comedi: amplc_pci230: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up.

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>
10 years agostaging: comedi: amplc_pci224: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:23 +0000 (16:04 -0700)]
staging: comedi: amplc_pci224: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up.

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>
10 years agostaging: comedi: cb_das16_cs: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:22 +0000 (16:04 -0700)]
staging: comedi: cb_das16_cs: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) 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>
10 years agostaging: comedi: addi_apci_3501: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:21 +0000 (16:04 -0700)]
staging: comedi: addi_apci_3501: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: dt2811: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:20 +0000 (16:04 -0700)]
staging: comedi: dt2811: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up.

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>
10 years agostaging: comedi: dt9812: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:19 +0000 (16:04 -0700)]
staging: comedi: dt9812: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: das6402: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:18 +0000 (16:04 -0700)]
staging: comedi: das6402: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: usbduxsigma: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:17 +0000 (16:04 -0700)]
staging: comedi: usbduxsigma: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: usbdux: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:16 +0000 (16:04 -0700)]
staging: comedi: usbdux: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: ni_mio_common: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:15 +0000 (16:04 -0700)]
staging: comedi: ni_mio_common: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: pcmmio: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:14 +0000 (16:04 -0700)]
staging: comedi: pcmmio: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: pcmda12: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:13 +0000 (16:04 -0700)]
staging: comedi: pcmda12: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: ni_at_ao: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:12 +0000 (16:04 -0700)]
staging: comedi: ni_at_ao: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: pcl711: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:11 +0000 (16:04 -0700)]
staging: comedi: pcl711: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: pcl812: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:10 +0000 (16:04 -0700)]
staging: comedi: pcl812: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, tidy up pcl812_ao_insn_write().

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>
10 years agostaging: comedi: s626: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:09 +0000 (16:04 -0700)]
staging: comedi: s626: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: rti802: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:08 +0000 (16:04 -0700)]
staging: comedi: rti802: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: s526: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:07 +0000 (16:04 -0700)]
staging: comedi: s526: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up 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>
10 years agostaging: comedi: pcl726: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:06 +0000 (16:04 -0700)]
staging: comedi: pcl726: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: icp_multi: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:05 +0000 (16:04 -0700)]
staging: comedi: icp_multi: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up 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>
10 years agostaging: comedi: dt282x: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:04 +0000 (16:04 -0700)]
staging: comedi: dt282x: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: das16: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:03 +0000 (16:04 -0700)]
staging: comedi: das16: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: adl_pci9111: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:02 +0000 (16:04 -0700)]
staging: comedi: adl_pci9111: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

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>
10 years agostaging: comedi: cb_pcimdda: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:01 +0000 (16:04 -0700)]
staging: comedi: cb_pcimdda: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

For aesthetics, rename the (*insn_write) and (*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>
10 years agostaging: comedi: multiq3: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:04:00 +0000 (16:04 -0700)]
staging: comedi: multiq3: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

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>
10 years agostaging: comedi: fl512: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:59 +0000 (16:03 -0700)]
staging: comedi: fl512: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

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>
10 years agostaging: comedi: dac02: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:58 +0000 (16:03 -0700)]
staging: comedi: dac02: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

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>
10 years agostaging: comedi: aio_aio12_8: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:57 +0000 (16:03 -0700)]
staging: comedi: aio_aio12_8: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

Remove the unused private data and its allocation.

For aesthetics, rename the (*insn_write) function and tidy it up.

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>
10 years agostaging: comedi: adl_pci6208: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:56 +0000 (16:03 -0700)]
staging: comedi: adl_pci6208: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

The loop used to write the values could timeout. Move the saving of
the readback value so that the last value written is always saved.

Remove the unused private data and its allocation.

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>
10 years agostaging: comedi: skel: use comedi_subdevice 'readback'
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:55 +0000 (16:03 -0700)]
staging: comedi: skel: use comedi_subdevice 'readback'

Use the new comedi_subdevice 'readback' member and the core provided
(*insn_read) for the readback of the analog output subdevice channels.

For aesthetics, rename the (*insn_write) function and tidy it up a bit.

Add a comment about the 'readback' member.

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>
10 years agostaging: comedi: add a 'readback' member to comedi_subdevice
H Hartley Sweeten [Mon, 25 Aug 2014 23:03:54 +0000 (16:03 -0700)]
staging: comedi: add a 'readback' member to comedi_subdevice

The analog output hardware in most comedi drivers does not provide a
way to readback to last values written to the channels. In order to
provide an (*insn_read) for the analog output subdevice, the comedi
drivers save the last values for each channel in the private data.

Add a new member, 'readback', to the comedi_subdevice definition to
provide a common way to save these values.

Introduce a comedi core function, comedi_alloc_subdev_readback(), to
allocate the memory needed to save the values. This memory will be
automatically kfree'd when the driver is detached.

Introduce a comedi core function, comedi_readback_insn_read(), that
the comedi drivers can use for the (*insn_read) of a subdevice to
return the saved values for each channel.

This will allow removing the boilerplate in the comedi drivers to
return the saved values. In some drivers it will also allow removing
the private data completely.

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>
10 years agostaging: comedi: addi_apci_1032: remove deadcode in apci1032_cos_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:24:03 +0000 (15:24 -0700)]
staging: comedi: addi_apci_1032: remove deadcode in apci1032_cos_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: addi_apci_1564: remove deadcode in apci1564_cos_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:24:02 +0000 (15:24 -0700)]
staging: comedi: addi_apci_1564: remove deadcode in apci1564_cos_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: addi_apci_2032: remove deadcode in apci2030_int_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:24:01 +0000 (15:24 -0700)]
staging: comedi: addi_apci_2032: remove deadcode in apci2030_int_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: amplc_pc236_common: remove deadcode in pc236_intr_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:24:00 +0000 (15:24 -0700)]
staging: comedi: amplc_pc236_common: remove deadcode in pc236_intr_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: comedi_parport: remove deadcode in parport_intr_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:59 +0000 (15:23 -0700)]
staging: comedi: comedi_parport: remove deadcode in parport_intr_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: dt3000: remove deadcode in dt3k_ai_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:58 +0000 (15:23 -0700)]
staging: comedi: dt3000: remove deadcode in dt3k_ai_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: gsc_hpdi: remove deadcode in gsc_hpdi_cmd_test()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:57 +0000 (15:23 -0700)]
staging: comedi: gsc_hpdi: remove deadcode in gsc_hpdi_cmd_test()

Reported by: coverity
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>
10 years agostaging: comedi: me4000: fix aref test in ai_write_chanlist()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:56 +0000 (15:23 -0700)]
staging: comedi: me4000: fix aref test in ai_write_chanlist()

The 'aref' (CR_AREF) values are all AREF_* defines. The SDF_* defines are
subdevice flags. Fix the test in this function.

Reported by: coverity
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>
10 years agostaging: comedi: me4000: fix aref test in me4000_ai_check_chanlist()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:55 +0000 (15:23 -0700)]
staging: comedi: me4000: fix aref test in me4000_ai_check_chanlist()

The 'aref' (CR_AREF) values are all AREF_* defines. The SDF_* defines are
subdevice flags. Fix the test in this function.

Reported by: coverity
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>
10 years agostaging: comedi: ni_6527: remove deadcode in ni6527_intr_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:54 +0000 (15:23 -0700)]
staging: comedi: ni_6527: remove deadcode in ni6527_intr_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: ni_65xx: remove deadcode in ni_65xx_intr_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:53 +0000 (15:23 -0700)]
staging: comedi: ni_65xx: remove deadcode in ni_65xx_intr_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: ni_mio_common: remove deadcode in ni_cdio_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:52 +0000 (15:23 -0700)]
staging: comedi: ni_mio_common: remove deadcode in ni_cdio_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: ni_mio_common: remove deadcode in ni_ai_insn_config()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:51 +0000 (15:23 -0700)]
staging: comedi: ni_mio_common: remove deadcode in ni_ai_insn_config()

The previous mask by 0xf ensures that calib_source will not be > 0xf.
Remove the dead code.

Reported by: coverity
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>
10 years agostaging: comedi: ni_mio_common: fix local var for 32-bit read
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:50 +0000 (15:23 -0700)]
staging: comedi: ni_mio_common: fix local var for 32-bit read

The local variable 'd' is used to read a 32-bit register. One branch of
the code shifts the register value 16 bits to the right to get the high
16-bits. Change the type of the local variable so that this shift works
correctly.

Reported by: coverity
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>
10 years agostaging: comedi: ni_tiocmd: remove deadcode in ni_tio_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:49 +0000 (15:23 -0700)]
staging: comedi: ni_tiocmd: remove deadcode in ni_tio_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: usbdux: remove deadcode in pcl726_intr_cmdtest()
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:48 +0000 (15:23 -0700)]
staging: comedi: usbdux: remove deadcode in pcl726_intr_cmdtest()

Reported by: coverity
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>
10 years agostaging: comedi: usbdux: fix errno (EL2NSYNC) check
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:47 +0000 (15:23 -0700)]
staging: comedi: usbdux: fix errno (EL2NSYNC) check

These should both be checking the -errno.

Reported by: coverity
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>
10 years agostaging: comedi: usbduxsigma: fix kcalloc 'size' argument
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:46 +0000 (15:23 -0700)]
staging: comedi: usbduxsigma: fix kcalloc 'size' argument

This code wants to allocate two arrays of struct urb pointers not two
arrays of struct urb objects. The size argument for both kcalloc calls
should be sizeof(urb) not sizeof(*urb).

Reported by: coverity
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>
10 years agostaging: comedi: usbduxsigma: fix errno (EL2NSYNC) check
H Hartley Sweeten [Mon, 25 Aug 2014 22:23:45 +0000 (15:23 -0700)]
staging: comedi: usbduxsigma: fix errno (EL2NSYNC) check

These should both be checking the -errno.

Reported by: coverity
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>
10 years agostaging: comedi: ni_labpc: split common code to ni_labpc_common
Ian Abbott [Tue, 19 Aug 2014 15:06:33 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: split common code to ni_labpc_common

The "ni_labpc" module is a Comedi driver for the National Instruments
Lab-PC series of ISA data acquistion boards, and also provides common
code for the "ni_labpc_pci" and "ni_labpci_cs" modules (for PCI boards
and PCMCIA cards).

Split out the common code into a new module "ni_labpc_common", leaving
the driver for the ISA boards in the existing "ni_labpc" module.  This
removes the C preprocessor conditional directives from the resulting
".c" files (although they remain in the included header file
"ni_labpc_isadma.h").

Unneccessary `#include` directives have been removed from the resulting
".c" files.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: break lines after operators
Ian Abbott [Tue, 19 Aug 2014 15:06:32 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: break lines after operators

For consistency, break lines before operators, not after.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: Logical continuations should be on the previous line
Ian Abbott [Tue, 19 Aug 2014 15:06:31 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: Logical continuations should be on the previous line

Fix checkpatch issues "CHECK: Logical continuations should be on the
previous line".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: Alignment should match open parenthesis
Ian Abbott [Tue, 19 Aug 2014 15:06:30 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: Alignment should match open parenthesis

Fix checkpatch issues "CHECK: Alignment should match open parenthesis".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: use braces on all arms of `if` statement
Ian Abbott [Tue, 19 Aug 2014 15:06:29 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: use braces on all arms of `if` statement

Fix checkpatch issues "CHECK: braces {} should be used on all arms of
this statement".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_labpc: remove unnecessary braces in labpc_common_attach()
Ian Abbott [Tue, 19 Aug 2014 15:06:28 +0000 (16:06 +0100)]
staging: comedi: ni_labpc: remove unnecessary braces in labpc_common_attach()

Correct checkpatch issue "WARNING: braces {} are not necessary for any
arm of this statement".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>