summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* usb: cdc-wdm: adding list lookup indirectionBjørn Mork2012-03-081-12/+48
| | | | | | | | | | | | | | Register all interfaces handled by this driver in a list, getting rid of the dependency on usb_set_intfdata. This allows further generalization and simplification of the probe/create functions. This is needed to decouple wdm_open from the driver owning the interface, and it also allows us to share all the code in wdm_create with drivers unable to do usb_set_intfdata. Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: cdc-wdm: split out reusable parts of probeBjørn Mork2012-03-081-51/+54
| | | | | | | | | | Preparing for the addition of subdriver registering as an alternative to probe for interface-less usage. This should not change anything apart from minor code reordering. Signed-off-by: Bjørn Mork <bjorn@mork.no> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: Microchip VID mislabeled as Hornby VID in ftdi_sio.Bruno Thomsen2012-03-082-4/+8
| | | | | | | | | | | | | | Microchip VID (0x04d8) was mislabeled as Hornby VID according to USB-IDs. A Full Speed USB Demo Board PID (0x000a) was mislabeled as Hornby Elite (an Digital Command Controller Console for model railways). Most likely the Hornby based their design on PIC18F87J50 Full Speed USB Demo Board. Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: ehci-s5p: add DMA burst supportJingoo Han2012-03-081-0/+15
| | | | | | | | | | | | DMA burst support is added to improve performance in EHCI data transfer. The USB EHCI controller on Exynos SoCs can use INCR16, INCR8, and INCR4 mode. These modes of INSNREG00 register should be set in order to enable DMA burst transfer. This feature is also related to AHB spec. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb/gadget/pch_udc: Fix compile errorTomoya MORINAGA2012-03-061-0/+1
| | | | | | | | | | | | | | | | | Greg's e-mail address was old. So, I resend it. Though I've tested this patch, http://marc.info/?l=linux-usb&m=132825305710285&w=2, I've received the following reports. http://kisskb.ellerman.id.au/kisskb/buildresult/5771890/ http://kisskb.ellerman.id.au/kisskb/buildresult/5771905/ So, I added header file for these symbols. Using this patch, this compile error must be disappeared. Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: otg: ab8500-usb: make probe() work againDan Carpenter2012-03-021-1/+1
| | | | | | | | | The probe() function will always fail because we're testing the wrong variable. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: gadgetfs: return number of bytes on ep0 read requestThomas Faber2012-03-021-0/+2
| | | | | | | | | | | | | A read from GadgetFS endpoint 0 during the data stage of a control request would always return 0 on success (as returned by wait_event_interruptible) despite having written data into the user buffer. This patch makes it correctly set the return value to the number of bytes read. Signed-off-by: Thomas Faber <thfabba@gmx.de> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: ohci-pxa27x: add explicit include of hardware.hRob Herring2012-03-021-0/+1
| | | | | | | | ohci-pxa27x needs cpu_is_pxa3xx macro. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb/core: remove "always" from usb_unlink_urb() kernel doc entrySebastian Andrzej Siewior2012-03-021-4/+7
| | | | | | | | | | | | | | | The kernel doc entry for usb_unlink_urb() contains the phrase "This request is always asynchronous.". The "always" leads to the assumption that the ->complete() callback is not called from within usb_unlink_urb(). This is not true. The HCD is allowed to call the ->complete() from within ->urb_dequeue() if it is appropriate for the hardware. This patch updates the kernel doc so usb-device driver authors make sure to drop all locks (and make sure it is okay to drop them) which are acquired by the complete callback before calling usb_unlink_urb(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Allocate correct size (portably) in drivers/usb/gadget/f_midi.c::f_midi_bind()Jesper Juhl2012-03-021-1/+1
| | | | | | | | | | | | | | | | As the coverity checker puts it: "Passing argument "sizeof (midi_function) /*8*/" to function "kcalloc" and then casting the return value to "struct usb_descriptor_header **" is suspicious. ... In this particular case sizeof(struct usb_descriptor_header **) happens to be equal to sizeof(struct usb_descriptor_header *), but this is not a portable assumption." I believe we really do intend to use 'sizeof(*midi_function)' here, so this patch makes that change. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: gadget: dummy_hcd: signedness bug in transfer()Dan Carpenter2012-03-021-1/+1
| | | | | | | "len" is unsigned so it's never less than zero. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: sl811-hcd: Convert to module_platform_driverTobias Klauser2012-03-021-17/+4
| | | | | | | | | Use the module_platform_driver macro, move the usb_disabled() check to the probe function and get rid of the rather pointless message on module load. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: r8a66597-hcd: Convert to module_platform_driverTobias Klauser2012-03-021-17/+4
| | | | | | | | | Use the module_platform_driver macro, move the usb_disabled() check to the probe function and get rid of the rather pointless message on module load. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: isp116x-hcd: Convert to module_platform_driverTobias Klauser2012-03-021-19/+4
| | | | | | | | | Use the module_platform_driver macro, move the usb_disabled() check to the probe function and get rid of the rather pointless message on module load. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: dwc3: core: Convert to module_platform_driverTobias Klauser2012-03-021-12/+2
| | | | | | | Use the module_platform_driver macro. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: cp210x: Update to support CP2105 and multiple interface devicesPreston Fick2012-03-021-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | This patch updates the cp210x driver to support CP210x multiple interface devices devices from Silicon Labs. The existing driver always sends control requests to interface 0, which is hardcoded in the usb_control_msg function calls. This only allows for single interface devices to be used, and causes a bug when using ports on an interface other than 0 in the multiple interface devices. Here are the changes included in this patch: - Updated the device list to contain the Silicon Labs factory default VID/PID for multiple interface CP210x devices - Created a cp210x_port_private struct created for each port on startup, this struct holds the interface number - Added a cp210x_release function to clean up the cp210x_port_private memory created on startup - Modified usb_get_config and usb_set_config to get a pointer to the cp210x_port_private struct, and use the interface number there in the usb_control_message wIndex param Signed-off-by: Preston Fick <preston.fick@silabs.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'dwc3-for-v3.4' of ↵Greg Kroah-Hartman2012-03-0212-413/+921
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: dwc3: changes for v3.4 merge window Here are the changes for v3.4 merge window. It includes a new glue layer for Samsung's Exynos platform, a simplification of memory management on DWC3 driver by using dev_xxx functions, a few optimizations to IRQ handling by dropping memcpy() and using bitshifts, a fix for TI's OMAP5430 TX Fifo Allocation, two fixes on USB2 test mode implementation (one on debugfs and one on ep0), and several minor changes such as whitespace cleanups, simplification of a few parts of the code, decreasing a long delay to something a bit saner, dropping a header which was included twice and so on. The highlight on this merge is the support for Samsung's Exynos platform, increasing the number of different users for this driver to three. Note that Samsung Exynos glue layer will only compile on platforms which provide implementation for the clk API for now. Once Samsung supports pm_runtime, that limitation can be dropped from the Makefile. Conflicts: drivers/usb/dwc3/gadget.c
| * usb: dwc3: clear 'res_trans_idx' as soon as it becomes invalidPaul Zimmerman2012-03-022-3/+4
| | | | | | | | | | | | | | | | | | | | Transfer resource index is cleared in hardware when XFERCOMPLETE event is generated, so clear the driver's res_trans_idx variable immediately after that event is received. The upcoming hibernation patches depend on this change. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: take lock while modifying flagsPaul Zimmerman2012-03-021-0/+7
| | | | | | | | | | | | | | | | | | | | dwc3_gadget_ep_set_wedge() and dwc3_gadget_set_selfpowered() were modifying dwc->flags/dwc->is_selfpowered without taking the lock. Since those modifications are non-atomic, that could cause other flags to be corrupted. Fix them both to take the lock. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: shorten long delay in dwc3_gadget_set_link_state()Paul Zimmerman2012-03-021-4/+3
| | | | | | | | | | | | | | | | | | The loop in dwc3_gadget_set_link_state() was using a udelay(500), which is a long time to delay in interrupt context. Change it to udelay(5) and increase the loop count to match. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: pci: fix failure path in dwc3_pci_probe()Paul Zimmerman2012-03-021-1/+3
| | | | | | | | | | | | | | | | dwc3_pci_probe() would return success even if the calls to dwc3_get_device_id() or platform_device_alloc() fail, fix that. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: replace hard-coded constant in DWC3_GCTL_SCALEDOWN(3)Paul Zimmerman2012-03-022-1/+2
| | | | | | | | | | | | | | | | Define DWC3_GCTL_SCALEDOWN_MASK and use it in place of DWC3_GCTL_SCALEDOWN(3). Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: fix bogus test in dwc3_gadget_start_isocPaul Zimmerman2012-03-021-11/+5
| | | | | | | | | | | | | | | | | | Zero is a valid value for a microframe number. So remove the bogus test for non-zero in dwc3_gadget_start_isoc(). Cc: stable@vger.kernel.org Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: use proper function for setting endpoint nameAnton Tikhomirov2012-03-021-4/+4
| | | | | | | | | | | | | | | | | | It's wrong to use the size of array as an argument for strncat. Memory corruption is possible. strlcat is exactly what we need here. Cc: stable@vger.kernel.org Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: don't wrap around the TRB poll on non-ISOCPaul Zimmerman2012-03-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | If we have a non-ISOC endpoint, we will not have a Link TRB pointing to the beginning of the TRB pool. On such endpoints, we don't want to let the driver wrap around the TRB pool otherwise controller will hang waiting for a valid TRB. Cc: stable@vger.kernel.org Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: make dwc3_get_device_id() return the idDan Carpenter2012-03-021-1/+1
| | | | | | | | | | | | | | | | We always return zero instead of the id we found. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: clean up whitespace damage, typos, missing parens, etc.Paul Zimmerman2012-03-025-47/+46
| | | | | | | | | | | | | | trivial patch, no functional changes Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: linux/module.h included twiceDanny Kukawka2012-03-022-2/+0
| | | | | | | | | | | | | | | | drivers/usb/dwc3/core.c and drivers/usb/dwc3/dwc3-omap.c included 'linux/module.h' twice, remove the duplicates. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: use devm_xxx functionsChanho Park2012-03-023-125/+90
| | | | | | | | | | | | | | | | | | | | | | This patch enables to use devm_xxx functions during probing driver. The devm_xxx series functions are able to release resource when the driver is detatched. We can remove several codes to release resources in the probe function. Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: Add Exynos Specific Glue layerAnton Tikhomirov2012-03-023-0/+188
| | | | | | | | | | | | | | | | | | | | | | Adds Exynos Specific Glue layer to support USB peripherals on Samsung Exynos5 chips. [ balbi@ti.com : prevent compilation of Exynos glue layer on platforms which don't provide clk API implementation ] Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: convert TRBs into bitshiftsFelipe Balbi2012-02-133-162/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will get rid of a useless memcpy on IRQ handling, thus improving driver performance. Tested with OMAP5430 running g_mass_storage on SuperSpeed and HighSpeed. Note that we are removing the little endian access of the TRB and all accesses will be in System endianness, if there happens to be a system in BE, bit 12 of GSBUSCFG0 should be set so that HW does byte invariant BE accesses when fetching TRBs. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: fix SetFeature(TEST)Gerard Cauvy2012-02-103-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When host requests us to enter a test mode, we cannot directly enter the test mode before Status Phase is completed, otherwise the core will never be able to deliver the Status ZLP to host, because it has already entered the requested Test Mode. In order to fix the error, we move the actual start of Test Mode right after we receive Transfer Complete event of the status phase. Signed-off-by: Gerard Cauvy <g-cauvy1@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: debugfs: fix off by one when entering testmodeGerard Cauvy2012-02-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When implementing the USB2 testmode support via debugfs, Felipe has committed a mistake when counting the number of letters of some of the strings, resulting on an off by one error which prevented some of the Test modes to be entered properly. This patch, fixes that mistake. Signed-off-by: Gerard Cauvy <g-cauvy1@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: allocate 3 packets for bulk and isoc endpointsFelipe Balbi2012-02-061-2/+18
| | | | | | | | | | | | | | | | | | | | Those transfer types are generally high bandwidth, so we want to optimize transfers with those endpoints. For that, databook suggests allocating 3 * wMaxPacketSize of FIFO. Let's do that. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: avoid memcpy()ing event bufferFelipe Balbi2012-02-061-1/+2
| | | | | | | | | | | | | | We're only using the 4 byte events and memcpy() will make us slower. We can easily avoid that. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: host: align on host device nameFelipe Balbi2012-02-061-1/+1
| | | | | | | | | | | | | | PCI uses xhci-hcd, so let's use the same device name to avoid confusion. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: debugfs: fix error checkFelipe Balbi2012-02-061-10/+10
| | | | | | | | | | | | | | | | | | | | | | debugfs APIs will return NULL if it fails to create the file/directory we ask it to create. Instead of checking for IS_ERR(ptr) we must check for !ptr. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: omap: convert pdata to of propertyFelipe Balbi2012-02-061-12/+22
| | | | | | | | | | | | | | | | Convert our platform_data usage to OF property, keep the legacy pdata for a while until the complete conversion is done. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: start core on Rx.DetectFelipe Balbi2012-02-062-3/+15
| | | | | | | | | | | | | | | | When we set Run/Stop bit, we also move the core to Rx.Detect state so that USB3 handshake can start from a known location. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: dynamically re-size TxFifosFelipe Balbi2012-02-064-2/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to dynamically re-size TxFifos for the cases where default values will not do. While at that, we create a simple function which, for now, will just allocate one full packet fifo space for each of the enabled endpoints. This can be improved later in order to allow for better throughput by allocating more space for endpoints which could make good use of that like isochronous and bulk. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: move to CONFIGURED also on delayed statusFelipe Balbi2012-02-061-1/+1
| | | | | | | | | | | | | | | | Mass Storage gadget will take some time to handle the SetConfiguration request, but even on those cases we should move to CONFIGURED state. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: use the descriptor pointer we holdFelipe Balbi2012-02-061-1/+1
| | | | | | | | | | | | | | We hold that pointer for one reason. It just looks nicer to use it. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: fix XferNotReady debug printFelipe Balbi2012-02-062-1/+7
| | | | | | | | | | | | | | | | | | | | | | Only bit 3 of the event status bitfield is valid and the others should not be considered. Make sure SW matches documentation on that case to avoid bogus debugging prints which would confuse an engineer. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: allow Link state changes via debugfsFelipe Balbi2012-02-062-1/+111
| | | | | | | | | | | | | | | | This is very useful for low level link testing where we might not have a USB Host stack, only a scope to verify signal integrity. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: re-factor Link state change to a functionFelipe Balbi2012-02-062-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | Most link changes will, of course, happen with the help of a matching host HW, but in some cases we might want to debug very low level details about the link and exposing this to debugfs sounds like a good plan. This is a preparation for such setup. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: allow testmodes changes via debugfsFelipe Balbi2012-02-061-0/+92
| | | | | | | | | | | | | | | | This is very useful for low level Link Testing where we might not have a USB Host stack, only a scope to verify signal integrity. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: re-factor USB2 test mode to a functionFelipe Balbi2012-02-063-18/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some situations were we might need to enable USB Test Modes without having access to a Host stack. In such situations we cannot rely solely on USB Control Messages to enable test features. For those cases, we will also allow test mode to be enabled via debugfs and this patch is a preparation for that. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: core: hcd: make hcd->irq unsignedFelipe Balbi2012-03-017-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | There's really no point in having hcd->irq as a signed integer when we consider the fact that IRQ 0 means NO_IRQ. In order to avoid confusion, make hcd->irq unsigned and fix users who were passing -1 as the IRQ number to usb_add_hcd. Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | USB: ftdi_sio: add support for BeagleBone rev A5+Peter Korsgaard2012-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | BeagleBone changed to the default FTDI 0403:6010 id in rev A5 to make life easier for Windows users, so we need a similar workaround as the Calao board to support it. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | USB: option driver: adding support for Telit CC864-SINGLE, CC864-DUAL and ↵Daniele Palmas2012-03-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | DE910-DUAL modems Adding PID for Telit CC864-SINGLE, CC864-DUAL and DE910-DUAL modems Signed-off-by: Daniele Palmas <dnlplm@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud