aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAge
* USB: gadget: Implement runtime PM for MSM bus glue driverPavankumar Kondeti2010-12-10
| | | | | | | | OTG driver takes care of putting hardware in low power mode. Hence not registered for any runtime PM callbacks. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Implement runtime PM for ci13xxx gadgetPavankumar Kondeti2010-12-10
| | | | | | | | The actual suspend/resume work is delegated to bus glue driver, which is responsible for putting hardware in low power mode. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Add USB controller driver for MSM SoCPavankumar Kondeti2010-12-10
| | | | | | | | | | | MSM SoC has chipidea USB controller. So use ci13xxx_udc core. This driver depends on transceiver driver for clock control, PHY initialization, VBUS detection. Register for notify_event callback to perform MSM specific quirks after controller is reset and stopped. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Introduce ci13xxx_udc_driver structPavankumar Kondeti2010-12-10
| | | | | | | | | | | | | | | | | | | Introduces ci13xxx_udc_driver struct for bus glue drivers to hint ci13xxx_udc core about their special requirements. The flags include avoiding hardware register access when controller is not in peripheral mode, enabling pull-up upon VBUS, disabling streaming mode and dependency on transceiver driver. Initialize gadget_ops in udc_probe so that transceiver can notify VBUS presence even when no gadget driver is bounded. A notify_event callback is embedded in the same struct. This patch implements two events called CONTROLLER_RESET_EVENT and CONTROLLER_STOPPED_EVENT to notify the bus glue driver after resetting and stopping the controller for performing SoC specific quirks. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Initialize ci13xxx gadget device's coherent DMA maskPavankumar Kondeti2010-12-10
| | | | | | | | | dma_alloc_coherent() which is internally called by dma_pool_alloc() flags a warning if device's coherent DMA mask. Hence initialize gadget device's coherent DMA mask to it's parent mask. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udcPavankumar Kondeti2010-12-10
| | | | | | | | | | | | | dma_pool_alloc() require sleeping context when called with GFP_KERNEL argument. Hence release the spin lock before calling dma_pool_alloc(). usb_ep_alloc_request can also be called with non-atomic GFP flags. Hence get rid off spin lock while allocation request memory. Use GFP_ATOMIC flag for allocating request for ep0 in interrupt handler. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Separate out PCI bus code from ci13xxx_udcPavankumar Kondeti2010-12-10
| | | | | | | | | Move PCI bus code from ci13xxx_udc to a new file ci13xxx_pci. SoC's which has MIPS USB core can include the ci13xxx_udc and keep bus glue code in their respective gadget controller drivers. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: OTG: msm: Add support for power managementPavankumar Kondeti2010-12-10
| | | | | | | | | | Implement runtime and system pm ops to put hardware into low power mode (LPM). As part of LPM, USB clocks are turned off, PHY is put into suspend state and PHY comparators are turned off if VBUS/Id notifications are not required from PHY. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: msm: Add support for power managementPavankumar Kondeti2010-12-10
| | | | | | | | | Enable runtime PM and mark no_callbacks flag. OTG device, parent of HCD takes care of putting hardware into low power mode. Adjust port power wakeup flags during system suspend and resume. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: Add MSM Host Controller driverPavankumar Kondeti2010-12-10
| | | | | | | | | | This patch adds support for EHCI compliant HSUSB Host controller found on MSM chips. The root hub has a single port and TT is built into it. This driver depends on OTG driver for PHY initialization, clock management and powering up VBUS. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Add MSM OTG Controller driverPavankumar Kondeti2010-12-10
| | | | | | | | | | This driver implements PHY initialization, clock management, ULPI IO ops and simple OTG state machine to kick host/peripheral based on Id/VBUS line status. VBUS/Id lines are tied to a reference voltage on some boards. Hence provide debugfs interface to select host/peripheral mode. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: ASPM quirk of ISOC on AMD SB800Alex He2010-12-10
| | | | | | | | | | | | | | | | | When ASPM PM Feature is enabled on UMI link, devices that use ISOC stream of data transfer may be exposed to longer latency causing less than optimal per- formance of the device. The longer latencies are normal and are due to link wake time coming out of low power state which happens frequently to save power when the link is not active. The following code will make exception for certain features of ASPM to be by passed and keep the logic normal state only when the ISOC device is connected and active. This change will allow the device to run at optimal performance yet minimize the impact on overall power savings. Signed-off-by: Alex He <alex.he@amd.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: usb_wwan: Add missing uaccess.h / fix build failurePeter Huewe2010-12-10
| | | | | | | | | | | This patch fixes a build failure[1] by adding the missing uaccess.h needed for copy_from_user and copy_to_user References: http://kisskb.ellerman.id.au/kisskb/buildresult/3607218/ Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: gadget: f_fs: Remove redundant unlikely()Tobias Klauser2010-12-10
| | | | | | | IS_ERR() already implies unlikely(), so it can be omitted here. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: host: uhci-q: Fixed minor coding style issuesTobias Ollmann2010-12-10
| | | | | | | | Fixed coding style issues (delete trailing whitespaces, break long line) Signed-off-by: Tobias Ollmann <tobias.ollmann@gmx.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: gadget/imx-udc: fix interrupt name againUwe Kleine-König2010-12-10
| | | | | | | | | | | | | | Commit 06c3859 (usb: gadget/imx-udc: remove usage of deprecated symbol USBD_INT0) was a bit precipitant because the name used instead didn't match the usual naming scheme for irqs on arm/imx. I renamed the irq to the right name in e083000 (ARM: imx: dynamically allocate imx_udc device) when 06c3859 didn't hit Linus' tree, so I missed to add a compat #define. This patch allows compiling imx_udc.c with and without e083000. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: whci-hcd: fix compiler warningNamhyung Kim2010-12-10
| | | | | | | | | | Annotate whci_hcd_id_table as '__used' to fix following warning: CC drivers/usb/host/whci/hcd.o drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Merge branch 'sh/ehci' of ↵Greg Kroah-Hartman2010-12-03
|\ | | | | | | | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 into work * 'sh/ehci' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: Convert to USB_ARCH_HAS_OHCI/EHCI selects. usb: ehci-sh: Add missing ehci helpers. usb: ehci-sh: Fix up fault in shutdown path. sh: Add EHCI support for SH7786. usb: ehci-hcd: Add support for SuperH EHCI. usb: ohci-sh: Set IRQ as shared.
| * sh: Convert to USB_ARCH_HAS_OHCI/EHCI selects.Paul Mundt2010-12-01
| | | | | | | | | | | | | | | | | | This switches over to selects for the subtypes to enable OHCI/EHCI support explicitly rather than littering the usb Kconfig with subtype dependencies. Suggested-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * usb: ehci-sh: Add missing ehci helpers.Paul Mundt2010-11-26
| | | | | | | | | | | | | | | | The ehci-sh driver was missing tie-ins for endpoint_reset and clear_tt_buffer_complete, add them in. Reported-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * usb: ehci-sh: Fix up fault in shutdown path.Paul Mundt2010-11-26
| | | | | | | | | | | | | | | | We can't use the generic usb_hcd_platform_shutdown helper on account of the fact we don't stash the hcd pointer in the driver data, so we provide our own shutdown handler. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * usb: ehci-hcd: Add support for SuperH EHCI.Paul Mundt2010-11-01
| | | | | | | | | | | | | | This adds a trivial stub for supporting EHCI mode of the on-chip SH USB host controllers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * usb: ohci-sh: Set IRQ as shared.Paul Mundt2010-11-01
| | | | | | | | | | | | | | | | The SH USB interface has both OHCI and EHCI modes that share the same interrupt. Flag the OHCI IRQ as shared in preparation for EHCI support. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'for-next' of git://gitorious.org/usb/usb into usb-nextGreg Kroah-Hartman2010-12-03
|\ \ | | | | | | | | | | | | | | | | | | * 'for-next' of git://gitorious.org/usb/usb: usb: musb: gadget: prevent a NULL pointer dereference usb: musb: add names for IRQs in structure resource usb: musb: remove board_data parameter from musb_platform_init()
| * | usb: musb: gadget: prevent a NULL pointer dereferenceFelipe Balbi2010-12-01
| | | | | | | | | | | | | | | | | | | | | | | | Case we can't allocate struct musb_request, prevent a NULL pointer dereference by returning early. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: musb: add names for IRQs in structure resourceHema Kalliguddi2010-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Soon resource data will get automatically populated from a set of autogenerated data from TI's hardware database for the OMAP platform. Such database, might not have resources at the expected order by the current drivers. While we could hack in some exceptions to that tool to generate resources in a specific order, it seems less fragile to use the resource name instead. That way, no matter what order the resources are generated, the driver still work. Modified the OMAP, Blackfin and Davinci architecture files to add the name of the IRQs in the resource structures and musb driver to use the platform_get_irq_byname() api to get the device and dma irq numbers instead of using the index. Cc: Tony Lindgren <tony@atomide.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: musb: remove board_data parameter from musb_platform_init()Hema Kalliguddi2010-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed the board_data parameter being passed to musb_platform_init function as board_data can be extracted from device structure which is already member of musb structure. Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | | usb: g_audio: Fix crash at driver removalRichard Röjfors2010-12-03
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If g_audio fails to open the sound control device, it crashes at removal: Insertion: [ 4143.836536] g_audio gadget: unable to open sound control device file: /dev/snd/controlC0 [ 4143.836543] g_audio gadget: we need at least one control device [ 4143.836551] g_audio gadget: Linux USB Audio Gadget, version: Dec 18, 2008 [ 4143.836558] g_audio gadget: g_audio ready Removal: [ 4146.802643] BUG: unable to handle kernel paging request at 00023018 [ 4146.802655] IP: [<c10af9f5>] filp_close+0xa/0x5b [ 4146.802674] *pdpt = 0000000015426001 *pde = 0000000000000000 [ 4146.802684] Oops: 0000 [#1] PREEMPT SMP [ 4146.802692] last sysfs file: /sys/power/state [ 4146.802701] Modules linked in: g_audio(-) ioh_udc fuse asix usbnet [last unloaded: g_audio] [ 4146.802719] [ 4146.802728] Pid: 1394, comm: rmmod Not tainted 2.6.33.5-26.1-ivi #1 To be filled by O.E.M./To be filled by O.E.M. [ 4146.802738] EIP: 0060:[<c10af9f5>] EFLAGS: 00010206 CPU: 0 [ 4146.802746] EIP is at filp_close+0xa/0x5b [ 4146.802753] EAX: 00023000 EBX: 00023000 ECX: 00000046 EDX: df842680 [ 4146.802760] ESI: e071cd4c EDI: df842680 EBP: ddbbbef0 ESP: ddbbbee4 [ 4146.802768] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 4146.802776] Process rmmod (pid: 1394, ti=ddbba000 task=dd95a4f0 task.ti=ddbba000) [ 4146.802782] Stack: [ 4146.802787] d540c280 e071cd4c df2bc000 ddbbbefc e071b82c df11e440 ddbbbf04 e071c622 [ 4146.802804] <0> ddbbbf28 e071c47f 00000008 e071cd74 df11e464 df2bc01c df2bc000 e071ce68 [ 4146.802822] <0> 00000880 ddbbbf38 e07fd1b8 e071cef0 00000000 ddbbbf40 e071b9f4 ddbbbf48 [ 4146.802842] Call Trace: [ 4146.802857] [<e071b82c>] ? gaudio_cleanup+0x87/0xe0 [g_audio] [ 4146.802869] [<e071c622>] ? audio_unbind+0x8/0xc [g_audio] [ 4146.802881] [<e071c47f>] ? composite_unbind+0x8d/0xcb [g_audio] [ 4146.802895] [<e07fd1b8>] ? usb_gadget_unregister_driver+0x7b/0xc0 [ioh_udc] [ 4146.802908] [<e071b9f4>] ? usb_composite_unregister+0x15/0x17 [g_audio] [ 4146.802920] [<e071c633>] ? cleanup+0xd/0xf [g_audio] [ 4146.802932] [<c105a938>] ? sys_delete_module+0x185/0x1dd [ 4146.802944] [<c101c3ea>] ? do_page_fault+0x248/0x276 [ 4146.802956] [<c10027d0>] ? sysenter_do_call+0x12/0x26 [ 4146.802962] Code: 12 5f 3a 00 8b 43 04 8b 40 0c 0f b3 30 3b 73 44 73 03 89 73 44 89 f8 e8 f1 61 3a 00 5b 5e 5f 5d c3 55 89 e5 57 89 d7 56 53 89 c3 <8b> 40 18 85 c0 75 0f 68 32 15 5e c1 31 f6 e8 52 39 3a 00 5a eb [ 4146.803058] EIP: [<c10af9f5>] filp_close+0xa/0x5b SS:ESP 0068:ddbbbee4 [ 4146.803071] CR2: 0000000000023018 [ 4146.803112] ---[ end trace 0989a7e023da0434 ]--- This patch makes sure not to assign the_card if gaudio_open_snd_dev fails, since the parent function will deallocate the card. Also make sure all filp's in gaudio_open_snd_dev is assigned NULL upon error and gaudio_close_snd_dev only cleanups when the filp's are non-NULL. Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge branch 'omap4-ehci-for-greg' of ↵Greg Kroah-Hartman2010-11-30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb into usb-next * 'omap4-ehci-for-greg' of git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb: omap4: 4430sdp: enable the ehci port on 4430SDP arm: omap4: select USB_ARCH_HAS_EHCI arm: omap4: usb: add platform init code for EHCI arm: omap4: add USBHOST and related base addresses usb: ehci-omap: Add OMAP4 support omap: usb: ehci: introduce HSIC mode usb: ehci-omap: add helpers for checking port mode usb: ehci-omap: use clkdev aliases for functional clocks omap: clock: add clkdev aliases for EHCI clocks usb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAP usb: ehci-omap: don't hard-code TLL channel count usb: ehci-omap: update clock names to be more generic
| * | usb: ehci-omap: Add OMAP4 supportAnand Gadiyar2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the ehci-omap glue layer to support the controller in the OMAP4. Major differences from OMAP3 is that the OMAP4 has per-port clocking, and supports ULPI output clocking mode. The old input clocking mode is not supported. Also, there are only 2 externally available ports as against 3 in the OMAP3. The third port is internally tied off and should not be used. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | usb: ehci-omap: add helpers for checking port modeAnand Gadiyar2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | Introduce helper functions to test port mode. These checks are performed in several places in the driver, and these helpers improve readability. Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | usb: ehci-omap: use clkdev aliases for functional clocksAnand Gadiyar2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | Use the recently updated aliases to get functional clocks needed by the driver. This allows the driver to acquire OMAP4-specific clocks without having to use different clock names for OMAP3 and OMAP4. Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | usb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAPKeshava Munegowda2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the CONFIG_USB_EHCI_HCD_OMAP option to select EHCI support on OMAP3 and later chips. This scales better than having a long line of dependencies for each new OMAP with EHCI support. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | usb: ehci-omap: don't hard-code TLL channel countKeshava Munegowda2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the TLL channel count a parameter instead of a hardcoded value. This allows us to be flexible with future OMAP revisions which could have a different number of channels. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | usb: ehci-omap: update clock names to be more genericKeshava Munegowda2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename usbhost2_120m_fck to usbhost_hs_fck and usbhost1_48m_fck to usbhost_fs_fck, to better reflect the clocks' functionalities. In OMAP4, the frequencies for the corresponding clocks are not necessarily the same as with OMAP3, however the functionalities are. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
* | | USB: pxa: Add USB client support for Marvell PXA9xx/PXA168 chipscxie42010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add USB client support Marvell PXA9xx/PXA168 chips. The USB controller in PXA9xx/PXA168 is a High-Speed OTG controller. The available endpoints is different between PXA9xx and PXA168. NOTE: It is the first version of Marvell PXA9xx/PXA168 USB controller driver. The support for OTG mode will be added in later patch. PXA9xx and PXA168 has integrated UTMI PHY in the chips. The initialization for the PHY is a little different between PXA9xx and PXA168. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | usb: Add in missing EHCI helpers.Paul Mundt2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several of the EHCI glue drivers either predate or were merged in the same timeframe as API changes at the USB core level, resulting in some missing endpoint_reset and clear_tt_buffer_complete callbacks. This fixes up all of ehci-atmel, mxc, w90x900, and xilinx-of to tie in the new helpers, which brings them in line with everyone else. Reported-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | usb: gadget: langwell_udc: add usb test mode supportLuo Andy2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds test mode support for Langwell gadget driver. Signed-off-by: Henry Yuan <hang.yuan@intel.com> Signed-off-by: Andy Luo <yifei.luo@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | usb: composite gadget: set vbus_draw current limitation during suspendHao Wu2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies the composite gadget to set vbus_draw current limitation during suspend state. This current limitation in suspend state shouldn't be more than 2.5mA Signed-off-by: Hao Wu <hao.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | usb: otg: twl4030-usb: Fix unbalanced regulator disables at module removalJarkko Nikula2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function twl4030_usb_remove can cause unbalanced regulator disables in twl4030_phy_power if the cable is not connected. Regulator enable/disable calls are in balance only if the twl4030_phy_resume was called prior the twl4030_usb_remove, that is, the cable was connected. Fix this by checking the 'asleep' variable in twl4030_usb_remove since that variable is used to check state in other functions. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | | usb-wwan: implement TIOCGSERIAL and TIOCSSERIAL to avoid blocking close(2)Dan Williams2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices (ex ZTE 2726) simply don't respond at all when data is sent to some of their USB interfaces. The data gets stuck in the TTYs queue and sits there until close(2), which them blocks because closing_wait defaults to 30 seconds (even though the fd is O_NONBLOCK). This is rarely desired. Implement the standard mechanism to adjust closing_wait and let applications handle it how they want to. Signed-off-by: Dan Williams <dcbw@redhat.com>
* | | USB: Remove unnecessary casts of void ptr returning alloc function return valuesJesper Juhl2010-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, The [vk][cmz]alloc(_node) family of functions return void pointers which it's completely unnecessary/pointless to cast to other pointer types since that happens implicitly. This patch removes such casts from drivers/usb/ Signed-off-by: Jesper Juhl <jj@chaosbits.net>
* | | usbmon: correct length for isochronousPete Zaitcev2010-11-30
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually the usbmon returns the amount of data specified in urb->transfer_buffer_length for output submissions and urb->actual_length for input callbacks. However, for Isochronous input transfers, this is not enough, since the returned data buffer may contain "holes". One easy way to fix this is to use urb->transfer_buffer_length, but this often transfers a whole lot of unused data, so we find how much was actually used instead. Original patch by Márton Németh. See also kernel bug 22182. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ce4100: Add support for CE4100 EHCI IP block to EHCI driverDirk Brandewie2010-11-17
| | | | | | | | | | | | | | | | | | This patch adds support for the EHCI IP block present on the Intel CE4100. Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> CC: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb: gadget: g_fs: Fix compilation warningMichal Nazarewicz2010-11-17
| | | | | | | | | | | | | | | | | | | | | | This commit fixes warning in f_fs.c introduced by "usb: gadget: f_fs: remove custom printk() wrappers": In file included from drivers/usb/gadget/g_ffs.c:64: drivers/usb/gadget/f_fs.c:30:1: warning: "pr_fmt" redefined Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: improve uses of usb_mark_last_busyAlan Stern2010-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1434) cleans up the uses of usb_mark_last_busy() in usbcore. The function will be called when a device is resumed and whenever a usage count is decremented. A call that was missing from the hub driver is added: A hub is used whenever one of its ports gets suspended (this prevents hubs from suspending immediately after their last child). In addition, the call to disable autosuspend support for new devices by default is moved from usb_detect_quirks() (where it doesn't really belong) into usb_new_device() along with all the other runtime-PM initializations. Finally, an extra pm_runtime_get_noresume() is added to prevent new devices from autosuspending while they are being registered. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: use the runtime-PM autosuspend implementationAlan Stern2010-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1428) converts USB over to the new runtime-PM core autosuspend framework. One slightly awkward aspect of the conversion is that USB devices will now have two suspend-delay attributes: the old power/autosuspend file and the new power/autosuspend_delay_ms file. One expresses the delay time in seconds and the other in milliseconds, but otherwise they do the same thing. The old attribute can be deprecated and then removed eventually. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: make usb_mark_last_busy use pm_runtime_mark_last_busyMing Lei2010-11-16
| | | | | | | | | | | | | | | | | | | | | | Since the runtime-PM core already defines a .last_busy field in device.power, this patch uses it to replace the .last_busy field defined in usb_device and uses pm_runtime_mark_last_busy to implement usb_mark_last_busy. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: use sysfs_merge_group for power attributesAlan Stern2010-11-16
| | | | | | | | | | | | | | | | | | This patch (as1426) makes use of the new sysfs_merge_group() and sysfs_unmerge_group() routines to simplify the handling of power attributes for USB devices. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: use the no_callbacks flag for interfacesMing Lei2010-11-16
| | | | | | | | | | | | | | | | | | | | | | Call pm_runtime_no_callbacks to set no_callbacks flag for USB interfaces. Since interfaces cannot be power-managed separately from their parent devices, there's no reason for the runtime-PM core to invoke any callbacks for them. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>