aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/cb_pcidas64.c
AgeCommit message (Collapse)Author
2018-04-23staging: comedi: cb_pcidas64: fix alignment of function parametersGabriel Francisco Mandaji
Fix most checkpatch.pl issues of type: CHECK: Alignment should match open parenthesis Signed-off-by: Gabriel Francisco Mandaji <gfmandaji@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23Staging: comedi: fix multiple line dereference coding style issue in ↵Jian Zhang
cb_pcidas64.c This is a patch to the cb_pcidas64.c file that fixes up a multiple line dereference warning found by the checkpatch.pl tool. Signed-off-by: Jian Zhang <kernel@ubicomp.com.au> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23staging: comedi: cb_pcidas64: Fix external_ai_queue_in_use()Ian Abbott
`external_ai_queue_in_use()` is supposed to return 1 if the external channel sequencer is in use by an AI command, else return 0. If the "read" subdevice (which is the AI subdevice) is not busy then no AI command is running so the external channel sequencer is not in use, so the function should return 0. Unfortunately, the function's "read" subdevice busy test is inverted, so the function always returns 0 when the "read" subdevice is busy. Worse, if the "read" subdevice is not busy the subsequent call to `use_internal_queue_6xxx()` results in a null pointer dereference if a previous AI command used a channel list with a length greater than 1. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23Revert "staging: comedi: cb_pcidas64: change params to ↵Ian Abbott
external_ai_queue_in_use()" This reverts commit f5f3a2c6569e ("staging: comedi: cb_pcidas64: change params to external_ai_queue_in_use()"). The `external_ai_queue_in_use()` was being called from `ao_cmd()` with pointers to the "write" subdevice and AO command, but is supposed to check whether the external AI queue is currently in use by the "read" subdevice and AI command. In fact, the return value always indicated that the external AI queue was not in use in this case (because the AO command's channel list is sequential), so was fairly useless. (However, even before the reverted commit, the logic in `external_ai_queue_in_use()` was wrong. That will be corrected in a subsequent commit.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: comedi: Replace "dont" with "don'tArushi Singhal
Replace "dont" with "don't". "Dont" is not same as "Do not" or "Don't". Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19staging: comedi: Remove a newline inside a dereferenceEisha Chen-yen-su
Remove a new line inside a dereference so that it is not on multiple lines. And avoid making the line go over 80 columns by moving the whole dma_alloc_coherent() call back 4 columns. Problem found with checkpatch. Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: drivers: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all comedi files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: comedi: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/comedi files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14staging: comedi: Compress return logic into one line.Varsha Rao
Simplify function return by merging assignment and return into a single line. The following coccinelle script is used to fix this issue. @@ expression e; local idexpression ret; @@ -ret = e; -return ret; +return e; Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: comedi: Using macro DIV_ROUND_UPsimran singhal
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: comedi: cb_pcidas64: use preferred kernel type u32Saber Rezvani
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u32' over 'uint32_t' Signed-off-by: Saber Rezvani <irsaber@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: comedi: cb_pcidas64: use preferred kernel type u16Saber Rezvani
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u16' over 'uint16_t' Signed-off-by: Saber Rezvani <irsaber@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: comedi: cb_pcidas64: use preferred kernel type u8Saber Rezvani
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Saber Rezvani <irsaber@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: comedi: cb_pcidas64: Fix checkpath warningAnson Jacob
Fix checkpatch.pl warning: Please use a blank line after function/struct/union/enum declarations Move macro definition to the top of the file Aligne macro definitions Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: comedi: cb_pcidas64: Fix commenting styleAnson Jacob
Remove additional space after /* Convert single line block comment into single line comment Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: comedi: cb_pcidas64.c: Fix checkpatch warningAnson Jacob
Fix checkpatch.pl warning: Block comments use * on subsequent lines Block comments use a trailing */ on a separate line Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: comedi: plx9080.h: rename some macros for consistencyIan Abbott
Most of the macros in "plx9080.h" that define register values are single-bits flags of the form `PLX_<REG>_<FLAG>`, or are constant, multi-bit values of the form `PLX_<REG>_<FIELD>_<VAL>`, or are non-constant, function-like macros of the form `PLX_<REG>_<FIELD>(x)`. Some of the macros for constant, multi-bit values do not currently fit the pattern, so rename them for consistency. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 DMACSRx register valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the DMACSR0 and DMACSR0 registers. Use the prefix `PLX_DMACSR_` for the macros. Make use of the `BIT(x)` macro to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 DMADPRx register valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the DMADPR0 and DMADPR1 registers. (A little-endian version of the register value is also placed in the `next` member of `struct plx_dma_desc`.) Use the prefix `PLX_DMADPR_` for the macros. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the DMAMODE0 and DMAMODE1 registers. Use the prefix `PLX_DMAMODE_` for the macros. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 CNTRL register valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the CNTRL register. Use the prefix `PLX_CNTRL_` for the macros. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 INTCSR register valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the INTCSR register. Use the prefix `PLX_INTCSR_` for the macros. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register valuesIan Abbott
Replace `enum bigend_bits` in "plx9080.h" with a bunch of macros defining values for the BIGEND register. Use the prefix `PLX_BIGEND_` for the macro names. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA valuesIan Abbott
Replace the existing macros in "plx9080.h" that define values for the LAS0BA and LAS1BA registers. Use the prefix `PLX_LASBA_` for the macros. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the macros. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxRR valuesIan Abbott
Rename the macros for the PLX PCI 9080 LAS0RR and LAS1RR registers in "plx9080.h", using the prefix `PLX_LASRR_`. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Define a macro `PLX_LASRR_PREFETCH` for the "prefetchable memory" bit in this register, and define a macro `PLX_LASRR_MLOC_MASK` to mask the PCI memory location control bits. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17staging: comedi: drivers: rename PLX PCI 9080 register offsetsIan Abbott
Rename the macros in "plx9080.h" that define the offsets of registers, following the pattern `PLX_REG_<NAME>`, where `<NAME>` is the register name from the PLX PCI 9080 Data Book. Add defines for the "Mailbox" registers, and add parameterized macros for the mailbox registers and the DMA control registers. Make use of the parameterized versions of the macros where it seems appropriate. The registers for supporting the I2O (Intelligent Input/Output) feature are largely left undefined, just defining enough to allow the I2O feature to be disabled. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05staging: comedi: drivers: Remove use of deprecated pci APIAmitoj Kaur Chawla
Replace pci_[alloc|free]_consistent occurences with dma_[alloc|free]_coherent. The Coccinelle semantic patch that was used to make some of these changes is as follows: @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @bad1@ idexpression id; position deprecated.p; @@ ...when != &id->dev when != pci_get_drvdata ( id ) when != pci_enable_device ( id ) ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @depends on !bad1@ idexpression id; expression direction; position deprecated.p; @@ ( - pci_dma_supported@p ( id, + dma_supported ( &id->dev, ... + , GFP_KERNEL ) | - pci_alloc_consistent@p ( id, + dma_alloc_coherent ( &id->dev, ... + , GFP_KERNEL ) ) alloc_and_init_dma_members does not affect the interrupt status and is only called by auto_attach, which also does not affect the interrupt status. auto_attach() also contains a call to comedi_alloc_devpriv() which calls kzalloc with GFP_KERNEL flag. Thus, there seems to be no danger that dma_alloc_coherent can be called with interrupts turned off, and GFP_KERNEL can be used. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: comedi: drivers: Use DIV_ROUND_CLOSESTAmitoj Kaur Chawla
The kernel.h macro DIV_ROUND_CLOSEST performs the computation `(x +d/2)/d` but is perhaps more readable. The Coccinelle script used is as follows: // <smpl> @@ expression x,__divisor; @@ - (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18staging: comedi: cb_pcidas64: rename 'thisboard' variablesH Hartley Sweeten
For aesthetics, rename the 'thisboard' variables to 'board'. That name is more commonly used for the boardinfo pointer in 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>
2015-05-24Staging: comedi: fix style for multi-line comments in cb_pcidas64.cAmaury Denoyelle
This patch reformat multi-line comments which are not properly written according to the kernel coding style in cb_pcidas64.c Signed-off-by: Amaury Denoyelle <amaury.denoyelle@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Staging: comedi: fix line longer than 80 chars in cb_pcidas64.cAmaury Denoyelle
This patch fixes coding style errors reported by checkpatch.pl for cb_pcidas64.c, about too long source code lines. Signed-off-by: Amaury Denoyelle <amaury.denoyelle@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03staging: comedi: cb_pcidas64: remove #include "comedi_fc.h"Ian Abbott
As preparation for removal of "comedi_fc.h", replace calls to the `cfc_check_trigger_...` functions from "comedi_fc.h" with the replacement `comedi_check_trigger_...` functions from "../comedidev.h" and remove the inclusion of "comedi_fc.h". Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20staging: comedi: cb_pcidas64: include new "comedi_pci.h" headerIan Abbott
Include the new "../comedi_pci.h" header instead of <linux/pci.h> and "../comedidev.h", which will now get included indirectly. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: comedi: drivers/*.c: add missing braces {} to if/else branchesH Hartley Sweeten
According to the CodingStyle, braces should be used on all branches if thet are used on any branch, 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>
2015-03-06staging: comedi: drivers/*.c: remove unnecessary blank linesH Hartley Sweeten
Blank lines are not needed before a close brace '}' or after an open brace '{'. Also remove any multiple blank lines. 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>
2015-03-06staging: comedi: cb_pcidas64: (!foo) preferred over (foo == NULL)H Hartley Sweeten
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>
2015-03-06Staging: comedi: Clean dev_err() loggingHaneen Mohammed
This patch removes __func__ from dev_err. dev_err includes information about: (devcice, driver, specific instance of device, etc) in the log printout, so there is no need for __func__. This was done using Coccinelle, with the following semantic patch: @a@ expression E; expression msg; @@ dev_err(E, msg, __func__); @script:python b@ e << a.msg; y; @@ if(e.find("%s: ") == True): m = e.replace("%s: ", ""); coccinelle.y = m; elif(e.find("%s ") == True): m = e.replace("%s ", ""); coccinelle.y = m; else: m = e.replace("%s", ""); @c@ expression a.E, a.msg; identifier b.y; @@ - dev_err(E, msg, __func__); + dev_err(E, y); Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01staging: comedi: cb_pcidas64: remove unnecessary includeH Hartley Sweeten
The hardware supported by this driver does not have an 8254 timer. Remove the unnecessary include of "8253.h". 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>
2015-03-01staging: comedi: cb_pcidas64: fix possible integer overflowH Hartley Sweeten
The {min,max}_scan_divisor values could overflow due to the unsigned int * insigned int calculation. Change the type of the local variable 'convert_divisor' to unsigned long long to avoid the possible overflow. Reported-by: coverity (CID 200653) 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>
2015-01-25staging: comedi: drivers: remove inappropriate COMEDI_CB_EOA eventsH Hartley Sweeten
Hardware errors should be reported with the COMEDI_CB_ERROR event. This event will cause the async command to cancel. It's not necessary to also set the COMEDI_CB_EOA event. Remove these events. 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>
2015-01-25staging: comedi: cb_pcidas64: fix incorrect AI range code handlingIan Abbott
The hardware range code values and list of valid ranges for the AI subdevice is incorrect for several supported boards. The hardware range code values for all boards except PCI-DAS4020/12 is determined by calling `ai_range_bits_6xxx()` based on the maximum voltage of the range and whether it is bipolar or unipolar, however it only returns the correct hardware range code for the PCI-DAS60xx boards. For PCI-DAS6402/16 (and /12) it returns the wrong code for the unipolar ranges. For PCI-DAS64/Mx/16 it returns the wrong code for all the ranges and the comedi range table is incorrect. Change `ai_range_bits_6xxx()` to use a look-up table pointed to by new member `ai_range_codes` of `struct pcidas64_board` to map the comedi range table indices to the hardware range codes. Use a new comedi range table for the PCI-DAS64/Mx/16 boards (and the commented out variants). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: <stable@vger.kernel.org> # 3.18.x Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: comedi: cb_pcidas64: fix ad8402_write_insn()H Hartley Sweeten
The comedi core expects the (*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. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the 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-11-26staging: comedi: cb_pcidas64: use subdevice readback for 'ad8402_state'H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'ad8402_state' member from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: comedi: cb_pcidas64: fix calib_write_insn()H Hartley Sweeten
The comedi core expects the (*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. For this subdevice it only makes sense to write the final data value. Fix the function to work like the core expects. For aesthetics, rename the 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-11-26staging: comedi: cb_pcidas64: use subdevice readback for 'caldac_state'H Hartley Sweeten
Use the comedi_subdevice 'readback' member and the core provided (*insn_read) to handle the readback of the write-only calibration subdevice. Remove the then unused 'caldac_state' member from the private data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: comedi: drivers: have core hook up default (*insn_read) for readbackH Hartley Sweeten
Most of the comedi drivers that provide readback for write only subdevices now use the comedi core comedi_alloc_subdev_readback() helper to allocate the subdevice 'reaback' member instead of using some member in their private data. These drivers also hook up the (*insn_read) callback to the comedi_readback_insn_read() helper to provide the readback. Have the core automatically hook up the (*insn_read) callback after allocating the memory if the driver has not already hooked it up to a private 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-11-07staging: comedi: cb_pcidas64: use comedi_async 'scans_done' to detect AO EOAH Hartley Sweeten
Remove the private data member 'ao_count' and use the comedi_async 'scans_done' member to detect the analog output end-of-acquisition. Use the comedi_nsamples_left() helper to get the number of samples to actually read from the async buffer. 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-11-07staging: comedi: cb_pcidas64: use comedi_async 'scans_done' to detect AI EOAH Hartley Sweeten
Remove the private data member 'ai_count' and use the comedi_async 'scans_done' member to detect the analog output end-of-acquisition. Use the comedi_nsamples_left() helper to get the number of samples to actually add to the async buffer. 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-11-03staging: comedi: remove use of 'bytes_per_sample()'H Hartley Sweeten
This inline helper function has been replaced with comedi_bytes_per_sample(). The same commit (bf33eb4b4f57) introduced a couple other related helper functions a manipulate the sample size. Use the new helper functions to remove the use of 'bytes_per_sample()' and 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-11-03staging: comedi: drivers: digital output subdevices do not need SDF_READABLEH Hartley Sweeten
The SDF_READABLE flag is not necessary for digital output subdevices. For consistency, remove this flag from the comedi drivers that set 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>