- 07 Sep, 2014 10 commits
-
-
Loic Pefferkorn authored
Coding style: document spinlock usage Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Loic Pefferkorn authored
Coding style: remove useless space after a cast Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Loic Pefferkorn authored
Coding style: suppress consecutive blank lines Signed-off-by: Loic Pefferkorn <loic@loicp.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michał Bartoszkiewicz authored
This fixes "void function return statements are not generally useful" warnings from checkpatch.pl. Signed-off-by: Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com> Reviewed-by: Insop Song <insop.song@gainspeed.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Thomas Gummerer authored
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Filipe Gonçalves authored
Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Piotr Witoslawski authored
Break lines exceeding 80 characters Signed-off-by: Piotr Witoslawski <pwitos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Juston Li authored
lmv_internal.h:96: ERROR: space prohibited after that open parenthesis '(' lmv_internal.h:96: ERROR: space required before the open parenthesis '(' lmv_internal.h:147: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Juston Li <juston.h.li@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Chaitra Ramaiah authored
Signed-off-by: Chaitra Ramaiah <linux.delve@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Luca Ceresoli authored
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Cc: Greg Kroah-Hartman <gregkh@linux.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 02 Sep, 2014 30 commits
-
-
Grzegorz Swirski authored
Signed-off-by: Grzegorz Swirski <grzegorz@swirski.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Ian Abbott authored
`struct pci230_private` has two members to manage the enabled interrupt sources. `int_en` is the interrupt sources we want to be enabled and `ier` is a shadow of the write-only interrupt enable register. They have the same value most of the time. They differ in the interrupt handler (`pci230_interrupt()`) itself when it temporarily clears bits in the interrupt enable register and the `ier` member in order to unlatch them in hardware, but leaves the `int_en` member alone. They also differ in `pci230_ai_stop()` and `pci230_ao_stop()` which clear bits in the `int_en` member and wait for the interrupt handler to finish before copying the value to the `ier` member and the interrupt enable register. Simplify the handling a bit, by making the `ier` member take on the role of the `int_en` member, and allowing the value to differ from the interrupt enable register while the interrupt handler is running. 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>
-
Ian Abbott authored
Change the return type of `pci230_handle_ao_fifo()` from `int` to `bool`. A return value of `true` indicates the AO command is still running. 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>
-
Ian Abbott authored
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>
-
Ian Abbott authored
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>
-
Ian Abbott authored
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>
-
Ian Abbott authored
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>
-
Ian Abbott authored
Some counter channels may be required for AI commands and AO commands. Depending on how the commands are set up, it may not be possible to run both at the same time, so we keep some state and code to find out if the required resources are busy or not. The existing code is a bit unwieldy - the code for claiming resources involves two `for` loops for example. Rewrite it to make it simpler. The new code just has a bit-mask value for each shared resource (counter channels), and an array indexed by resource "owners" (AI and AO commands), so the code for claiming resources now just has a single loop that checks that none of the other owners have claimed the wanted resources. Rename the functions involved, because the old names involving 'put' and 'get' suggested some sort of usage counting. 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>
-
Ian Abbott authored
The `state` member of `struct pci230_private` is used with the atomic bit-op functions and has a couple of bits defined, `AI_CMD_STARTED` and `AO_CMD_STARTED`. Spin-locks are used to protect the clearing of these bits and other stuff. No special protection is used for setting these bits. Replace the `state` member with a couple of new, single-bit bitfield members, `ai_cmd_started` and `ao_cmd_started` to save some space. 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>
-
Ian Abbott authored
Change the `intr_running` member of `struct pci230_private` into a single-bit bitfield of type `bool` to save a bit of space. 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>
-
Ian Abbott authored
Use the inline `comedi_range_is_bipolar()` function from "comedidev.h" to decide whether a range is bipolar or unipolar instead of using the local static arrays `pci230_ai_bipolar[]` and `pci230_ao_bipolar[]` which can then be removed. Change the types of the `ai_bipolar` and `ao_bipolar` members of `struct pci230_private` to `bool` to match the return value of `comedi_range_is_bipolar()` and change them into single-bit bitfields to save a bit of space. Also change the type and name of some local variables in `pci230_ai_check_chanlist()` that hold the result of `comedi_range_is_bipolar()`. 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>
-
Ian Abbott authored
Most functions in "amplc_pci230" are named with the prefix `pci230_`, apart from one or two that have the prefix `amplc_pci230_` and a few odd-balls with no particular prefix. Rename the ones without a prefix for consistency. 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>
-
Ian Abbott authored
Rename the AI subdevice "insn_read" handler function `pci230_ai_rinsn()` to `pci230_ai_insn_read()` for consistency. 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>
-
Ian Abbott authored
Some functions in "amplc_pci230.c" are declared `inline`. Remove the `inline` specifiers and let the compiler do what it wants with them. 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>
-
Ian Abbott authored
`pci230_ai_read()` reads a sample from the ADC data register and converts it to a comedi sample value. The AI sample may have 12 or 16 bits of resolution, depending on the board type, but 12-bit sample values are in bits 15 to 4 of the register. The hardware value is signed, 2's complement if set to a bipolar mode, or unsigned, straight binary if set to a unipolar mode. To convert to a Comedi sample value it may need shifting right by 4 bits, and the top bit of the sample value may need to be toggled. Simplify the existing code by doing the 2's complement to straight binary conversion before the shift. That way, it is always bit 15 that is inverted regardless of the resolution. 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>
-
Ian Abbott authored
`pci230_ao_mangle_datum()` converts comedi sample values for the AO subdevice to hardware register values. The comedi sample value will be an unsigned value in the range 0 to 4095 (assuming 12-bit resolution). The hardware wants the value shifted so the m.s. bit of the sample in in bit 15. If set to a bipolar range, it also expects a 2's complement value, so the top bit of the sample value needs to be inverted in that case. Simplify the existing code by doing the 2's complement conversion after the shift. That way, it is always bit 15 that is inverted regardless of the resolution. 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>
-
Ian Abbott authored
The `ai_bits`, `ao_bits`, and `min_hwver` members of `struct pci230_board` are only set to small, non-negative values, so make them `unsigned char`. The `have_dio` member is used as a boolean so change it to a bitfield of type `bool`. 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>
-
Ian Abbott authored
The PCI230(+) has an AO subdevice with 2 channels, but the PCI260(+) has none. The `ao_chans` member of `struct pci230_board` indicates whether the board has an AO subdevice and the number of AO channels. The `ao_bits` member indicates the AO sample width in bits and will only be non-zero for boards with an AO subdevice. Use `ao_bits` to indicate whether the board has an AO subdevice. If it has, assume the the number of AO channels is 2. Then the `ao_chans` member becomes redundant and can be removed. 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>
-
Ian Abbott authored
All boards supported by the "amplc_pci230" driver have 16 AI channels, so the `ai_chans` member of `struct pci230_board` is superfluous and can be removed. 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>
-
Ian Abbott authored
`pci230_alloc_private()` is now only called from `pci230_auto_attach()` to allocate private device storage and initialize various spin-lock members therein. Absorb the body of `pci230_alloc_private()` into `pci230_auto_attach()` itself. 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>
-
Ian Abbott authored
The comedi core module calls `comedi_set_hw_dev()` to associate the hardware `struct device` with the `struct comedi_device` before it calls the comedi driver's "auto_attach" hook `pci230_auto_attach()`. There is no need for `pci230_auto_attach()` to call `comedi_set_hw_dev()` itself, so remove the call. 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>
-
Ian Abbott authored
`pci230_attach_common()` is now only called from `pci230_auto_attach()`, so absorb it into that function. 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>
-
Ian Abbott authored
Since the comedi driver's "detach`" handler `pci230_detach()` now merely calls `comedi_pci_detach()` with the same parameter, use `comedi_pci_detach()` itself as the "detach" handler. 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>
-
Ian Abbott authored
This driver no longer supports a "legacy" attach mechanism that searches for a suitable PCI device and increments it's reference count, but since the common "detach" handler `pci230_detach()` still has a left-over `pci_dev_put()`, a matching `pci_dev_get()` is needed in the "auto_attach" handler `pci230_auto_attach()`. There is no longer any reason to "get" and "put" the PCI device, so those calls can be removed. 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>
-
Ian Abbott authored
The "amplc_pci230" driver currently retains the legacy attach mechanism to allow devices to be attached manually via the `COMEDI_DEVCONFIG` ioctl. The only real use for this is to pretend that a PCI230+ or PCI260+ is a PCI230 or PCI260 for backwards compatibility, as they have different number of bits of resolution on the AI subdevice. Since the card would be automatically configured as a PCI230+ or PCI260+ at PCI probe time anyway, hopefully any users who want it to appear as a PCI230 or PCI260 would have got tired of removing the automatically configured device and configuring it manually by now and will have updated their software to cope with the PCI230+ or PCI260+. Get rid of the legacy attach mechanism by removing the Comedi driver "attach" handler `pci230_attach()` and associated code. Also remove the "wildcard" entry from the board table `pci230_boards[]` as it is no longer needed. Don't bother initializing the `board_name`, `offset`, and `num_names` members of `struct comedi_driver amplc_pci230_driver` any longer as they are only needed when configuring the device manually. 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>
-
Ian Abbott authored
Where the only thing in an `else { ... }` block is another `if` statement, collapse it to an `else if {` block where it makes sense to do so. 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>
-
Ian Abbott authored
Remove some pairs of parentheses that don't really improve readability. Also, reduce the amount of leading whitespace in a few places. 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>
-
Ian Abbott authored
Fix checkpatch issues: "CHECK: Please don't use multiple blank lines". 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>
-
Ian Abbott authored
Replace the generic, Comedi low-level driver module description string with something more specific. 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>
-
navin patidar authored
Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-