summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
AgeCommit message (Collapse)Author
2015-03-18Staging: comedi: replace pr_err with dev_errHaneen Mohammed
This patch replace pr_err with dev_err, when appropriate device structure is found. Issue found using the following Coccinelle script: @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, fld; @@ struct s { ... struct device *fld; ... }; @@ identifier r.i, rr.fld; position r.p; @@ -pr_err@p +dev_err ( + i->fld, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15staging: comedi: remove break after returnSupriya Karanth
Remove "break" statement after a "return" statement as it does not get executed. Deadcode found by coccinelle --debug option Signed-off-by: Supriya Karanth <iskaranth@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15Staging: comedi: Remove parentheses around right side assignmentHaneen Mohammed
Parentheses are not needed around the right hand side of an assignment. This patch remove parenthese of such occurences. Issue was detected and solved using the following coccinelle script: @rule1@ identifier x, y, z; expression E1, E2; @@ ( x = (y == z); | x = (E1 == E2); | x = -( ... -) ; ) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15Staging: comedi: Use function setup_timer for combining initializationSomya Anand
The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. So, this patch combines the multiline code for timer initialization using the function setup_timer. This issue is identified via coccinelle script. @@ expression E1, E2, E3; type T; @@ - init_timer(&E1); ... ( - E1.function = E2; ... - E1.data = (T)E3; + setup_timer(&E1, E2, (T)E3); | - E1.data = (T)E3; ... - E1.function = E2; + setup_timer(&E1, E2, (T)E3); | - E1.function = E2; + setup_timer(&E1, E2, 0); ) Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09Merge 4.0-rc3 into staging-nextGreg Kroah-Hartman
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07staging: 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-07staging: 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-07staging: comedi: drivers/*.c: alignment should match open parenthesisH Hartley Sweeten
Fix the alignment issues in all the 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-03-07staging: comedi: drivers/*.c: fix common misspellingsH Hartley Sweeten
Fix these common misspellings: s/dependancy/dependency s/occured/occurred s/informations/information s/intialize/initialize s/serveral/several s/interrups/interrupts s/acknowledgement/acknowledgment s/suppport/support s/writting/writing 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-07staging: comedi: s626: remove unnecessary 'cmd' pointer checksH Hartley Sweeten
The local variable 'cmd' is a pointer to the address of a member variable of a struct. It will always be valid. 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>
2015-03-07staging: comedi: kcomedilib_main: (!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-07staging: comedi: ni_mio_common: (!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-07staging: comedi: ni_tiocmd: (!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-07staging: comedi: ni_pcimio: (!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-07staging: comedi: ni_pcidio: (!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-07staging: comedi: ni_labpc_common: (!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-07staging: comedi: ni_atmio: (!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-07staging: comedi: ni_660x: (!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-07staging: comedi: mite: (!foo) preferred over (foo == NULL)H Hartley Sweeten
Also, clarify the 'ring' allocation failure by returning NULL instead of 'ring' (which would be NULL). 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-07staging: 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-07staging: comedi: amplc_pci230: (!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-07staging: comedi: amplc_pci224: (!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-07staging: comedi: drivers: (!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-07staging: comedi: comedi_fops: (!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. This was done using Coccinelle, with the following semantic patch: @a@ expression E, R; expression msg; @@ dev_err(E, msg, __func__, R); @script:python b@ e << a.msg; y; @@ if(e.find("%s: ") == True): m = e.replace("%s: ", "", 1); coccinelle.y = m; elif(e.find("%s ") == True): m = e.replace("%s ", "", 1); coccinelle.y = m; elif(e.find("%s:") == True): m = e.replace("%s:", "", 1); coccinelle.y = m; else: m = e.replace("%s", "",1); coccinelle.y = m; @c@ expression a.E, a.msg, a.R; identifier b.y; @@ - dev_err(E, msg, __func__, R); + dev_err(E, y, R); Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> 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-06staging: comedi: drivers: remove extra parentheses around right bit shift ↵Aya Mahfouz
operation Removes extra parentheses around bitwise right shift operation. The issue was detected and resolved using the following coccinelle script: @@ expression e, e1; constant c; @@ e = -(e1 +e1 >> -c); +c; @@ identifier i; constant c; type t; expression e; @@ t i = -(e +e >> -c); +c; @@ expression e, e1; identifier f; constant c; @@ e1 = f(..., -(e +e >> -c) +c ,...); Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: comedi: Remove if condition.Navya Sri Nizamkari
This patch removes a if condition which has a semicolon after it. As the conditional check is redundant, the comment before it is also changed. The following coccinelle script was used to detect the pattern of a semicolon after if. @r1@ position p; @@ if (...);@p @script:python@ p0 << r1.p; @@ // Emacs org-mode output cocci.print_main("", p0) cocci.print_secs("", p0) Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channelIan Abbott
Reading of analog input channels by the `INSN_READ` comedi instruction is broken for all except channel 0. `pci171x_ai_insn_read()` calls `pci171x_ai_read_sample()` with the wrong value for the third parameter. It is supposed to be the current index in a channel list (which is always of length 1 in this case, so the index should be 0), but instead it is passing the actual channel number. `pci171x_ai_read_sample()` checks the channel number encoded in the raw sample value read from the hardware matches the channel number stored in the specified index of the previously set up channel list and returns `-ENODATA` if it doesn't match. Since the index should always be 0 in this case, the match will fail unless the channel number is also 0. Fix it by passing 0 as the channel index. Note that when the bug first appeared, it was `pci171x_ai_dropout()` that was called with the wrong parameter value. `pci171x_ai_dropout()` got replaced with `pci171x_ai_read_sample()` in commit 7fd2dae2500d ("staging: comedi: adv_pci1710: introduce pci171x_ai_read_sample()"). Fixes: 16c7eb6047bb ("staging: comedi: adv_pci1710: always enable PCI171x_PARANOIDCHECK code") Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: stable <stable@vger.kernel.org> # 3.16+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: comedi: adl_pci6208: support old PLX device IDIan Abbott
ADLINK's MS Windows drivers for the PCI-6208/6216 boards include the following line in the DDInstall secion of the INF file: %String6208%=DriverInstall6208.NT,PCI\VEN_10B5&DEV_9050&SUBSYS_62089999 That's for a PLX PCI 9050/9052 PCI interface chip with custom subvendor and subdevice ID. The "%String6208%" macro expands to "ADLINK PCI-6208" in the INF file. Add a corresponding entry to this driver module's PCI device table. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: comedi: adl_pci6208: remove multiple board type supportIan Abbott
This driver module now only supports a single board type, so remove the infrastructure for describing multiple board types. The comedi "auto_attach" handler, `pci6208_auto_attach()` doesn't need to set the comedi device's `board_name` or `board_ptr` members. The former is automatically pointed to the comedi driver's `driver_name` by the core comedi module, and the latter is not used anywhere else. The AO subdevice's `n_chans` member can be set to 16 without looking it up in the single element of `pci6208_boards[]`. There is no need to pass a board index from the PCI device table to the "auto_attach" handler. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: comedi: adl_pci6208: combine PCI-6208 and PCI-6216 supportIan Abbott
This module's PCI device table has separate PCI device IDs for PCI-6208 and PCI-6216, but in reality, both boards and their cPCI and PCIe variants seem to have the same PCI device ID: 0x6208. The PCI subdevice ID doesn't seem to help either. It shouldn't do any harm to claim 16 AO channels for all devices supported by this driver. The original PCI-6216 is just a PCI-6208 with a daughter board providing the extra DACs. The data is clocked out to the DACs serially with no acknowledgment. I assume this would still happen when the DACs for the upper 8 channels are missing. Therefore, change the driver to support a single board type with 16 AO channels, and remove the suspicious PCI device ID for the PCI-6216. Evidence about lack of a separate PCI device ID for PCI-6216 follows.... 1. Jesus Vasquez reports the following lspci output for a PCIe-6216 on his Ubuntu 12.04 system: lspci -n -vvv 07:00.0 1180: 144a:6208 (rev 02) Subsystem: 144a:6208 Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Region 0: Memory at f6000000 (32-bit, non-prefetchable) [size=128] Region 1: I/O ports at c100 [size=128] Region 2: I/O ports at c000 [size=256] Kernel driver in use: adl_pci6208 Kernel modules: adl_pci6208 That system's "adl_pci6208" module only has the single PCI device ID for the PCI-6208, but works for his PCIe-6216 except that it only supports 8 analog output channels instead of 16. 2. ADLINK's binary Linux module "pci6208.ko" (there is no separate module for the PCI-6216) has a single alias: alias: pci:v0000144Ad00006208sv*sd*bc*sc*i* 3. The MS Windows drivers include this set of hardware IDs for the PCI-6208 series, with nothing more specific for the PCI-6216 (they are all tied to the same name "ADLINK PCI-6208" and there is no mention of PCI-6216): PCI\VEN_10B5&DEV_9050&SUBSYS_62089999 PCI\VEN_144A&DEV_6208&SUBSYS_6208144A PCI\VEN_144A&DEV_6208&SUBSYS_62089999 PCI\VEN_144A&DEV_6208&SUBSYS_C208144A PCI\VEN_144A&DEV_6208&SUBSYS_C20855AA PCI\VEN_144A&DEV_6208 Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: comedi: cb_pcimdas: add 8254 timer (pacer) supportH Hartley Sweeten
The hardware has an 8254 timer/counter. Channe; 0 is available as a generic counter/timer with the clock, gate, and output signals all availabe on the main 37 pin connector. Channels 1 and 2 are used for the pacer. Add support for the 8254 timer. 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-02staging: comedi: cb_pcimdas: add main connector digital input/outputH Hartley Sweeten
Add subdevices for the 4 digital input and 4 digital output channels on the main connector of the board. 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-02staging: comedi: cb_pcimdas: tidy up cb_pcimdas_auto_attach()H Hartley Sweeten
For aesthetics, add some whitespace to the subdevice init. Remove the unnecessary comments as well as the initialization of the analog input subdevice 'len_chanlist'. That member is only used by subdevices that support async commands. For aesthetics, rename the analog input subdevice (*insn_read) 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>
2015-03-02staging: comedi: cb_pcimdas: provide analog output range tableH Hartley Sweeten
The analog output range is not programmable. The DAC ranges are jumper-settable on the board. For aesthetics, provide a range table for the user with all possible ranges. 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-02staging: comedi: cb_pcimdas: define the register mapH Hartley Sweeten
Add defines for the registers and bits. Use the defines to remove the "magic" numbers. 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-02staging: comedi: cb_pcimdas: support analog input programmable rangesH Hartley Sweeten
The hardware uses a switch on the board to select if the analog inputs are bipolar or uinipolar. The gain is programmable to allow the following input ranges: Gain Bipolar Unipolar 0 +/-10V 0 to 10V 1 +/-5V 0 to 5V 2 +/-2.5V 0 to 2.5V 3 +/-1.25V 0 to 1.25V Add the necessary code to the driver to allow the user to select the desired range. 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-02staging: comedi: cb_pcimdas: fix analog input channel configurationH Hartley Sweeten
The hardware uses a switch on the board to set the number of analog input channels to either 16 single-ended or 8 differential channels. Currently the switch setting is checked for every (*insn_read) operation to validate the channel number. Check the switch setting during the driver attach and initialize the subdevice accordingly. This allows the core to handle the validation. 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-02staging: comedi: 8253.h: remove unused headerH Hartley Sweeten
All the comedi drivers have been converted to use the comedi_8254 module to provide support for the 8254 timers. Remove this unused header. 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-02staging: comedi: ni_labpc_common: convert driver to use the comedi_8254 moduleH Hartley Sweeten
This driver uses an 8254 timer to generate the pacer clock used for analog input data conversion. Convert it to use the comedi_8254 module to provide support for the 8254 timer. The hardware actually has two 8254 devices. Timer B0 is the master for timed conversions, timer B1 sets the scan pacing, and tmer A0 sets the conversion pacing. For the conversion, dev->pacer is used for the "B" timers and a new private data member, dev->counter, is used for the "A" timers. All the divisor values are stored in the dev->pacer. 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-02staging: comedi: amplc_dio200_common: convert driver to use the comedi_8254 ↵H Hartley Sweeten
module Convert this driver to use the comedi_8254 module to provide the 8254 timer support. Add 'clock_src' and 'gate_src' members to the comedi_8254 data for convienence. 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-02staging: comedi: amplc_dio200_common: remove 'spinlock' from struct ↵H Hartley Sweeten
dio200_subdev_8254 Currently this driver uses a spinlock in the 8254 subdevice (*insn_read), (*insn_write), and (*insn_config) functions. The comedi core checks if the subdevice is 'busy', in parse_insn(), before any of the subdevice functions are attempted. Remove the unnecessary spinlock. 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-02staging: comedi: amplc_dio200_common: remove unnecessary 'counter_number' checksH Hartley Sweeten
The 'counter_number' in these functions is the comedi channel number from the chanspec. The comedi core validates the chanspec before calling the driver functions. 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>
2015-03-02staging: comedi: amplc_dio200_common: remove 'which' from struct ↵H Hartley Sweeten
dio200_subdev_8254 This member is only used in the "set gate" and "set clock" helper functions. Remove it and calculate the value when 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>
2015-03-02staging: comedi: amplc_dio200_common: remove 'gat_sce_ofs' from struct ↵H Hartley Sweeten
dio200_subdev_8254 This member is only used one place in the driver. Remove it and calculate the register offset when 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>
2015-03-02staging: comedi: amplc_dio200_common: remove 'clk_sce_ofs' from struct ↵H Hartley Sweeten
dio200_subdev_8254 This member is only used one place in the driver. Remove it and calculate the register offset when 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>
2015-03-02staging: comedi: amplc_dio200_common: introduce DIO200_GAT_SEL() macroH Hartley Sweeten
Replace the DIO200_[XYZ]GAT_SEL defines with a macro that returns the correct register offset. 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-02staging: comedi: amplc_dio200_common: introduce DIO200_CLK_SEL() macroH Hartley Sweeten
Replace the DIO200_[XYZ]CLK_SEL defines with a macro that returns the correct register offset. 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-02staging: comedi: adl_pci9118: convert driver to use the comedi_8254 moduleH Hartley Sweeten
This driver uses an 8254 timer to generate the pacer clock used for analog input data conversion. Convert it to use the comedi_8254 module to provide support for the 8254 timer. 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>