summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2013-08-12USB: EHCI: improve interrupt qh unlinkMing Lei
ehci-hcd currently unlinks an interrupt QH when it becomes empty, that is, after its last URB completes. This works well because in almost all cases, the completion handler for an interrupt URB resubmits the URB; therefore the QH doesn't become empty and doesn't get unlinked. When we start using tasklets for URB completion, this scheme won't work as well. The resubmission won't occur until the tasklet runs, which will be some time after the completion is queued with the tasklet. During that delay, the QH will be empty and so will be unlinked unnecessarily. To prevent this problem, this patch adds a 5-ms time delay before empty interrupt QHs are unlinked. Most often, during that time the interrupt URB will be resubmitted and thus we can avoid unlinking the QH. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12USB: EHCI: improve ehci_endpoint_disableMing Lei
The patch does the below improvement: - think QH_STATE_COMPLETING as unlinking state since all URBs on the endpoint should be in unlinking or unlinked when doing endpoint_disable() - add "WARN_ON(!list_empty(&qh->qtd_list));" if qh->qh_state is QH_STATE_LINKED because there shouldn't be any active transfer in qh - when qh->qh_state is QH_STATE_LINKED, the QH(async or periodic) should be in its corresponding list, so the search through the async list isn't necessary. - unlink periodic QH to speed up unlinking if the QH is in linked state Basically, only the last one is related with this patchset because the assumption of "periodic qh self-unlinks on empty" isn't true any more when we introduce unlink-wait for periodic qh. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12USB: HCD: support giveback of URB in tasklet contextMing Lei
This patch implements the mechanism of giveback of URB in tasklet context, so that hardware interrupt handling time for usb host controller can be saved much, and HCD interrupt handling can be simplified. Motivations: 1), on some arch(such as ARM), DMA mapping/unmapping is a bit time-consuming, for example: when accessing usb mass storage via EHCI on pandaboard, the common length of transfer buffer is 120KB, the time consumed on DMA unmapping may reach hundreds of microseconds; even on A15 based box, the time is still about scores of microseconds 2), on some arch, reading DMA coherent memoery is very time-consuming, the most common example is usb video class driver[1] 3), driver's complete() callback may do much things which is driver specific, so the time is consumed unnecessarily in hardware irq context. 4), running driver's complete() callback in hardware irq context causes that host controller driver has to release its lock in interrupt handler, so reacquiring the lock after return may busy wait a while and increase interrupt handling time. More seriously, releasing the HCD lock makes HCD becoming quite complicated to deal with introduced races. So the patch proposes to run giveback of URB in tasklet context, then time consumed in HCD irq handling doesn't depend on drivers' complete and DMA mapping/unmapping any more, also we can simplify HCD since the HCD lock isn't needed to be released during irq handling. The patch should be reasonable and doable: 1), for drivers, they don't care if the complete() is called in hard irq context or softirq context 2), the biggest change is the situation in which usb_submit_urb() is called in complete() callback, so the introduced tasklet schedule delay might be a con, but it shouldn't be a big deal: - control/bulk asynchronous transfer isn't sensitive to schedule delay - the patch schedules giveback of periodic URBs using tasklet_hi_schedule, so the introduced delay should be very small - for ISOC transfer, generally, drivers submit several URBs concurrently to avoid interrupt delay, so it is OK with the little schedule delay. - for interrupt transfer, generally, drivers only submit one URB at the same time, but interrupt transfer is often used in event report, polling, ... situations, and a little delay should be OK. Considered that HCDs may optimize on submitting URB in complete(), the patch may cause the optimization not working, so introduces one flag to mark if the HCD supports to run giveback URB in tasklet context. When all HCDs are ready, the flag can be removed. [1], http://marc.info/?t=136438111600010&r=1&w=2 Cc: Oliver Neukum <oliver@neukum.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-05Merge 3.11-rc4 into usb-nextGreg Kroah-Hartman
We want those fixes in here also. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-03usb: fix some scripts/kernel-doc warningsYacine Belkadi
When building the htmldocs (in verbose mode), scripts/kernel-doc reports the following type of warnings: Warning(drivers/usb/core/usb.c:76): No description found for return value of 'usb_find_alt_setting' Fix them by: - adding some missing descriptions of return values - using "Return" sections for those descriptions Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02USB: ohci-at91: add usb_clk for transition to common clk frameworkBoris BREZILLON
The AT91 PMC (Power Management Controller) provides an USB clock used by USB Full Speed host (ohci) and USB Full Speed device (udc). The usb drivers (ohci and udc) must configure this clock to 48Mhz. This configuration was formely done in mach-at91/clock.c, but this implementation will be removed when moving to common clk framework. This patch adds support for usb clock retrieval and configuration, and is backward compatible with the current at91 clk implementation (if usb clk is not found, it does not configure/enable it). Changes since v1: - use IS_ENABLED(CONFIG_COMMON_CLK) to isolate new at91 clk support Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: EHCI: don't depend on hardware for tracking port resets and resumesAlan Stern
In theory, an EHCI controller can turn off the PORT_RESUME or PORT_RESET bits in a port status register all by itself (and some controllers actually do this). We shouldn't depend on these bits being set correctly. This patch rearranges the code in ehci-hcd that handles completion of port resets and resumes. We guarantee that ehci->reset_done[portnum] is nonzero if a reset or resume is in progress, and that the portnum bit is set in ehci->resuming_ports if the operation is a resume. (To help enforce this guarantee, the patch prevents suspended ports from being reset.) Therefore it's not necessary to look at the port status bits to learn what's going on. The patch looks bigger than it really is, because it changes the indentation level of a sizeable region of code. Most of what it actually does is interchange some tests. The only functional changes are testing reset_done and resuming_ports rather than PORT_RESUME and PORT_RESET, removing a now-unnecessary check for spontaneous resets of the PORT_RESUME and PORT_RESET bits, and preventing a suspended or resuming port from being reset. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: EHCI: keep better track of resuming portsAlan Stern
The ehci-hcd driver isn't as careful as it should be about the way it uses ehci->resuming_ports. One of the omissions was fixed recently by commit 47a64a13d54 (USB: EHCI: Fix resume signalling on remote wakeup), but there are other places that need attention: When a port's suspend feature is explicitly cleared, the corresponding bit in resuming_ports should be set and the core should be notified about the port resume. We don't need to clear a resuming_ports bit when a reset completes. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: pl2303: restrict the divisor based baud rate encoding method to the ↵Frank Schäfer
"HX" chip type It's not clear if the type_0 and type_1 chips support the divisor based baud rate encoding method, so don't use it until anyone with such chip has tested it to avoid regressions with the following patches. Even if it has been working fine with these chips since the code has been added 2 years ago, this change will not cause any regressions, because the baud rates currently supported/allowed with the divisor based method are supported with the direct method, too. The code for the divisor based method also isn't entirely correct (yet), so that the direct encoding method actually works better (sets the baud rate more precisely). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: host: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: handle LPM errors during device suspend correctlyAlan Stern
The hub driver's usb_port_suspend() routine doesn't handle errors related to Link Power Management properly. It always returns failure, it doesn't try to clean up the wakeup setting, (in the case of system sleep) it doesn't try to go ahead with the port suspend regardless, and it doesn't try to apply the new power-off mechanism. This patch fixes these problems. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: refactor code for enabling/disabling remote wakeupAlan Stern
The hub driver is inconsistent in its organization of code for enabling and disabling remote wakeup. There is a special routine to disable wakeup for SuperSpeed devices but not for slower devices, and there is no special routine to enable wakeup. This patch refactors the code. It renames and changes the existing function to make it handle both SuperSpeed and non-SuperSpeed devices, and it adds a corresponding routine to enable remote wakeup. It also changes the speed determination to look at the device's speed rather than the speed of the parent hub -- this shouldn't make any difference because a SuperSpeed device always has to be attached to a SuperSpeed hub and conversely. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: simplify the interface of usb_get_status()Alan Stern
This patch simplifies the interface presented by usb_get_status(). Instead of forcing callers to check for the proper data length and convert the status value to host byte order, the function will now do these things itself. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01usb: misc: usb3503: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01usb: renesas: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01USB: c67x00: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-01usb: core: don't try to reset_device() a port that got just disconnectedJulius Werner
The USB hub driver's event handler contains a check to catch SuperSpeed devices that transitioned into the SS.Inactive state and tries to fix them with a reset. It decides whether to do a plain hub port reset or call the usb_reset_device() function based on whether there was a device attached to the port. However, there are device/hub combinations (found with a JetFlash Transcend mass storage stick (8564:1000) on the root hub of an Intel LynxPoint PCH) which can transition to the SS.Inactive state on disconnect (and stay there long enough for the host to notice). In this case, above-mentioned reset check will call usb_reset_device() on the stale device data structure. The kernel will send pointless LPM control messages to the no longer connected device address and can even cause several 5 second khubd stalls on some (buggy?) host controllers, before finally accepting the device's fate amongst a flurry of error messages. This patch makes the choice of reset dependent on the port status that has just been read from the hub in addition to the existence of an in-kernel data structure for the device, and only proceeds with the more extensive reset if both are valid. Signed-off-by: Julius Werner <jwerner@chromium.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29USB: serial: ftdi_sio: add more RT Systems ftdi devicesRick Farina (Zero_Chaos)
RT Systems makes many usb serial cables based on the ftdi_sio driver for programming various amateur radios. This patch is a full listing of their current product offerings and should allow these cables to all be recognized. Signed-off-by: Rick Farina (Zero_Chaos) <zerochaos@gentoo.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29usb: host: Faraday fotg210-hcd driverFeng-Hsin Chiang
FOTG210 is an OTG controller which can be configured as an USB2.0 host. FOTG210 host is an ehci-like controller with some differences. First, register layout of FOTG210 is incompatible with EHCI. Furthermore, FOTG210 is lack of siTDs which means iTDs are used for both HS and FS ISO transfer. Signed-off-by: Feng-Hsin Chiang <john453@faraday-tech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29USB: serial: pl2303: fix the upper baud rate limit check for type_0/1 chipsFrank Schäfer
Fixes the following regression that has been introduced recently with commit b2d6d98fc7: With type_0 and type_1 chips - all baud rates < 1228800 baud are rounded up to 1228800 baud - the device silently runs at 9600 baud for all baud rates > 1228800 baud Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29usb: chipidea: fix the build error with randconfigPeter Chen
Using below configs, the compile will have error: ERROR: "ehci_init_driver" undefined! .config: CONFIG_USB_CHIPIDEA=m CONFIG_USB_CHIPIDEA_HOST=y CONFIG_USB_CHIPIDEA_DEBUG=y The reason is chipidea host uses symbol from ehci, but ehci is not compiled. Let the chipidea host depend on ehci even it is built as module. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29usb: chipidea: cast PORTSC_PTS and DEVLC_PTS macrosFabio Estevam
Fix the following build warnings on x86: drivers/usb/chipidea/core.c: In function 'hw_phymode_configure': drivers/usb/chipidea/core.c:226:3: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/usb/chipidea/core.c:230:3: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/usb/chipidea/core.c:243:3: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/usb/chipidea/core.c:246:3: warning: large integer implicitly truncated to unsigned type [-Woverflow] Reported-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29Merge tag 'fixes-for-v3.11-rc3' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v3.11-rc3 Here are some fixes for v3.11-rc3. Mostly related to the recent conversion to configfs done on the gadget drivers, but we also have a fix for MUSB resources on platforms which need 3 resources instead of 2, and a fix for the sysfs_notify() call on udc-core.c which was notifying an unexistent file.
2013-07-29Merge 3.11-rc3 into usb-nextGreg Kroah-Hartman
2013-07-29usb: gadget: udc-core: fix the typo of udc state attributeRong Wang
The name of udc state attribute file under sysfs is registered as "state", while usb_gadget_set_state take it as "status" when it's going to update. This patch fixes the typo. Signed-off-by: Rong Wang <Rong.Wang@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Cc: <stable@kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-07-29usb: gadget: f_phonet: remove unused preprocessor conditionalAndrzej Pietrasiewicz
The compatibility layer which the USBF_PHONET_INCLUDED was a part of is no longer present - the USBF_PHONET_INCLUDED is not #defined by anyone anymore, so the ifndef is always true. Removing it. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-07-29usb: gadget: multi: fix error return code in cdc_do_config()Andrzej Pietrasiewicz
Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Introduced by commit 59835a (usb: gadget: multi: use function framework for ACM.) Make rndis_do_config() consistent with cdc_do_config() in the way it handles returning the PTR_ERR(f_acm_*). Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-07-28USB: mos7840: fix pointer castsJohan Hovold
Silence compiler warnings on 64-bit systems introduced by commit 05cf0dec ("USB: mos7840: fix race in led handling") which uses the usb-serial data pointer to temporarily store the device type during probe but failed to add the required casts. [gregkh - change uintptr_t to unsigned long] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26USB: mos7840: fix race in led handlingJohan Hovold
Fix race in LED handling introduced by commit 0eafe4de ("USB: serial: mos7840: add support for MCS7810 devices") which reused the port control urb for manipulating the LED without making sure that the urb is not already in use. This could lead to the control urb being manipulated while in flight. Fix by adding a dedicated LED urb and ctrlrequest along with a LED-busy flag to handle concurrency. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26USB: mos7840: fix device-type detectionJohan Hovold
Fix race in device-type detection introduced by commit 0eafe4de ("USB: serial: mos7840: add support for MCS7810 devices") which used a static variable to hold the device type. Move type detection to probe and use serial data to store the device type. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26USB: mos7840: fix race in register handlingJohan Hovold
Fix race in mos7840_get_reg which unconditionally manipulated the control urb (which may already be in use) by adding a control-urb busy flag. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26USB: serial: add driver for Suunto ANT+ USB deviceGreg Kroah-Hartman
This adds a driver for the Suunto ANT+ USB device, exposing it as a usb serial device. This lets the userspace "gant" program to talk to the device to communicate over the ANT+ protocol to any devices it finds. Reported-by: Steinar Gunderson <sgunderson@bigfoot.com> Tested-by: Steinar Gunderson <sgunderson@bigfoot.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26USB: ohci_usb warn "irq nobody cared" on shutdowncaizhiyong
When ohci-hcd is shutting down, call ohci_usb_reset reset ohci-hcd, the root hub generate an interrupt, but ohci->rh_state is OHCI_RH_HALTED, and ohci_irq ignore the interrupt, the kernel trigger warning "irq nobody cared". ehci-hcd is first disable interrupts, then reset ehci. This patch disable ohci interrupt before reset ohci. The patch is tested at the arm cortex-a9 demo board. Signed-off-by: caizhiyong <caizhiyong@huawei.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26usb: limit OMAP related USB options to OMAP2PLUS platformsPaul Gortmaker
commit 57f6ce072e35770a63be0c5d5e82f90d8da7d665 ("usb: phy: add a new driver for usb3 phy") added the new Kconfig option OMAP_USB3, but it had no dependencies whatsoever, and hence became available across all arch/platforms. Which presumably caused this to show up in x86 randconfig: warning: (USB_MUSB_HDRC && OMAP_USB3) selects \ OMAP_CONTROL_USB which has unmet direct \ dependencies (USB_SUPPORT && ARCH_OMAP2PLUS) Then commit 6992819feb39cb9adac72170555d957d07f869f2 ("usb: phy: fix Kconfig warning") was added. However, this just deleted the ARCH_OMAP2PLUS dependency from OMAP_CONTROL_USB, further compounding the problem by opening up OMAP_CONTROL_USB to all arch/platforms as well. Earlier it was suggested[1] that we revert the change of 6992819feb to restore the dependency, and add a same ARCH_OMAP2PLUS dependency to the new OMAP_USB3 entry. However that was discouraged on the grounds of people wanting the extra sanity compile testing on x86, even though the driver could probably never be used there. Now we have CONFIG_COMPILE_TEST, so developers who value the ability to compile drivers on an architecture that it never can be used for can have that, and people who want dependencies to shield them from seeing options that aren't relevant to their platform get what they want too. Here we restore the dependency but couple it with COMPILE_TEST, in order to achieve both of the above goals. [1] https://patchwork.kernel.org/patch/2194511/ Acked-by: Felipe Balbi <balbi@ti.com> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Moiz Sonasath <m-sonasath@ti.com> Cc: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26usb: ohci-ep93xx: tidy up driver (*probe) and (*remove)H Hartley Sweeten
Merge the usb_hcd_ep93xx_probe() into ohci_hcd_ep93xx_drv_probe() and the usb_hcd_ep93xx_remove() into ohci_hcd_ep93xx_drv_remove(). As Alan Stern pointed out, there is no reason for them to be separate. Also, as Alan Stern suggested, eliminate the ep93xx_start_hc() and ep93xx_stop_hc() routines and simply call clk_enable() and clk_disable() directly. The extra level of redirection does not add any clarity. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26usb: ohci-ep93xx: use devm_clk_get()H Hartley Sweeten
Use devm_clk_get() to make the code a bit cleaner and simpler. This also fixes a bug where a clk_put() is not done if usb_add_hcd() fails. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26usb: ohci-ep93xx: use platform_get_irq()H Hartley Sweeten
Use platform_get_irq() instead of accessing the platform_device resources directly. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26usb: ohci-ep93xx: use devm_ioremap_resource()H Hartley Sweeten
Use devm_ioremap_resource() to make the code a bit cleaner and simpler. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25USB: usb-skeleton.c: add retry for nonblocking readChen Wang
Updated skel_read() in usb-skeleton.c. When there is no data in the buffer, we would allow retry for both blocking and nonblocking cases. Original logic give retry only for blocking case. Actually we can also allow retry for nonblocking case. This will reuse the existing retry logic and handle the return of -EAGAIN in one place. Also if the data to be read is short and can be retrieved in quick time, we can also give a chance for nonblocking case and may catch the data and copy it back to userspace in one read() call too. Signed-off-by: Chen Wang <unicornxx.wang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usbtmc: convert to devm_kzallocAndy Shevchenko
kfree(data) will be called implicitly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usbtmc: remove redundant bracesAndy Shevchenko
There is a few cases where braces are not needed. This patch removes unnecessary '& 255' pieces as well when lvalue type is u8. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usbtmc: call pr_err instead of plain printkAndy Shevchenko
Additionally remove useless label. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usbtmc: remove trailing spacesAndy Shevchenko
Recent patch series introduces few trailing spaces. This patch removes them. No functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usbfs: Allow printer class 'get_device_id' without needing to claim the intfHans de Goede
For certain (HP) printers the printer device_id does not only contain a static part identifying the printer, but it also contains a dynamic part giving printer status, ink level, etc. To get to this info various userspace utilities need to be able to make a printer class 'get_device_id' request without first claiming the interface (as that is in use for the actual printer driver). Since the printer class 'get_device_id' request does not change interface settings in anyway, allowing this without claiming the interface should not cause any issues. CC: Sanjay Kumar <sanjay.kumar14@hp.com> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25USB: host: Use usb_hcd_platform_shutdown() wherever possibleRoger Quadros
Most HCD drivers are doing the same thing in their ".shutdown" callback so it makes sense to use the generic usb_hcd_platform_shutdown() handler there. Signed-off-by: Roger Quadros <rogerq@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25USB: remove redundant "#if"Alan Stern
This patch removes a redundant nested "#ifdef CONFIG_PM" from the hub driver. It also adds a label to the "#endif" line corresponding to the outer "#ifdef CONFIG_PM". Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usb: misc: EHSET Test Fixture device driver for host complianceManu Gautam
An Embedded Host High-Speed Electrical Test (EHSET) test fixture is used to initiate test modes on a host controller in order to perform the high speed electrical testing procedure for USB-IF compliance. When this test fixture is connected to a host, it can enumerate as one of several selectable VID/PID pairs, each corresponding to one of the following test modes: * TEST_SE0_NAK * TEST_J * TEST_K * TEST_PACKET * HS_HOST_PORT_SUSPEND_RESUME * SINGLE_STEP_GET_DEV_DESC * SINGLE_STEP_SET_FEATURE The USB EHSET procedure can be found here: http://www.usb.org/developers/onthego/EHSET_v1.01.pdf Signed-off-by: Manu Gautam <mgautam@codeaurora.org> [jackp@codeaurora.org: imported from commit 073c9409 on codeaurora.org; minor cleanup and updated author email] Signed-off-by: Jack Pham <jackp@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usb: atm: speedtch: be careful with bIntervalFelipe Balbi
bInterval must be on the range 1 - 16, if we want to pass the maximum allowed, we should be passing 16. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usb: class: cdc-acm: be careful with bIntervalFelipe Balbi
bInterval must be on the range 1 - 16, if we want to pass the maximum allowed, we should be passing 16 Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25usb: Clear both buffers when clearing a control transfer TT buffer.William Gulland
Control transfers have both IN and OUT (or SETUP) packets, so when clearing TT buffers for a control transfer it's necessary to send two HUB_CLEAR_TT_BUFFER requests to the hub. Signed-off-by: William Gulland <wgulland@google.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>