summaryrefslogtreecommitdiff
path: root/drivers/staging
AgeCommit message (Collapse)AuthorFilesLines
2016-01-07phy: Centralise print about attached phyAndrew Lunn1-2/+1
Many Ethernet drivers contain the same netdev_info() print statement about the attached phy. Move it into the phy device code. Additionally add a varargs function which can be used to append additional information. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07phy: add phydev_name() wrapperAndrew Lunn1-3/+3
Add a phydev_name() function, to help with moving some structure members from phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07staging: mt29f_spinand: make use of nand_set/get_controller_data() helpersBoris BREZILLON1-5/+5
New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2016-01-04Merge branch 'memdup_user_nul' into work.miscAl Viro3-12/+14
2015-12-30switch ->get_link() to delayed_call, kill ->put_link()Al Viro1-9/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-12-26staging: gdm724x: constify tty_port_operations structsAya Mahfouz1-1/+1
Constifies tty_port_operations structure in the tty code of the gdm724x driver since it is not modified after its initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-26staging: gdm72xx: add userspace data structWim de With2-5/+14
This fixes the sparse warnings about dereferencing a userspace pointer. Once I updated the sparse annotations, I noticed a bug in gdm_wimax_ioctl() where we pass a user space pointer to gdm_update_fsm() which dereferences it. I fixed this. Signed-off-by: Wim de With <nauxuron@wimdewith.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-26staging: gdm72xx: Replace timeval with ktime_tArnd Bergmann2-9/+8
struct sdu_stamp in the gdm_sdio.h is a timeval type. 'struct timeval now' is used for calculating elapsed time. 32-bit systems using 'struct timeval' will break in the year 2038, so we have to replace that code with more appropriate types. This patch changes the gdm72xx driver to use ktime_t. ktime_get() is better than using do_gettimeofday(), because it uses the monotonic clock. ktime_sub are used to subtract two ktime variables. Build tested this by saying Y to WIMAX_GDM72XX. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-26Merge tag 'iio-for-4.5c' of ↵Greg Kroah-Hartman1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Third set of new stuff for IIO in the 4.5 cycle. New driver features - us5182 * Add interrupt support and rising / falling threshold events. Cleanups / fixes to new stuff / minor additions * Expose the IIO value formatting function for drivers to make use of internally. - ina2xx * Fix wrong channel order * Fix incorrect reporting of endianness * Adding documentation of ABI unique to this device - mma8452 * Drop an unused register description * Use an enum for the channel index to aid readability - sca3000 * Use standard NULL comparison style - us5182 * fix an inconsistency in status of enable (a bug with no real effect until above patches are applied) * refactor the read_raw function to improve maintainability / readability.
2015-12-26Merge tag 'iio-for-4.5b' of ↵Greg Kroah-Hartman6-6/+6
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle. The big one here is the configfs support which has been a long time in the works but should allow for cleaner ways to do instantiation of those elements of IIO that aren't directly connected to specific hardware. Lots of cool new stuff we can use this for in the works! New core stuff (basically all configfs support related) * Configfs support - Core support (was waiting for a configfs patch that went in around 4.4rc2) - A little fixlet to add a configfs.h to contain a reference to the configfs_subsystem structure. * Some infrastructure to simplify handling of software based triggers (i.e. ones with no actual hardware associated with them) * A high resolution timer based trigger. This has been around for years but until the configfs support was ready we didn't have a sensible way of instantiating instances of it (the method used for the sysfs_trigger has never been really satisfactory) New Device Support * AMS iAQ Volatile Organic Compounds sensor support. * Freescale imx7d ADC driver * Maxim MAX30100 oximeter driver (note that for these devices most of the smart stuff will be in userspace - effectively they are just light sensors with some interesting led synchronization as far as the kernel is concerned). * Microchip mcp3421 support added to the mcp3422 driver. * TI adc124s021 support added to the adc128s052 driver. * TI ina219, inda226 power monitors. Note that there is an existing hwmon driver for these parts, the usecase is somewhat different so it is unclear at this point if the hwmon driver will eventually be replaced by a bridge from this driver. In the meantime the Kconfig dependencies should prevent both from being built. New driver functionality * us8152d power management support. Cleanups, fixups * Use list_for_each_entry_safe instead of list_for_each_safe with the entry bit coded longhand. * Select IRQ_WORK for IIO_DUMMY_EVGEN. This is a fix that somehow got lost when the driver was moved so lets do it again. * st-accel - drop an unused define. * vz89x, lidar - optimize i2c transactions by using a single i2c tranfers instead of multiple calls where supported (fall back to smbus calls as before if not). * Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency drivers instead of direct access to the structure element.
2015-12-23IB: remove the write-only usecnt field from struct ib_mrChristoph Hellwig1-1/+0
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@sandisk.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-23ehca: stop using struct ib_phys_bufChristoph Hellwig2-53/+46
And simplify the calling convention for full-memory registrations. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core] Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-23amso1100: fold c2_reg_phys_mr into c2_get_dma_mrChristoph Hellwig1-57/+14
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core] Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-23IB: remove in-kernel support for memory windowsChristoph Hellwig5-20/+0
Remove the unused ib_allow_mw and ib_bind_mw functions, remove the unused IB_WR_BIND_MW and IB_WC_BIND_MW opcodes and move ib_dealloc_mw into the uverbs module. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core] Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-23IB: remove support for phys MRsChristoph Hellwig11-455/+1
We have stopped using phys MRs in the kernel a while ago, so let's remove all the cruft used to implement them. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core] Reviewed-By: Devesh Sharma<devesh.sharma@avagotech.com> [ocrdma] Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-23IB: remove ib_query_mrChristoph Hellwig3-52/+0
This functionality has no users and was only supported by the staged out EHCA driver. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> [core] Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-22Merge tag 'renesas-gic-cleanup-for-v4.5' of ↵Olof Johansson2-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/cleanup Renesas ARM Based SoC GIC Cleanup for v4.5 On several Renesas ARM SoCs, the GIC is described in DT as being a Cortex A9 GIC, while it's actually a PL390. This is not only stated in the documentation, but has been verified by reading the GICD_IIDR register. To correct this: 1. Update the DT compatible value to match reality, 2. Update the board staging drivers to match the above. * tag 'renesas-gic-cleanup-for-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: staging: board: armadillo800eva: Use "arm,pl390" staging: board: kzm9d: Use "arm,pl390" ARM: shmobile: r8a7778 dtsi: Use "arm,pl390" for GIC ARM: shmobile: emev2 dtsi: Use "arm,pl390" for GIC ARM: shmobile: r8a7740 dtsi: Use "arm,pl390" for GIC ARM: shmobile: r7s72100 dtsi: Use "arm,pl390" for GIC Signed-off-by: Olof Johansson <olof@lixom.net>
2015-12-22staging/o2iblnd: Avoid calling ib_query_deviceOr Gerlitz1-20/+1
Instead, use the cached copy of the attributes present on the device. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-21staging: emxx_udc: use list_first_entry_or_null()Geliang Tang1-25/+5
Simplify the code with list_first_entry_or_null(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging/emxx_udc: fix 64-bit warningsArnd Bergmann1-5/+5
ARCH_SHMOBILE is coming to arm64, which creates new warnings in allmodconfig: drivers/staging/emxx_udc/emxx_udc.c: In function '_nbu2ss_out_dma': drivers/staging/emxx_udc/emxx_udc.c:843:45: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] _nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pBuffer); This is clearly a mistake from confusing a dma_addr_t with a pointer, so the fix is to use the correct types in two places. The third warning of this kind is a check for an unaligned pointer, which should be done by casting the pointer to uintptr_t, not int. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21STAGING: COMEDI: Using kernel types in plx9080.hMoritz König1-1/+1
This patch makes plx9080.h use kernel types. Signed-off-by: Moritz König <moritz.koenig@fau.de> Signed-off-by: Fabian Lang <fabian.lang@fau.de> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Acked-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21STAGING: COMEDI: Added spaces around binary operators in plx9080.hMoritz König1-1/+1
This patch adds spaces around binary operators in plx9080.h. Signed-off-by: Moritz König <moritz.koenig@fau.de> Signed-off-by: Fabian Lang <fabian.lang@fau.de> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21STAGING: COMEDI: Fixed format of comments in plx9080.hMoritz König1-44/+78
This patch fixes the format of comments in plx9080.h. Signed-off-by: Moritz König <moritz.koenig@fau.de> Signed-off-by: Fabian Lang <fabian.lang@fau.de> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: comedi: comedilib.h: Coding style warning fix for block commentsJitendra Kumar Khasdev1-16/+16
This patch is to comedilib.h file that fixes up following warnings reported by checkpatch.pl : I) Block comments use * on subsequent lines. Apart from it I have remove header file path by base file name as suggested by community. Signed-off-by: Jitendra Kumar Khasdev <jkhasdev@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: comedi: s526: add macros for counter control reg valuesIan Abbott1-4/+37
The driver writes a couple of literal values to the counter control/status register, 0x8000 to reset the counter, and 0x4000 to load the counter from preload register 0. Add a bunch of macros to define these values and other values for the register, based on the Sensoray 526 manual. 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-12-21staging: comedi: s526: replace counter mode bitfield structIan Abbott1-63/+93
The driver uses `struct counter_mode_register_t` to describe the 16-bit counter mode register as a sequence of bitfield members. The struct appears as the type of one of the members of `union cmReg`, the other member of which is of type `unsigned short`, so the driver can manipulate the register value as a whole, or as individual fields. Although this is fairly convenient, it's not that conventional. The code also needs to define the bitfield members in ascending or descending order of the physical bits, depending on whether bitfields are little- or big-endian. Rip all that out and replace it with a bunch of macros to set and mask out bits of the register value, as that's the more conventional way to do it. A bonus is that we get rid of a load of CamelCase definitions in the process. 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-12-21staging: comedi: check for more errors for zero-length writeIan Abbott1-3/+4
If the "write" file operation handler, `comedi_write()` is passed 0 for the amount to write, some error conditions are currently skipped and the function just returns 0. Change it to check those error conditions and return an error value if appropriate. The trickiest case is the check for when the previously set up asynchronous command has terminated with an error. In that case, `-EPIPE` is returned (as it is for a write of non-zero length) and the subdevice gets marked as non-busy. A zero-length write that returns 0 has no other effects, in particular, it does not cause the subdevice to be marked as non-busy. 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-12-21staging: comedi: simplify returned errors for comedi_write()Ian Abbott1-18/+3
In order to perform a "write" file operation, an asynchronous COMEDI command in the "write" direction needs to have been set up by the current file object on the COMEDI "write" subdevice associated with the file object. If there is a "write" subdevice, but a command has not been set up by the file object (or is has been set-up in the wrong direction), `comedi_write()` currently returns one of two error values `-EINVAL` or `-EACCES`. `-EACCES` is returned if the command was set up by a different subdevice, or somewhat randomly, if a COMEDI "instruction" is currently being processed. `-EINVAL` is returned in other cases. Simplify it by returning `-EINVAL` for all these cases. 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-12-21staging: comedi: return error on "write" if no command set upIan Abbott1-3/+8
The "write" file operation handler, `comedi_write()` returns an error for pretty much any condition that prevents a "write" going ahead. One of the conditions that prevents a "write" going ahead is that no asynchronous command has been set up, but that currently results in a return value of 0 (unless COMEDI instructions are being processed or an asynchronous command has been set up by a different file object). Change it to return `-EINVAL` in this case. 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-12-21staging: comedi: allow buffer wraparound in comedi_write()Ian Abbott1-5/+9
`comedi_write()` copies data from the user buffer to the acquisition data buffer, which is cyclic, using a single call to `copy_from_user()`. It currently avoids having to deal with wraparound of the cyclic buffer by limiting the amount it copies (and the amount returned to the user). Change it to deal with the wraparound using two calls to `copy_from_user()` if necessary. 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-12-21staging: comedi: avoid bad truncation of a size_t in comedi_write()Ian Abbott1-8/+5
At one point in `comedi_write()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of writeable buffer space. The way that is done currently is unsafe in the unlikely case that `nbytes` exceeds `UINT_MAX`, so fix it. 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-12-21staging: comedi: make some variables unsigned in comedi_write()Ian Abbott1-1/+3
In `comedi_write()`, the `n` and `m` variables are of type `int`. Change them to `unsigned int` as they are used to measure a positive number of bytes. The `count` variable is also of type `int` and holds the returned number of bytes written. Change it to type `ssize_t` to match the function's return type. 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-12-21staging: comedi: do extra checks for becoming non-busy for "write"Ian Abbott1-1/+6
`comedi_write()` is the handler for the "write" file operation for COMEDI devices. It mostly runs without using the main mutex of the COMEDI device, but uses the `attach_lock` rw_semaphore to protect against the COMEDI device becoming "detached". A file object can write data for a COMEDI asynchonous command if it initiated the command. The COMEDI subdevice is marked as busy when the command is started. At some point, the "write" handler detects that the command has terminated and so marks the subdevice as non-busy. In order to mark the subdevice as non-busy, the "write" handler needs to release the `attach_lock` rw_semaphore and `acquire the main `mutex`. There is a vulnerable point between the two, so it checks that the device is still attached after acquiring the mutex. However, it does not currently check that the conditions for becoming non-busy still hold. Add some more checks that the subdevice is still busy with a command initiated by the same file object, and that the command is in the correct direction (in case the subdevice supports both "read" and "write"). 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-12-21staging: comedi: rearrange comedi_write() codeIan Abbott1-41/+30
Rearrange the code in `comedi_write()` to reduce the amount of indentation. The code never reiterates the `while` loop once `count` has become non-zero, so we can check that in the `while` condition to save an indentation level. (Note that `nbytes` has been checked to be non-zero before entering the loop, so we can remove that check.) Move the code that makes the subdevice "become non-busy" outside the `while` loop, using a new flag variable `become_nonbusy` to decide whether it needs to be done. This simplifies the wait queue handling so there is a single place where the task is removed from the wait queue, and we can remove the `on_wait_queue` flag variable. 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-12-21staging: comedi: adv_pci_dio: update the MODULE_DESCRIPTIONH Hartley Sweeten1-1/+1
Change the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level 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>
2015-12-21staging: comedi: adv_pci_dio: tidy up the comedi comment blockH Hartley Sweeten1-6/+3
The Description is a bit long winded and the same information is in the Devices. Shorten the Description and tidy up the Devices. 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-12-21staging: comedi: adv_pci_dio: move pci_dio_override_cardtype()H Hartley Sweeten1-32/+32
This function is called as part of the pci_driver (*probe) before doing the (*auto_attach) of the comedi driver. For aesthetics, move the function to a more logical place in 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>
2015-12-21staging: comedi: adv_pci_dio: move and rename the MAX_*_SUBDEV[SG] definesH Hartley Sweeten1-11/+11
For aesthetics, move these defines after the register defines and rename them to have namespace associated with the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: comedi: adv_pci_dio: move and rename enum hw_cards_idH Hartley Sweeten1-12/+17
For aesthetics, move this enum after the register defines and rename it to have namespace associated with the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: comedi: adv_pci_dio: remove boardinfo 'cardtype'H Hartley Sweeten1-24/+7
This member of the boardinfo is identical to the offset of the boardinfo in the boardtypes array. It's also passed as the 'context' to the driver (*auto_attach). The 'cardtype' is only needed by the (*auto_attach) to determine which PCI BAR to use and in pci_dio_reset() to handle the board specific code. Remove the 'cardtype' member and use the 'context' value instead. 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-12-21staging: comedi: adv_pci_dio: cleanup PCI-1762 interrupt registersH Hartley Sweeten1-4/+3
For aesthetics, use a common define for the interrupt control and status registers. 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-12-21staging: comedi: adv_pci_dio: rename PCI1752_6_CFC defineH Hartley Sweeten1-2/+3
For aesthetics, rename this define and fix the alignment. 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-12-21staging: comedi: adv_pci_dio: cleanup PCI-175[46] interrupt registersH Hartley Sweeten1-12/+9
For aesthetics, replace these defines with a macro. Refactor the switch in pci_dio_reset() to use common 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>
2015-12-21staging: comedi: adv_pci_dio: cleanup PCI-1753 interrupt register definesH Hartley Sweeten1-19/+14
For aesthetics, replace these defines with some macros. Refactor the switch in pci_dio_reset() to not require the fallthrough comment. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-21staging: comedi: adv_pci_dio: use common defines for PCI-1739/175[01] registersH Hartley Sweeten1-12/+3
These boards use the same offsets for the interrupt control registers. For aesthetics, remove the current defines and use common ones. Fix the switch() in pci_dio_reset() to use common 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>
2015-12-21staging: comedi: adv_pci_dio: use common defines for PCI-173[036] registersH Hartley Sweeten1-19/+11
These boards use the same offsets for the interrupt control registers. For aesthetics, remove the current defines and use common ones. Fix the switch() in pci_dio_reset() to use common 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>
2015-12-21staging: comedi: adv_pci_dio: cleanup "disable and clear interrupts" commentsH Hartley Sweeten1-18/+6
For aesthetics, use a common comment for the switch() that disables and clears interrupts. 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-12-21staging: comedi: adv_pci_dio: disable channel freeze outside of switchH Hartley Sweeten1-6/+4
For aesthetics, move the disable of the channel freeze for the PCI-1752 and PCI-1756 boards out of the switch used to disable and clear interrupts. 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-12-21staging: comedi: adv_pci_dio: use a default case in pci_dio_reset()H Hartley Sweeten1-7/+2
For aesthetics, use a default case in the switch (board->cardtype) used to reset the various boards. 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-12-21staging: comedi: adv_pci_dio: remove defines used for the dio (8255) registersH Hartley Sweeten1-9/+5
These defines are only used to initialize the diosubd_data 'addr' members in the boardinfo. For aesthetics, just open-code the values and remove the defines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>