Commit graph

589851 commits

Author SHA1 Message Date
Laura Abbott
d03c023e1e MAINTAINERS: Add Android Ion as a separate entry
The android drivers have a few other people reviewing patches.
Add a separate entry to ensure patches go to the right people.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:03:07 -07:00
Jes Sorensen
af4981fc59 staging: rtl8723au: Add warning about this driver being deprecated
This driver is deprecated and superseded by rtl8xxxu. It will be
removed in a future kernel release.

Add a warning to Kconfig and at device init time to notify users and
allow them time to switch over.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 10:38:23 -07:00
H Hartley Sweeten
6c3b78aa6e staging: comedi: mite: don't expose CHSR_* bit defines
These bit defines are only used in the mite driver. Move them so they
are not needlessly exposed.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
0c912e5c9c staging: comedi: mite: return void from mite_ack_linkc()
Currently this function returns the value read from the mite channel
status register. None of the callers use, or need, the returned value.

For aesthetics, change the return to void.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
f7d005c33c staging: comedi: mite: make mite_ack_linkc() handle mite_sync_dma()
The mite dma is always synced on a LINKC status. Some of the mite users
sync the dma regadless of the status.

Add a 'sync' parameter to mite_ack_linkc() to force a dma sync. Then do
the dma sync as 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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
3da088cae2 staging: comedi: ni_mio_common: handle_a_interrupt() does not need ai_mite_status
This function only handles the analog input interrupts, the dma was already
handled.

Remove the unecessary parameter and fix ni_E_interrupts() so that the comedi
events are properly handled.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
7101711ee4 staging: comedi: ni_mio_common: simplify AI LINKC handling
Simplfy the LINKC handing for the analog input dma by moving it into
the main interrupt handler. This function already hold the spinlock
mite_channel_lock so call mite_sync_dma() directly instead of using
the helper 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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
ba5c0da886 staging: comedi: ni_mio_common: fix interrupt handler for dev->read_subdev
There may not be a dev->read_subdev, i.e. an analog input subdevice, that
supports async commands. If it doesn't exist the interrupt/dma will never
be enabled.  Fix ni_E_interrupt() so that the analog input subdevice is
only handled if it exists.

This also fixes minor NULL dereference issue in handle_a_interrupt().
If the dev->read_subdev is NULL the comedi_async pointer (s->async) will
not be allocated by the device postconfig so there is no way to get a
valid comedi_cmd (&s->async->cmd).

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
4b2d73898f staging: comedi: ni_mio_common: handle_b_interrupt() does not need ao_mite_status
This function only handles the analog input interrupts, the dma was already
handled.

Remove the unecessary parameter and fix ni_E_interrupts() so that the comedi
events are properly handled.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
7ef1745f29 staging: comedi: ni_mio_common: fix interrupt handler for dev->write_subdev
There may not be a dev->write_subdev, i.e. an analog output subdevice, that
supports async commands. If it doesn't exist the interrupt/dma will never
be enabled.  Fix ni_E_interrupt() so that the analog output subdevice is
only handled if it exists.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
72639a1670 staging: comedi: ni_mio_common: absorb mite_handle_b_linkc()
Simplfy the LINKC handing by removing the helper function and moving
the mite_sync_dma() into the main interrupt handler.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
cc38da7287 staging: comedi: mite: check for transfer errors in mite_ack_linkc()
Currently only some of the users of mite dma check for transfer errors.

The ni_mio_common code does the check for the analog input and analog
output subdevices. The m-series digital I/O subdevice and the counter
subdevices (handled by ni_tiocmd) do not check.

The ni_pcidio driver checks for the digital input subdevice.

The ni_660x driver counter subdevices (handled by ni_tiocmd) also do
not check.

Move the transfer error checking into mite_ack_linkc() so that the
drivers that use mite don't have to deal with it. This also makes
sure that all the subdevices that use mite for dma will cancel the
async command if a transfer error is detected.

Simplfy the transfer error check by just checking the CHSR_XFERR bit.
This bit will be set if one or more transfer processes terminated with
an error. The actual error is determined by the LERR, MERR, and DERR
bits.

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>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten
21e871fef7 staging: comedi: mite: cleanup remaining mite register/bits
For aesthetics, convert the register/bit enums into defines and
use the BIT() macro to define the bits.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
7024cc88bf staging: comedi: mite: remove BUG_ON() in MITE_IODWBSR_1_WSIZE_bits()
Prior to calling this function pci_ioremap_bar() is called. If the
pci_resource_len(), i.e. the 'size', was 0 the ioremap would fail
so this function would never be called. So the first BUG_ON() can
never occur.

The 'order' returned by ilog2() will always be > 0 so the second
BUG_ON() will also never occur.

Remove the unnecessary BUG_ON() checks and tidy up the function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
43d667243c staging: comedi: mite: document the mite_struct spinlock_t
Add a comment to fix the checkpatch.pl issue:
CHECK: spinlock_t definition without 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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
268bc9cd3a staging: comedi: mite: rename CamelCase CHSR bit enums
Rename the CamelCase symbols to fix the checkpatch.pl issues.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
51d430056c staging: comedi: mite: introduce mite_sync_dma()
The struct mite_channel 'dir' member specifies if the dma is input
or output. Wrap the mite_sync_input_dma() and mite_sync_output_dma()
functions with a single mite_sync_dma() so that the drivers don't
have to worry about the sync direction.

The functions that actually sync the input/output dma currently return
-1 if an overflow/underrun is detected otherwise they return 0. If an
overflow/underrun is detected the async->event COMEDI_CB_OVERFLOW is
also set.

The callers never check the return value anyway so just make the
functions return void. The async->event can be checked if necessary
to detect any errors.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
33b0b6913d staging: comedi: mite: don't expose unnecessary register/bit info
Most of the mite registers are only accessed by the mite driver.
There is no reason to expose the register/bit info. Remove this
info from the header.

For aesthetics, convert the bit info enums into defines and use
the BIT() macro to define them. Tidy up the inline functions for
the retry limit and drq reqs bits in the config 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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
4d88096df9 staging: comedi: mite: introduce mite_ack_linkc()
Introduce a helper function to handle the ack of a LINKC interrupt.
Tidy up the drivers that use the new helper.

The extra check for CHSR_INT in the ni_pcidio driver is not necessary.
This bit will be set if any of the interrupt sources, including CHSR_LINKC,
have generated an interrupt. Remove the extra check.

The mite_get_status() function is now only used by the mite driver.
Make it static and remove the export.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
96f3153000 staging: comedi: mite: don't expose mite_dma_reset()
This function is only called by the mite driver. Remove the inline
function from the header and make it static in the driver.

Use the function in mite_prep_dma() instead of duplicating the 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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
eecbadef12 staging: comedi: ni_pcidio: remove redundant mite disarm/reset
The mite_release_channel() will disarm and reset the mite channel.
Remove the redundant calls in ni_pcidio_release_di_mite_channel().

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
ef81f55b07 staging: comedi: mite: remove mite_struct member 'daq_phys_addr'
This member of mite_struct is only used to map the mite I/O window.
For aesthetics, remove it and use a local variable 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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
0db6624ae0 staging: comedi: mite: remove mite_struct member 'mite_phys_addr'
This member of mite_struct is set but never used. Just remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
0d9bfc2412 staging: comedi: mite: don't export internal functions
The functions that get the number of bytes written to and read from
memory are only used internally by the mite driver when syncing the
dma channel. Make them static and remove the exports.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
a2a9d1b4c5 staging: comedi: mite: remove mite_dma_tcr()
This exported function is not used by any of the comedi drivers. The
only call point in mite.c is commented out. Remove the unused function
and the export.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
ace613ee7c staging: comedi: mite: remove TOP_OF_PAGE() macro
This macro is not used. 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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
aac00ea22c staging: comedi: mite: Prefer 'unsigned int' to bare use of 'unsigned'
Fix the checkpatch.pl issues.

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>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten
6f7fa70464 staging: comedi: ni_mio_common: introduce NI_STC_DMA_CHAN_SEL()
The inline helper ni_stc_dma_channel_select_bitfield() returns the
bits needed to select a MITE channel to use for DMA. The MITE code
is setup to handle up to 8 channels but in reality only channels 0
to 3 are used by most of the drivers. The PCI-6032E and PCI-6033E
boards can also use channels 4 and 5.

For aesthetics, convert this inline function into a macro and
remove the BUG() which will never occur.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
bbd962206c staging: comedi: mite.h: rename CHSR_LxERR_mask
Fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <CHSR_LxERR_mask>

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
b24a3ecd46 staging: comedi: ni_mio_common: fix CamelCase in ni_serial_hw_readwrite8()
Fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <Error>

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
68556ffc95 staging: comedi: ni_mio_common: remove 'fudge_factor_80_to_20Mhz'
For aesthetics, remove this local variable to fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <fudge_factor_80_to_20Mhz>

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
8a5b817ff7 staging: comedi: ni_mio_common: usleep_range is preferred over udelay
Fix the checkpatch.pl issues.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
2e2f7b7037 staging: comedi: ni_mio_common: tidy up ni_gpct_write_register()
The 'bits' value passed to this function is properly set by the callers
so the BUG_ON() can never occur when writing to the NITIO_G[01]_INT_ENA
and NITIO_G01_RESET registers. Remove the BUG_ON() checks.

For aesthetic, also remove the static const variables. They don't add
any additional clarity.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
1392dccbbd staging: comedi: ni_mio_common: tidy up AO scan begin
The (*do_cmdtest) validates that the cmd->scan_begin_src will only be
TRIG_TIMER or TRIG_EXT. Refactor ni_ao_cmd_set_update() and remove the
BUG() which can never occur.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
55f9e7d9d3 staging: comedi: ni_mio_common: tidy up AO trigger selection
The AO subdevice (*cancel), ni_ao_reset(), always sets the private
data 'ao_trigger_select' to 0. So when a command is started the
'trigsel' value in ni_ao_cmd_set_trigger() will always start as 0.
Remove the unnecessary member from the private data.

The (*do_cmdtest) validates that the cmd->start_src will only be
TRIG_INT or TRIG_EXT. Refactor ni_ao_cmd_set_trigger() and remove
the BUG() which can never occur.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
0b235d5ce4 staging: comedi: ni_mio_common: convert NI_GPCT_SUBDEV to a macro
The 'counter_index' is always in range (0 to < NUM_GPCT, which is 2).

For aesthetics, convert this inline function into a macro and remove
the BUG() which can never occur.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
73894987d6 staging: comedi: ni_mio_common: fix logical continuations
Fix the checkpatch.pl issues:
CHECK: Logical continuations should be on the previous line

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
beb1cc1b02 staging: comedi: ni_mio_common: multiple assignments should be avoided
Fix the checkpatch.pl issues.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
b6a0e5b32a staging: comedi: ni_mio_common: fix lines over 80 characters
Fix the checkpatch.pl issues.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
bd474a02d3 staging: comedi: ni_mio_common: tidy up block comments
Fix the checkpatch.pl issues.
WARNING: Block comments use * on subsequent 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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
546615f9f9 staging: comedi: ni_mio_common: use 'unsigned int' instead of kernel types
Generally comedi drivers use 'unsigned int' types instead of the kernel type
'u32' for unsigned 32-bit values.

For aesthetics, change all the 'u32' and 'uin32_t' types and fix the
checkpatch.pl issues about:
CHECK: Prefer kernel type 'u32' over 'uint32_t'

The various i/o helpers use for reading and writing the 32/16/8-bit registers
all start with an 'unsigned int' value for writing and finally return an
'unsigned int' value. For aesthetics, change all the 'uint16_t' and 'uint8_t'
types for insigned int and fix the checkpatch.pl issues about:
CHECK: Prefer kernel type 'u16' over 'uint16_t'

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
fe20a34aff staging: comedi: ni_mio_common: Prefer 'unsigned int' to bare use of 'unsigned'
Fix the checkpatch.pl issues.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
cf122bb4a6 staging: comedi: ni_mio_common: tidy up DIO subdevice ifdef'ery
This file is is bit of a mess. It's included by the ni_atmio, ni_mio_cs, and
ni_pcimio drivers. The ni_pcimio driver is the only one that uses DMA. It
defines PCIDMA so that the dma code is compiled it. This causes a bunch
of ifdef'ery in the file.

The DIO subdevice for the ni_pcidio "is_m_series" boards is quite different
from the standard e-series DIO. Mainly it supports async commands that use
DMA.

Tidy up some of the ifdef'ery by adding ifdef to the subdevice init. Move
the is_m_series check to the main interrupt handler so that the unneded
handle_cdio_interrupt() can be blocked out for the ni_atmio and ni_mio_cs
drivers.

Consolidate the other ifdef's to block out the affected 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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
b7cd3f6049 staging: comedi: ni_mio_common: tidy up mite dma channel releases
Absorb the inline helper functions that call ni_set_bitfield() to clear
the dma channel selection bits.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
38b81a7a41 staging: comedi: ni_mio_common: tidy up mite dma channel requests
Tidy up the functions that request the mite dma channels by absorbing the
inline helper functions that call ni_set_bitfield() to set the channel
selection bits.

Add support for the NI_M_CDIO_DMA_SEL_REG register to ni_set_bitfield()
so that all the soft_reg_copy_lock spinlocking is done in one place.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
bf2388b1ea staging: comedi: ni_mio_common: remove some unnecessary BUG_ON()
The mite dma channels are only requested by a subdevice with a (*do_cmd)
and they are released by a (*cancel). The comedi core will only call the
(*do_cmd) if the subdevice is not already running a command and all
commands are terminated by the core with a (*cancel).

Remove the BUG_ON() checks in the request functions which can never
happen.

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>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten
098353038b staging: comedi: das1800: update the MODULE_DESCRIPTION
Change the MODULE_DESCRIPTION to something more usefull 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>
2016-04-28 22:16:10 -07:00
H Hartley Sweeten
a6b7dbb2be staging: comedi: das1800: allow setting the external trigger polarity
The external pin TGIN can be used to start and/or stop the analog input
command. Currently the driver only supports negative edge polarity for
this signal.

Add support to allow the user to select positive edge polarity using
the CR_INVERT flag.

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>
2016-04-28 22:16:10 -07:00
H Hartley Sweeten
a2706b0943 staging: comedi: das1800: clarify the analog input cmd triggers
Clarify the documentation in the comedi driver comment block to
better explain the cmd triggert.

Add a comment to step 2b of the (*do_cmdtest) to clarify the
trigger check.

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>
2016-04-28 22:16:10 -07:00
H Hartley Sweeten
5f657f8bf3 staging: comedi: das1800: fix comments about the 'ao' board range
The waveform analog outputs on the 'ao' boards are not currently
supported. Modify the comment about the analog output range on
these boards so that the information is saved but fixes the
checkpatch.pl issues:
WARNING: Block comments use a trailing */ on a separate line

Move the comment so it's grouped with the comedi_lrange info.

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>
2016-04-28 22:16:10 -07:00