Ian Abbott [Fri, 15 Mar 2013 10:32:12 +0000 (10:32 +0000)]
staging: comedi: adv_pci_dio: restore PCI-1753E support
Back in the old days (before "staging") when Comedi only supported
manual configuration of devices, the "adv_pci_dio" driver supported both
PCI-1753 ("pci1753") and PCI-1753E ("pci1753e"). In actual fact,
"pci1753e" is just a PCI-1753 connected by a ribbon cable to a PCI-1753E
expansion card, which is plugged into a PCI slot but is not a PCI device
itself. Now that the "adv_pci_dio" driver only supports automatic
configuration of devices and the main "comedi" module no longer allows
auto-configuration to be disabled, a PCI-1753 with a PCI-1753E expansion
card is always treated as an unexpanded PCI-1753 ("pci1753") and there
is no way to override it. (Recently, an undefined macro
`USE_PCI1753E_BOARDINFO` was used to make the driver switch to
supporting "pci1753e" instead of "pci1753", but this is less than
ideal.)
Advantech has their own Linux (non-Comedi) driver for the PCI-1753 which
detects whether the PCI-1753E expansion card is connected to the
PCI-1753 by fiddling with a register at offset 53 from the main
registers base.
Use Advantech's test in our "adv_pci_dio" driver. If the board appears
to be a PCI-1753 ("pci1753"), check if the expansion card appears to be
present, and if so, treat the device as a PCI-1753 plus PCI-1753E
expansion card ("pci1753e").
Also, get rid of `enum dio_boardid` (`BOARD_...` enum values) which was
added recently and just use the older `TYPE_...` enum values from `enum
hw_cards_id` instead as the mapping is now 1-to-1.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wei Yongjun [Fri, 15 Mar 2013 09:20:08 +0000 (17:20 +0800)]
staging: sep: fix possible memory leak in sep_prepare_input_dma_table()
'lli_array_ptr' etc. are malloced in sep_prepare_input_dma_table() and should
be freed before leaving from the error handling case, otherwise it will cause
memory leak.
Eduardo Valentin [Fri, 15 Mar 2013 13:00:35 +0000 (09:00 -0400)]
staging: omap-thermal: switch mutex to spinlock inside omap-bandgap
Because there is a need to lock inside IRQ handler, this patch
changes the locking mechanism inside the omap-bandgap.[c,h] to
spinlocks. Now this lock is used to protect omap_bandgap struct
during APIs exposed (possibly used in sysfs handling functions)
and inside the ALERT IRQ handler.
Because there are registers shared among the sensors, this lock
is global, not per sensor.
Now arch code has to specify CONFIG_ARCH_HAS_BANDGAP. So, this driver
will be selectable only if the platform reports itself as having a
bandgap device.
Any OMAP variant or any other OMAP version needs to
select ARCH_HAS_BANDGAP
so that the driver will be applicable. A part from that it is
required to device the data structures that maps the registers
and their bitfields. The DT compatible list must also be updated.
This patch improves the code that handles threshold values
by creating single functions that are usable for tcold and
thot. This way we won't have duplicated functionality just
because it is handling different bitfields. Now
the added functions are reused in several places where
it is needed to update any threshold.
This patch also removes macros that are used only inside
the _validate helper function.
In this patch there is also an addition of an extra function
section for Exposed APIs, used outside the omap-bandgap.c,
but inside the omap-thermal driver.
This change improves temp_sensor_unmask_interrupts by:
. renaming it to omap_bandgap_unmask_interrupts
. making it a void function, as there is nothing really to report an error.
Eduardo Valentin [Fri, 15 Mar 2013 13:00:16 +0000 (09:00 -0400)]
staging: omap-thermal: rename add_hyst to omap_bandgap_add_hyst
This patch improves the add_hyst function by:
. Renaming it to omap_bandgap_add_hyst
. Moving it to the ADC conversion functions section
. Changing its signature to follow the driver standard
Eduardo Valentin [Fri, 15 Mar 2013 13:00:14 +0000 (09:00 -0400)]
staging: omap-thermal: move conv table limits out of sensor data
As we have one conv table per bandgap device and not per sensor,
this patch changes the data structures so that the conv table
min and max values are now part of bandgap_data and not sensor_data.
Eduardo Valentin [Fri, 15 Mar 2013 12:59:54 +0000 (08:59 -0400)]
staging: omap-thermal: fix error checking
The omap_bandgap_get_sensor_data() function returns ERR_PTR(),
but it can also return NULL, in case of initilization, so we need to use
IS_ERR_OR_NULL() rather than only IS_ERR().
Eduardo Valentin [Fri, 15 Mar 2013 12:59:51 +0000 (08:59 -0400)]
staging: omap-thermal: create header for register, bitfields and definitions
In order to have a better code readability and organization, this patch
splits omap-bandgap.h into three headers.
. omap-bandgap.h will contain only the driver related data structures
definitions and macros
. omap4xxx-bandgap.h will contain only defines and bitfields
related to OMAP4 based devices
. omap5xxx-bandgap.h will contain only defines and bitfields
related to OMAP5 based devices
This driver has been nothing but trouble, and no one shipping a new
Android device uses it, so let's just drop it, making the USB Gadget
driver authors lives a whole lot easier as they do their rework.
Cc: John Stultz <john.stultz@linaro.org> Cc: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1710: only pci bar 2 is used
This driver used to be tied to the addi-data common code which
always saved the start address of pci bars 0, 1, 2, and 3 for
use by the driver. This driver only uses pci bar 2.
Remove all the non-used pci bars and move the saving of pci bar
2 so it occurs right after the pci device is enabled.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi_pci: pass comedi_device to comedi_pci_enable()
Make comedi_pci_enable() use the same parameter type as
comedi_pci_disable(). This also allows comedi_pci_enable
to automatically determine the resource name passed to
pci_request_regions().
Make sure the errno value returned is passed on instead of
assuming an errno. Also, remove any kernel noise that is
generated when the call fails.
The National Instruments drivers that use the mite module
currently enable the PCI device in the mite module. For
those drivers move the call to comedi_pci_enable into the
driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi_pci: make comedi_pci_disable() safe to call
Currently all the comedi PCI drivers need to do some checking in
their (*detach) before calling comedi_pci_disable() in order to
make sure the PCI device has actually be enabled.
Change the parameter passed to comedi_pci_disable() from a struct
pci_dev pointer to a comedi_device pointer and have comedi_pci_disable()
handle all the checking.
For most comedi PCI drivers this also allows removing the local
variable holding the pointer to the pci_dev. For some of the drivers
comedi_pci_disable can now be used directly as the (*detach) function.
The National Instruments drivers that use the mite module currently
enable/disable the PCI device in the mite module. For those drivers
move the call to comedi_pci_disable into the driver and make sure
dev->iobase is set to a non-zero value.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Bolle [Thu, 14 Mar 2013 09:41:39 +0000 (10:41 +0100)]
staging: android: remove dependency on TINY_SHMEM
The Kconfig entry for the "Anonymous Shared Memory Subsystem" got added
in v3.3. It has an optional dependency on TINY_SHMEM. But TINY_SHMEM had
already been removed in v2.6.29. So this optional dependency can safely
be removed too.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Devendra Naga [Thu, 14 Mar 2013 06:40:28 +0000 (02:40 -0400)]
staging: csr: fix compilation warning in unifi_siwscan
got the warnings
drivers/staging/csr/sme_wext.c: In function ‘unifi_siwscan’:
drivers/staging/csr/sme_wext.c:1276:9: warning: variable ‘scantype’ set but not used [-Wunused-but-set-variable]
Ian Abbott [Tue, 12 Mar 2013 14:14:37 +0000 (14:14 +0000)]
staging: comedi: adv_pci1710: restore PCI-1710HG support
The Advantech PCI-1710HG is similar to the PCI-1710 but has a different
set of ranges for analog input (HG = high gain). Because they share the
same PCI vendor and device ID, the adv_pci1710 driver does not currently
distinguish them. This is more of a problem since auto-configuration
code was added to the driver (and manual configuration support removed),
as the PCI-1710HG would be automatically configured as a PCI-1710. More
recently, the unused code for PCI-1710HG support was #ifdef'ed out.
In fact, the PCI-1710 and PCI-1710HG can be distinguished by considering
the PCI subvendor and subdevice IDs according to the following table:
The above information is extracted from Advantech's own GPL'ed Linux
(non-Comedi) driver source from "advdaq-1.10.0001-1.tar.bz2" on their
website.
(0x13fe = PCI_VENDOR_ID_ADVANTECH, 0x10b5 = PCI_VENDOR_ID_PLX, 0x9050 =
PCI_DEVICE_ID_PLX_9050, 0x1000 = PCI_VENDOR_ID_NCR or
PCI_VENDOR_ID_LSI_LOGIC but I assume this subvendor ID was chosen
"randomly".)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Tue, 12 Mar 2013 00:47:59 +0000 (17:47 -0700)]
staging: HCD files for the DWC2 driver
These files contain the HCD code, and implement the Linux
hc_driver API. Support for both slave mode and buffer DMA mode
of the controller is included.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Tue, 12 Mar 2013 00:47:58 +0000 (17:47 -0700)]
staging: Core files for the DWC2 driver
The core code provides basic services for accessing and managing
the DWC_otg hardware. These services are used by both the Host
Controller Driver and (in future) the Peripheral Controller Driver.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add support for the Network Accelerator Engine on Netlogic XLR/XLS
MIPS SoCs. The XLR/XLS NAE blocks can be configured as one 10G
interface or four 1G interfaces. This driver supports blocks
with 1G ports.
Wei Yongjun [Mon, 11 Mar 2013 13:45:34 +0000 (21:45 +0800)]
staging: sync: fix return value check in sync_fence_alloc()
In case of error, the function anon_inode_getfile() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
The (*insn_read) and (*insn_write) functions for all the subdevices
in this driver are the same except for the 'offset' that is added
to the iobase and channel to read/write a register on the board.
Pass the 'offset' in s->private so we can use the same (*insn_read)
and (*insn->write) functions for all the subdevices.
Also, fix the (*insn_read) and (*insn_write) functions so they work
correctly. The comedi core expects them to read/write insn->n data
values and then return the number of values used.
For aesthetic reasons, add some whitespace to the subdevice init.
Remove the dev_info() noise at the end of the attach.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The dev_dbg() messages in the adl_pci8164_insn_{read,out} functions
output the 'data' that was read/write to the device. Two 'data' values
are always printed, data[0] and data[1].
The 'data' pointer points to an array of unsigned int values. The number
of values in the array is indicated by insn->n. The number of data
elements is never checked so the dev_dbg() could be trying to access
a 'data' element that is invalid.
Instead of fixing the dev_dbg() just remove them. They are really just
added noise.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1710: remove 'interrupt' from boardinfo
Only one board type is supported by this driver. Remove the 'interrupt'
field from the boardinfo and just call the function directly in
v_ADDI_Interrupt().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the users of the addi_common code now set the dev->board_ptr
before calling addi_auto_attach(). Remove the unnecessary function
that searches for the boardinfo.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1564: set board_ptr before calling addi_auto_attach()
This driver only supports a single PCI device. If we set the
dev->board_ptr before calling addi_auto_attach() we remove
the need for the common code to search for the boardinfo.
Since the search is not done we can remove the unnecessary
board information from the comedi_driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_1500: set board_ptr before calling addi_auto_attach()
This driver only supports a single PCI device. If we set the
dev->board_ptr before calling addi_auto_attach() we remove
the need for the common code to search for the boardinfo.
Since the search is not done we can remove the unnecessary
board information from the comedi_driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_apci_035: set board_ptr before calling addi_auto_attach()
This driver only supports a single PCI device. If we set the
dev->board_ptr before calling addi_auto_attach() we remove
the need for the common code to search for the boardinfo.
Since the search is not done we can remove the unnecessary
board information from the comedi_driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: addi_common: allow driver to set the board_ptr
The addi_apci_035, addi_apci_1500, addi_apci_1564, and addi_apci_3xxx
drivers still use the addi_common code. Allow those drivers to set
the dev->board_ptr before calling addi_auto_attach().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>