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>
staging: comedi: pcl711: fix software trigger for board->is_8112
The acl-8112 boards also need to write a value to the software
trigger register in order to start an A/D conversion. Remove the
if (!board->is_8112) test so that the write is always done.
Also, the analog input mode does not need to be set each time for
multiple samples. Move the pcl711_ai_set_mode() out of the for loop.
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 unnecessary test of 'board->is_8112'
At the end of an asynchronous command, the analog input is returned
to software triggered mode. For the non-8112 style boards the mode
PCL711_MODE_DEFAULT and PCL711_MODE_SOFTTRIG are identical. Just set
the mode to PCL711_MODE_SOFTTRIG and remove the test.
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: define the mode register magic numbers
Define the magic numbers used with the mode register.
For the PCL711B board, the mode register also contains the irq number
that is being used. Introduce a helper function to write to the mode
register so that this irq number is always included 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>
Currently the board->is_8112 handling in this function does not write
the value to the mux register. Also, the value for channels >= 8 is
calculated incorrectly.
Define the magic numbers used with the mux register and fix the function
so 8112 boards work correctly.
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: use dev->read_subdev in interrupt handler
The comedi_subdevice used in the interrupt handler is the dev->read_subdev
that was initialized during the attach of the board. Use that instead of
accessing the dev->subdevices array 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>
For aesthetics, rename this function to help with greps.
Introduce a helper function to write the values to the analog
output channel registers. Modify the defines for the D/A registers
to avoid the ? : tests based on the chan number.
Only the final value written needs to be saved for read back.
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: tidy up the subdevice init
For aesthetic reasons, add some whitespace to the subdevice init.
The 's->len_chanlist' is only used with asynchronous command support.
Remove the unnecessary initialization of this member in the subdevices
that do not support commands. For the analog input subdevice, move
the initialization so it only occurs when commands are 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>
staging: comedi: pcl711: don't fail attach if irq is unavailable
Interrupts are only needed to support asynchronous commands with the
analog input subdevice. Since the interrupt is optional during the
attach of the board, don't fail the attach if it's not available.
Also, remove the printk() noise about the irq. The user will know if
the interrupt is available due to the subdev_flag SDF_CMD_READ being
set for the analog input subdevice.
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>