Ian Abbott [Thu, 26 Sep 2013 09:16:39 +0000 (10:16 +0100)]
staging: comedi: pcl711: put acquired data in buffer for AI command
The asynchronous command support for the AI subdevice is still missing
one crucial element, it doesn't actually put the acquired data in the
buffer so it can be read()! Call `comedi_buf_put()` from the interrupt
handler to perform this function. A return value of 0 from
`comedi_buf_put()` means there was no room in the buffer so set the
`COMEDI_CB_OVERFLOW` and `COMEDI_CB_ERROR` event flags in that case.
Otherwise, set the `COMEDI_CB_BLOCK` and `COMEDI_CB_EOS` event flags to
mark the end of a "scan" (the scan length is currently fixed at one
sample in this driver).
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 [Thu, 26 Sep 2013 09:16:38 +0000 (10:16 +0100)]
staging: comedi: pcl711: handle cmd->stop_src and stop_arg
The interrupt handler used to support asynchronous commands on the AI
subdevice currently marks the command as finished (setting the "end of
acquisition" event flag and returning to software-triggered acquisition
mode) once it has decremented `devpriv->ntrig` to 0. However, nothing
sets `devpriv->ntrig`, as noted in the "FIXME" comment.
If the `stop_src` setting of the asynchronous command is `TRIG_COUNT`,
then the `stop_arg` setting indicates the number of scans to be
performed in the overall acquisition. (Otherwise, `stop_src` will be
`TRIG_NONE`, meaning the acquisition should run indefinitely until
cancelled.) When starting the acquisition in `pcl711_ai_cmd()`, set
`devpriv->ntrig` to the number of scans to be performed (`stop_arg`) if
`stop_src` is `TRIG_COUNT`. In the interrupt handler, don't decrement
`devpriv->ntrig` or handle end of acquision unless `stop_src` is
`TRIG_COUNT`.
Also check for an empty acquisition in `pcl711_ai_cmd()`, i.e. one where
`stop_src` is `TRIG_COUNT` and `stop_arg` is zero and just mark end of
acquisition without actually setting up the interrupts in this case.
Also change the type of the `ntrig` member of the private data structure
to `unsigned int` as it should be (same type as `stop_arg`).
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 [Thu, 26 Sep 2013 09:16:37 +0000 (10:16 +0100)]
staging: comedi: pcl711: add AI cancel handler
Comedi subdevices that support asynchronous commands should have a
'cancel' handler to stop an in-progress command. Add such a handler to
the pcl711 driver module. I think merely setting the acquisition mode
to "software-triggered" would be sufficient, but also clear the
interrupt status for good luck.
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>
staging: comedi: pcl726: add support for the external interrupt signal
The ACL-6126 board supports an external interrupt signal on pin 17 of
its I/O connector (CN3). Add a new subdevice to this driver to support
asynchronous commands with this input.
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: pcl726: remove digital i/o register offsets from boardinfo
The PCL-727 board uses different register offsets for the digital input and
output ports. Instead of having all the register offsets in the boardinfo,
replace them with a simple bit-field flag, 'is_pcl727'. Use that flag in the
(*insn_bits) functions to determine what registers need to be used.
To save a bit of space, change the 'have_dio' flag in the boardinfo to a
bit-field.
For aesthetics, rename and tidy up the register map 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>
staging: comedi: pcl726: fix the analog output range_table_list initialization
The analog output channels use jumpers on the board to individually set
the range used. This driver uses the configuration options passed to the
(*attach) function to setup the analog output subdevice range_table_list
for each channel.
The configuration options should be 'it->options[2 + i]' for each channel 'i'
not '...[2 + 1]' for each channel. Fix the error and move the code so that
the range_table_list is setup before the subdevice is initialized.
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 aesthetics, rename the function to help with greps.
The offset binary value from the core should be saved for read back.
Move the saving of the value in the private data so it occurs before
the value is possibly munged for bipolar outputs.
Use the comedi_offset_munge() helper to munge the offset binary value
to two's complement for bipolar outputs.
According to the November 2011 users manual, the write order must be
MSB them LSB. Update the comment.
Modify the register map defines to handle the channel offset calculation.
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: pcl726: remove 'bipolar' from the private data
These flags are set in the private data during the attach to indicate
if the range for each channel is bipolar or unipolar. Use the helper
function conedi_chan_range_is_bipolar() to determine this by checking
the range_table_list directly.
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>
Jingoo Han [Wed, 25 Sep 2013 23:35:49 +0000 (08:35 +0900)]
staging: dgnc: Remove casting the return value which is a void pointer
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
# On branch rtl8188eu-typo2
# Changes to be committed:
# modified: drivers/staging/rtl8188eu/core/rtw_ap.c
# modified: drivers/staging/rtl8188eu/core/rtw_br_ext.c
# modified: drivers/staging/rtl8188eu/core/rtw_cmd.c
# modified: drivers/staging/rtl8188eu/core/rtw_efuse.c
# modified: drivers/staging/rtl8188eu/core/rtw_ieee80211.c
# modified: drivers/staging/rtl8188eu/core/rtw_mlme.c
# modified: drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
# modified: drivers/staging/rtl8188eu/core/rtw_security.c
# Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: usbip: Fix man-pages for usbip userspace utilities
The usbip userspace utilities contained some half-documented (only in
--help, not in man) options. They were added to the man-pages of usbip
and usbipd.
Also a typo in the usbip headline was fixed.
This patch removes dm_gpio_change_rf_callback() because it is not called
anywhere and it resides inside an #ifdef RTL8192E guard while RTL8192E
is not defined.
The function cmpk_message_handle_tx() is called only in r8192U_dm.c in two
places. The first call resides outside an #ifdef RTL8192U guard, and since
RTL8192U is defined this call can be removed. At the other site this function
is called, there is no check on its return value. Since cmpk_message_handle_tx()
does not do anything else other than returning true, it can be safely removed.
staging: rtl8192u: remove unused code from cmpk_message_handle_tx()
The file r819xU_cmdpkt.c includes header r8192U.h which defines RTL8192U.
This patch removes from cmpk_message_handle_tx() the part of the code that
is never used because it resides outside the header guard #ifdef RTL8192U.
Dom Cobley [Mon, 23 Sep 2013 21:23:34 +0000 (14:23 -0700)]
staging: dwc2: add microframe scheduler from downstream Pi kernel
The transfer scheduler in the dwc2 driver is pretty basic, not to
mention buggy. It works fairly well with just a couple of devices
plugged in, but if you add, say, multiple devices with periodic
endpoints, the scheduler breaks down and can't even enumerate all
the devices.
To improve this, import the "microframe scheduler" patch from the
driver in the downstream Raspberry Pi kernel, which is based on
the Synopsys vendor driver. The original patch came from Denx
(http://git.denx.de/?p=linux-denx.git) and was commited to the
raspberrypi.org git tree by "popcornmix" (Dom Cobley).
I have added a driver parameter for this, enabled by default, in
case anyone has problems with it and needs to disable it. I don't
think we should add a DT binding for that, though, since I plan
to remove the option once any bugs are fixed.
[raspberrypi.org patch from Dom Cobley] Signed-off-by: Dom Cobley <popcornmix@gmail.com>
[adapted to dwc2 driver by Paul Zimmerman] Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dominik Paulus [Fri, 13 Sep 2013 09:55:51 +0000 (11:55 +0200)]
staging: usbip: Fix IPv6 support in usbipd
getaddrinfo() leaves the order of the returned addrinfo structs
unspecified. On systems with bindv6only disabled (this is the default),
PF_INET6 sockets bind to IPv4, too. Thus, IPv6 support in usbipd was
broken when getaddrinfo returned first IPv4 and then IPv6 addrinfos, as
the IPv6 bind failed with EADDRINUSE.
This patch uses seperate sockets for IPv4 and IPv6 and sets IPV6_V6ONLY
on all IPv6 sockets. Two command line arguments, -4 and -6 were added to
manually select the socket family.
Staging: bcm: PHSModule.c: Matching the function definition with function declaration
The function implementations of the PHSModule didn't match with the declaration. The functions are static
in the declaration but in the implemntation they are non-static
This patch removes this smatch warning:
info: ignoring unreachable code.
There were instances where there was extra code after
the default action in switch statements. These default
actions ended with a break so the code wasn't being run
at anytime. This patch removes that extra code.
Chen Gang [Sat, 21 Sep 2013 12:38:30 +0000 (20:38 +0800)]
drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h"
Normally, the macros from command line are system specific macros (e.g
__linux, __KERNEL__ ...), and module own macros are usually defined in
their header files.
DG_NAME and DG_PART are driver 'dgap' owned macros which are used by
multiple files within driver, and need be defined in the driver main
header file.
So move DG_NAME and DG_PART to "dgap_driver.h", it not only can make
code clearer, but also can avoid compiling failure when EXTRA_CFLAGS
appended to make command line (e.g. "EXTRA_CFLAGS=-W").
Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: pcl711: tidy up multi line comments
Tidy up the multi line comments to follow the CodingStyle.
Remove the multi line comment about an alternate driver for the
PCL-711. The http address does not work and the driver history
in the comment is unnecessary.
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: pcl711: rename some of the register map defines
Rename some of the register map defines so they all have the same
format. Add a couple new defines to tidy up some of the magic
numbers used with the 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>
staging: comedi: pcl711: no need to calc the timer values twice
The comedi core always calls the (*do_cmdtest) function to validate
a command before it calls the (*do_cmd) function.
Since the (*do_cmdtest) has already calculated the timer values in
order to validate the cmd->scan_begin_arg there is no reason to
recalc the values in the (*do_cmd).
This also fixes a bug in the driver. The (*do_cmdtest) was using a
time base value of 100 and but the (*do_cmd) was using a time base
of 500. These result in different timer values. The functions used
to calculate the values are actually the same due to a #define in
the 8253.h 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>
staging: comedi: pcl711: remove 'is_pcl711b' from boardinfo
This member in the board info is used to indicate if the board is
a PCL711B. This board uses bits in the mode register to select the
IRQ used for interrupts. These bits do nothing on the other boards
supported by this driver.
Remove the 'is_pcl711b' variable from the boardinfo. Also, remove
the 'mode' variable from the private data and just calculate the
mode bits 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>
staging: comedi: pcl711: remove 'is_8112' from boardinfo
This member in the boardinfo is redundant. All the 8112 style boards
have > 8 analog input channels (16 actually). We can use that information
instead and remove the extra boardinfo.
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>