The ai (*do_cmd_test) validates the trigger sources in Step 2b to ensure
that they are compatible. Save the 'ai_ctrl_mode' that will be used in the
private data so that ai_prepare(), which is called by the ai (*do_cmd),
does not have to recheck the sources in order to figure it out.
Also, tidy up the stop trigger checks so that the ME4000_AI_CTRL_HF_IRQ
bit is set in the common code path.
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>
staging: comedi: me4000: move ai command timing values into private data
The ai (*do_cmd_test) calls me4000_ai_round_cmd_args() to calculate the
timing values needed to the command. The the command test passes, the
core will then call the ai (*do_cmd) which then has to call
me4000_ai_round_cmd_args() again in order to get the same values to
pass to ai_prepare() in order to program the timing.
Add members to the private data to allow the (*do_cmd_test) to calculate
and save to values needed by ai_prepare().
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>
staging: comedi: me4000: return void from ai_round_cmd_args()
This function always succeeds. Change the return type to void and
remove the unnecessary error check in me4000_ai_do_cmd().
Move the function call in me4000_ai_do_cmd_test() from before Step 1
to Step 3 where the arguments are validated. There is no reason to
get the values if the previous steps fail.
Rename the function so it has namespace associated with the driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: me4000: tidy up ME4000_AI_STATUS_REG bit defines
Use the BIT() marco to define the bits of this register.
For aesthetics, rename all the defines to remove the '_BIT' from the
name. Also, use ME4000_AI_STATUS_REG instead of ME4000_AI_CTRL_REG
when reading the register (they happen to be the same).
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>
staging: comedi: me4000: simplify analog input range programming
The comedi_lrange table for the analog inputs is inverted compared
to the values that need to be written to the ME4000_AI_CHANNEL_LIST_REG
to select the range.
Create a macro, ME4000_AI_LIST_RANGE(), to handle the inversion. Remove
the old defines and simplify the code a bit.
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>
This define evaluates to 0 and is OR'ed with the 'entry' value that is
written to the ME4000_AI_CHANNEL_LIST_REG when the channel aref is a
single-ended type (AREF_GROUND or AREF_COMMON). OR'ing a zero value is
pretty silly, just remove it.
Remove the switch() in me4000_ai_insn_read() to simplify 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>
staging: comedi: me4000: rename local variables used for 'dev->private'
In comedi drivers the local variable used for the dev->private pointer is
normally named 'devpriv'. For aesthetics, rename the variables in this
driver. Also, rename the struct to follow the norm.
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>
Some of the boards supported by this driver can do analog input sample &
hold on 8 of the channels. The 'ai_sh_nchan' member of the boardinfo is
used to indicate which boards support this feature. To save a bit of space,
convert this member to a bit-field, 'can_do_sh_ai'. Note, this feature is
not currently supported.
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>
This member of the boardinfo is always '4' for the boards that have an
analog output FIFO. Covert it to a bit-field, 'has_ao_fifo', to save a
bit of space.
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>
For the boards that have analog output capability, there are always
4 analog output channels. Convert the 'ao_nchan' member of the boardinfo
into a bit-field, 'has_ao', to save a bit of space and set the analog
output subdevice 'n_chan' to 4 when supported.
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>
This member of the boardinfo is only used as a flag indicating that the
board supports differential analog inputs. Convert the member to a bit-
field to save a bit of space. For aesthetics, rename the member to
'can_do_diff_ai'.
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>
staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()
The 'board' pointer is only used in this function to verify that the
'chan' is valid for an aref of AREF_DIFF. For differential inputs, the
maximum channel is half the subdevice 'n_chan'. Use that instead and
remove the 'board' variable.
Also, the comedi core does not validate the aref flags. Add a check
to ensure that the subdevice actually supports the AREF_DIFF mode.
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>
Neil Horman [Tue, 4 Aug 2015 19:09:47 +0000 (15:09 -0400)]
staging: unisys: visornic: Convert to using napi
Switch the visornic over to use napi. Currently there is a kernel
thread that sits and waits on a wait queue to get notified of incoming
virtual interrupts. It would be nice if we could handle frame reception
using the standard napi processing instead. This patch creates our napi
instance and has the rx thread schedule it
Given that the unisys hypervisor currently requires that queue servicing
be done by a polling loop that wakes up every 2ms, lets instead also
convert that to a timer, which is simpler, and allows us to remove all
the thread starting and stopping code.
Signed-off-by: Neil Horman <nhorman@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers: staging: wilc1000: use 'void' for no arguments functions
Added 'void' keyword in the paranthesis of function definitions, when
there are no arguments to the functions. This fixes the checkpatch.pl
error - "Bad function definition 'function()' should probably be
function(void)".
Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shraddha Barke [Tue, 4 Aug 2015 19:59:22 +0000 (01:29 +0530)]
Staging: wilc1000: Remove typedefs for struct
The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
Ack_session_info_t.
The following Coccinelle semantic patch detects the cases for struct type:
Ever since daemonize was removed in 3.18, there are no longer
any flags passed to kthread_run.
Most of the comments were deleted, but this one lingered on
until now.
staging: lustre: service.c: make local functions static
Makes functions that are not used outside the file in which they are defined
static, as reported by sparse:
drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
'ptlrpc_alloc_rqbd' was not declared. Should it be static?
1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
static?
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>" Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdecho/echo_client.c:2142:5: warning: symbol 'echo_client_init' was not declared. Should it be static?
drivers/staging/lustre/lustre/obdecho/echo_client.c:2157:6: warning: symbol 'echo_client_exit' was not declared. Should it be static?
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>" Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Card configuration is stored in SPI EEPROM (93c46 or 93c56)
working in 128|256x16 mode.
Communication is handled using GPIO bitbang.
>From behaviour perspective, delay after read was removed.
It is not needed as we wait after reading GPIO mapped to
PCI-E register - it should have no side effects.
According to sample EEPROM datasheet (AT93Cx6), max frequency for
worst case scenario (1.8V supply) is 250kHZ (vs. 1MHz for 5V).
Driver generates ~50kHZ clock - margin should be big enough
even for devices from other vendors.
Neil Horman [Fri, 31 Jul 2015 22:56:32 +0000 (18:56 -0400)]
staging: unisys: visorchannel: Add peek function
According to unisys, the s_par hypervisor has a bug in which it never
triggers an interrupt. That makes the visornic effectively a 2ms poll
loop. In order to just have the rx thread shceduling a napi poll every
2ms, lets instead give it the chance to check the response queue for
data before we schedule. This helper provides that functionality
Signed-off-by: Neil Horman <nhorman@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: android: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.
Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.
staging: fbtft: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.
Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.
staging: fbtft: core: Don't set device platform_data
Pass platform_data as an argument to fbtft_framebuffer_alloc()
instead of using dev->platform_data.
This fixes an issue where the device comes from Device Tree
and fbtft_probe_common() sets dev->platform_data to allocated
memory. When the module is reloaded, dev->platform_data points
to freed memory.
Randy Dunlap [Mon, 3 Aug 2015 18:35:47 +0000 (11:35 -0700)]
staging: most: fix aim-sound build errors
Fix build errors: driver uses snd_pcm*() interfaces, so select
SND_PCM.
drivers/built-in.o: In function `audio_rx_completion':
sound.c:(.text+0x3cd376): undefined reference to `snd_pcm_period_elapsed'
drivers/built-in.o: In function `pcm_prepare':
sound.c:(.text+0x3cd3b0): undefined reference to `snd_pcm_format_physical_width'
sound.c:(.text+0x3cd3ce): undefined reference to `snd_pcm_format_big_endian'
sound.c:(.text+0x3cd42c): undefined reference to `snd_pcm_format_big_endian'
drivers/built-in.o: In function `pcm_hw_free':
sound.c:(.text+0x3cd50a): undefined reference to `snd_pcm_lib_free_vmalloc_buffer'
drivers/built-in.o: In function `pcm_hw_params':
sound.c:(.text+0x3cd54c): undefined reference to `_snd_pcm_lib_alloc_vmalloc_buffer'
drivers/built-in.o: In function `playback_thread':
sound.c:(.text+0x3cd6a0): undefined reference to `snd_pcm_period_elapsed'
drivers/built-in.o: In function `audio_probe_channel':
sound.c:(.text+0x3cdc0b): undefined reference to `snd_pcm_new'
sound.c:(.text+0x3cdc2b): undefined reference to `snd_pcm_set_ops'
drivers/built-in.o:(.data+0x952d0): undefined reference to `snd_pcm_lib_ioctl'
drivers/built-in.o:(.data+0x95318): undefined reference to `snd_pcm_lib_get_vmalloc_page'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 28 Jul 2015 15:49:25 +0000 (18:49 +0300)]
staging: rtl8192e: don't just print an error and continue
I was looking at how TOTAL_CAM_ENTRY is used and I saw this code. We
print an error but continue writing "EntryNo" to a register as if it
were valid. "EntryNo" is controlled by the user in rtl8192_ioctl() so
it definitely can be invalid. I'm not positive what happens with the
invalid data but it can't be good.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 28 Jul 2015 15:48:21 +0000 (18:48 +0300)]
Staging: rtl8192e: array overflow in rtl92e_set_swcam()
"EntryNo" is comes from the user in the ioctl and it's a number between
0-255. The ieee->swcamtable[] array only has 32 elements so it can
result in memory corruption.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peter Huewe [Fri, 24 Jul 2015 23:59:08 +0000 (01:59 +0200)]
staging/xgifb: fix dumpVGAReg compile error if DEBUG is set
If DEBUG is set dumpVGAReg is called and tries to access
XGISR which is defined as (xgifb_info->dev_info.P3c4)
which is not known within this function.
-> add as parameter to dumpVGAReg so xgifb_info becomes known
Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The public headers is well known by others and the redundant commits make
the code mess. Remove the comments of the public headers to make the code
tidy.
Signed-off-by: Navy Cheng <navych@126.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The code that tests for high and low xmit watermarks was consolidatedand
simplified. The output behavior should be identical, with the exception
of an off-by-one error being corrected in the tests done when the counters
overflowed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>