summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-linus' of ↵Linus Torvalds2012-03-212-15/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile 1 from Al Viro: "This is _not_ all; in particular, Miklos' and Jan's stuff is not there yet." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits) ext4: initialization of ext4_li_mtx needs to be done earlier debugfs-related mode_t whack-a-mole hfsplus: add an ioctl to bless files hfsplus: change finder_info to u32 hfsplus: initialise userflags qnx4: new helper - try_extent() qnx4: get rid of qnx4_bread/qnx4_getblk take removal of PF_FORKNOEXEC to flush_old_exec() trim includes in inode.c um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it um: embed ->stub_pages[] into mmu_context gadgetfs: list_for_each_safe() misuse ocfs2: fix leaks on failure exits in module_init ecryptfs: make register_filesystem() the last potential failure exit ntfs: forgets to unregister sysctls on register_filesystem() failure logfs: missing cleanup on register_filesystem() failure jfs: mising cleanup on register_filesystem() failure make configfs_pin_fs() return root dentry on success configfs: configfs_create_dir() has parent dentry in dentry->d_parent configfs: sanitize configfs_create() ...
| * gadgetfs: list_for_each_safe() misuseAl Viro2012-03-201-6/+3
| | | | | | | | | | | | | | really weirdly spelled "while the list is non-empty, pick its first element, remove it from the list and free it" kind of loop... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * switch open-coded instances of d_make_root() to new helperAl Viro2012-03-202-9/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge tag 'usb-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds2012-03-2051-668/+2738
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull USB merge for 3.4-rc1 from Greg KH: "Here's the big USB merge for the 3.4-rc1 merge window. Lots of gadget driver reworks here, driver updates, xhci changes, some new drivers added, usb-serial core reworking to fix some bugs, and other various minor things. There are some patches touching arch code, but they have all been acked by the various arch maintainers." * tag 'usb-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (302 commits) net: qmi_wwan: add support for ZTE MF820D USB: option: add ZTE MF820D usb: gadget: f_fs: Remove lock is held before freeing checks USB: option: make interface blacklist work again usb/ub: deprecate & schedule for removal the "Low Performance USB Block" driver USB: ohci-pxa27x: add clk_prepare/clk_unprepare calls USB: use generic platform driver on ath79 USB: EHCI: Add a generic platform device driver USB: OHCI: Add a generic platform device driver USB: ftdi_sio: new PID: LUMEL PD12 USB: ftdi_sio: add support for FT-X series devices USB: serial: mos7840: Fixed MCS7820 device attach problem usb: Don't make USB_ARCH_HAS_{XHCI,OHCI,EHCI} depend on USB_SUPPORT. usb gadget: fix a section mismatch when compiling g_ffs with CONFIG_USB_FUNCTIONFS_ETH USB: ohci-nxp: Remove i2c_write(), use smbus USB: ohci-nxp: Support for LPC32xx USB: ohci-nxp: Rename symbols from pnx4008 to nxp USB: OHCI-HCD: Rename ohci-pnx4008 to ohci-nxp usb: gadget: Kconfig: fix typo for 'different' usb: dwc3: pci: fix another failure path in dwc3_pci_probe() ...
| * | usb: gadget: f_fs: Remove lock is held before freeing checksAndi Kleen2012-03-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | lock debugging already supports this, no need to do it explicitely. Cc: balbi@ti.com Cc: gregkh@linuxfoundation.org Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | usb gadget: fix a section mismatch when compiling g_ffs with ↵Lothar Waßmann2012-03-131-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_USB_FUNCTIONFS_ETH commit 28824b18ac4705e876a282a15ea0de8fc957551f: |Author: Michal Nazarewicz <m.nazarewicz@samsung.com> |Date: Wed May 5 12:53:13 2010 +0200 | | USB: gadget: __init and __exit tags removed | | __init, __initdata and __exit tags have have been removed from | various files to make it possible for gadgets that do not use | the __init/__exit tags to use those. obviously missed (at least) this case leading to a section mismatch in g_ffs.c when compiling with CONFIG_USB_FUNCTIONFS_ETH enabled. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | usb: gadget: Kconfig: fix typo for 'different'Fabio Baltieri2012-03-131-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com> Reviewed-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | USB: gadget: Make g_hid device class conform to spec.Orjan Friberg2012-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HID devices should specify this in their interface descriptors, not in the device descriptor. This fixes a "missing hardware id" bug under Windows 7 with a VIA VL800 (3.0) controller. Signed-off-by: Orjan Friberg <of@flatfrog.com> Cc: Felipe Balbi <balbi@ti.com> Cc: stable <stable@vger.kernel.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: 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>
| * | 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>
| * | Merge tag 'gadget-for-v3.4' of ↵Greg Kroah-Hartman2012-03-0137-523/+2623
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next USB: Gadget: changes for 3.4 This merge is rather big. Here's what it contains: For am5536udc we have just simple coding style fixes. Nothing that has any potential to cause any issues going forward. With mv_udc, there's only one single change removing an unneeded NULL check. at91_udc also only saw a single change this merge window, and that's only removing a duplicated header. The Renesas controller has a few more involved changes. Support for SUDMAC was added, there's now a special handling of IRQ resources for when the IRQ line is shared between Renesas controller and SUDMAC, we also had a bug fix where Renesas controller would sleep in atomic context while doing DMA transfers from a tasklet. There were also a set of minor cleanups. The FSL UDC also had a scheduling in atomic context bug fix, but that's all. Thanks to Sebastian, the dummy_hcd now works better than ever with support for scatterlists and streams. Sebastian also added SuperSpeed descriptors to the serial gadgets. The highlight on this merge is the addition of a generic API for mapping and unmapping usb_requests. This will avoid code duplication on all UDC controllers and also kills all the defines for DMA_ADDR_INVALID which UDC controllers sprinkled around. A few of the UDC controllers were already converted to use this new API. Conflicts: drivers/usb/dwc3/gadget.c
| | * | usb: gadget: goku: use generic map/unmap routinesFelipe Balbi2012-02-281-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: net2280: use generic map/unmap routinesFelipe Balbi2012-02-281-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: net2272: use generic map/umap routinesFelipe Balbi2012-02-281-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: r8a66597: use generic map/unmap routinesFelipe Balbi2012-02-281-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: amd5536: use generic map/unmap routinesFelipe Balbi2012-02-281-27/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: langwell: use generic map/unmap functionsFelipe Balbi2012-02-281-38/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | those routines have everything we need to map/unmap USB requests and it's better to use them. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: add generic map/unmap request utilitiesFelipe Balbi2012-02-281-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | such utilities are currently duplicated on all UDC drivers basically with the same structure. Let's group all implementations into one generic implementation and get rid of that duplication. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: Remove old CVS markersCyril Roelandt2012-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Git does not care about CVS markers. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: Fix the type of ep_stringCyril Roelandt2012-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use "static const char *const" instead of "static const char *". Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: use the DEFINE_PCI_DEVICE_TABLE macroCyril Roelandt2012-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DEFINE_PCI_DEVICE_TABLE instead of "const struct pci_device_id". Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: Fix indentationCyril Roelandt2012-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove an unnecessary level of indentation. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: Fix coding style issues.Cyril Roelandt2012-02-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary whitespaces. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: amd5536udc: Fix brace coding style issues.Cyril Roelandt2012-02-271-57/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a bunch of unneeded braces. Signed-off-by: Cyril Roelandt <tipecaml@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: fsl_udc_core: Fix scheduling while atomic dump messagePeter Chen2012-02-241-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading g_ether gadget, there is below message: Backtrace: [<80012248>] (dump_backtrace+0x0/0x10c) from [<803cb42c>] (dump_stack+0x18/0x1c) r7:00000000 r6:80512000 r5:8052bef8 r4:80513f30 [<803cb414>] (dump_stack+0x0/0x1c) from [<8000feb4>] (show_regs+0x44/0x50) [<8000fe70>] (show_regs+0x0/0x50) from [<8004c840>] (__schedule_bug+0x68/0x84) r5:8052bef8 r4:80513f30 [<8004c7d8>] (__schedule_bug+0x0/0x84) from [<803cd0e4>] (__schedule+0x4b0/0x528) r5:8052bef8 r4:809aad00 [<803ccc34>] (__schedule+0x0/0x528) from [<803cd214>] (_cond_resched+0x44/0x58) [<803cd1d0>] (_cond_resched+0x0/0x58) from [<800a9488>] (dma_pool_alloc+0x184/0x250) r5:9f9b4000 r4:9fb4fb80 [<800a9304>] (dma_pool_alloc+0x0/0x250) from [<802a8ad8>] (fsl_req_to_dtd+0xac/0x180) [<802a8a2c>] (fsl_req_to_dtd+0x0/0x180) from [<802a8ce4>] (fsl_ep_queue+0x138/0x274) [<802a8bac>] (fsl_ep_queue+0x0/0x274) from [<7f004328>] (composite_setup+0x2d4/0xfac [g_ether]) [<7f004054>] (composite_setup+0x0/0xfac [g_ether]) from [<802a9bb4>] (fsl_udc_irq+0x8dc/0xd38) [<802a92d8>] (fsl_udc_irq+0x0/0xd38) from [<800704f8>] (handle_irq_event_percpu+0x54/0x188) [<800704a4>] (handle_irq_event_percpu+0x0/0x188) from [<80070674>] (handle_irq_event+0x48/0x68) [<8007062c>] (handle_irq_event+0x0/0x68) from [<800738ec>] (handle_level_irq+0xb4/0x138) r5:80514f94 r4:80514f40 [<80073838>] (handle_level_irq+0x0/0x138) from [<8006ffa4>] (generic_handle_irq+0x38/0x44) r7:00000012 r6:80510b1c r5:80529860 r4:80512000 [<8006ff6c>] (generic_handle_irq+0x0/0x44) from [<8000f4c4>] (handle_IRQ+0x54/0xb4) [<8000f470>] (handle_IRQ+0x0/0xb4) from [<800085b8>] (tzic_handle_irq+0x64/0x94) r9:412fc085 r8:00000000 r7:80513f30 r6:00000001 r5:00000000 r4:00000000 [<80008554>] (tzic_handle_irq+0x0/0x94) from [<8000e680>] (__irq_svc+0x40/0x60) The reason of above dump message is calling dma_poll_alloc with can-schedule mem_flags at atomic context. To fix this problem, below changes are made: - fsl_req_to_dtd doesn't need to be protected by spin_lock_irqsave, as struct usb_request can be access at process context. Move lock to beginning of hardware visit (fsl_queue_td). - Change the memory flag which using to allocate dTD descriptor buffer, the memory flag can be from gadget layer. It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial. Cc: stable@vger.kernel.org Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disableIdo Shayevitz2012-02-2414-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix a bug in f_serial, which expect the ep->desc to be NULL after disabling an endpoint. Cc: stable@vger.kernel.org Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: at91_udc: linux/prefetch.h included twiceDanny Kukawka2012-02-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/usb/gadget/at91_udc.c included 'linux/prefetch.h' twice, remove the duplicate. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: Add Audio Class 2.0 DriverJassi Brar2012-02-153-9/+1485
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a flexible USB Audio Class 2.0 compliant gadget driver that implements a simple topology with a virtual sound card exposed at the function side. The driver doesn't expect any real audio codec to be present on the function - the audio streams are simply sinked to and sourced from a virtual ALSA sound card created. The user-space application may choose to do whatever it wants with the data received from the USB Host and choose to provide whatever it wants as audio data to the USB Host. Capture(USB-Out) and Playback(USB-In) can be run at independent configurations specified via module parameters while loading the driver. Make this new version as the default selection by a new Kconfig choice. Signed-off-by: Yadi Brar <yadi.brar01@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: audio: Move string IDs to audio.cJassi Brar2012-02-152-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move manufacturer and product string ids into audio.c so as to be reusable by the new uac2 version of gadget driver. Signed-off-by: Yadi Brar <yadi.brar01@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: Rename audio function to uac1Jassi Brar2012-02-154-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The extant USB-Audio function driver complies to UAC_1 spec. So name the files accordingly, paving way for inclusion of a new UAC_2 specified driver. Signed-off-by: Yadi Brar <yadi.brar01@gmail.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: add usb3.0 descriptors to serial gadgetsSebastian Andrzej Siewior2012-02-093-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SS descriptors to the ACM & generic serial gadget. The ACM part was tested with minicom + dummy + send / receive files over ttyACM <=> ttyGS0. The generic serial part (f_serial) was not tested (haven't found a driver on the host side). The nokia & multi gadget use HS at most. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: clean the ep in autoconf before returning it.Sebastian Andrzej Siewior2012-02-091-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 72c973dd aka ("usb: gadget: add usb_endpoint_descriptor to struct usb_ep) the descriptor is part of the ep. Most gadgets like g_zero or masstorage call config_ep_by_speed() to grab an available endpoint which may be used for FS/HS/SS bulk/iso/intr and in a second they assign the proper descriptor by calling config_ep_by_speed(). This is good so far. A few of them like ncm call config_ep_by_speed() only if ep->desc not assigned earlier. That means ep->desc is never assigned if the endpoint was used by another gadget before it was removed. Some of those gadgets also assign ep->driver_data to NULL on reset or ep_disable part _but_ keep a reference to this endpoint. At ep_enable time they assign driver_data to their private data. This probably needs a clean up of its own. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Detecting VBUS through GPIO with interruptTomoya MORINAGA2012-02-091-4/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: pch_udc continues operation even if VBUS becomes Low. pch_udc performs D+ pulling up before VBUS becomes High. USB device should be controlled according to VBUS state. Root cause: The current pch_udc is not always monitoring VBUS. Solution: The change of VBUS is detected using an interrupt of GPIO. If VBUS became Low, pch_udc handles 'disconnect'. After VBUS became High, a pull improves D+, and pch_udc handles 'connect'. [ balbi@ti.com : make it actually compile ] Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Detecting VBUS through GPIOTomoya MORINAGA2012-02-091-3/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: In USB Suspend, pch_udc handles 'disconnect'. Root cause: The current pch_udc is not monitoring VBUS. When USB cable is disconnected, USB Device Controller generates an interrupt of USB Suspend. pch_udc cannot distinguish it is USB Suspend or disconnect. Therefore, pch_udc handles 'disconnect' after an interrupt of USB Suspend happend. Solution: VBUS is detected through GPIO. After an interrupt produced USB Suspend, if VBUS is Low, pch_udc handles 'disconnect'. If VBUS is High, pch_udc handles 'suspend'. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: dummy_hcd: fix null-deref free reqSebastian Andrzej Siewior2012-02-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _ep to ep is a pointer substraction so ep won't be zero unless _ep was 8. This was not intendent by the author, it was probably a typo while checking for NULL of the argument. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: dummy_hcd: don't assign ->desc on error caseSebastian Andrzej Siewior2012-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the stream check fails then we leave ep->desc assigend but we return with an error code. The caller assumes the endpoint is not enabled (which is the case) but it can not enable it again due to this assigment. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: Add Interface Association Descriptor to ECMPraveena Nadahally2012-01-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add IAD to bind the two interfaces of ECM so that it works properly in composite gadget mode. Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com> Signed-off-by: Praveena Nadahally <praveen.nadahally@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: f_mass_storage: remove one FSG_NO_INTR_EPSebastian Andrzej Siewior2012-01-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove one define of FSG_NO_INTR_EP and we still have that we can use. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: update Michal Nazarewicz's email addressMichal Nazarewicz2012-01-248-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The m.nazarewicz@samsung.com email address is no longer valid, so this commit replaces it with mina86@mina86.com which is employer-agnostic and thus should be valid for foreseeable feature. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: dummy_hcd: clean up checkpatchSebastian Andrzej Siewior2012-01-241-221/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts checkpatch output of |./scripts/checkpatch.pl drivers/usb/gadget/dummy_hcd.c -file from |total: 22 errors, 174 warnings, 2642 lines checked to |total: 0 errors, 0 warnings, 2632 lines checked Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: dummy_hcd: use usb_endpoint_type()Sebastian Andrzej Siewior2012-01-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes use of usb_endpoint_type() instead of the open coding. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: dummy_hcd: complete stream supportSebastian Andrzej Siewior2012-01-241-16/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dummy_hcd provides (alloc|free)_stream() callbacks but there are not doing anything. The transfer side also lacks matching of streams. This patch changes this and implements stream allocation / de-allocation support and proper urb <=> req matching. The UDC side exposes a limit of 16 streams. DWC3, the only USB3 UDC has no limitations in this regard except that it _needs_ to know that streams will be used at the ep_enable time. At the host side, there is no real limit either: XHCI can allocate any number of streams as long as it does not run out of memory. The UAS gadget currently requests 16 streams and the UAS host side fallbacks from the requested 256 down to 16 which is fine. From the UASP point of view (the only specified user), the number of used streams does not really matter. The only limitation is that the host may not use a higher stream than the gadget requested and can deal with. The dummy stream support has been modelled after current UAS + XHCI + DWC3 + UASP usage which helps me testing: - the device announces that each ep supports 16 streams (even it could more than that). - the device side looks into Companion descriptor at ep_enable time and enables them according to it. - the host side tries to enable the requested number of streams but the upper limit is the Comanion descriptor. None (zero streams) is an error condition, less is okay. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Add debug messageTomoya MORINAGA2012-01-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: Adding debugging messages. CAUSE: The debugging messages are added to make sure of that major interrupt events are occurring. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Reduce redundant interruptTomoya MORINAGA2012-01-241-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: USB Suspend interrupts occur frequently. CAUSE: When it is called pch_udc_reconnect() in USB Suspend, it repeats reset and Suspend. SOLUTION: pch_udc_reconnect() does not enable all interrupts. When an enumeration event occurred the driver enables all interrupts. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget ↵Tomoya MORINAGA2012-01-241-4/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connect/disconnect issue ISSUE: After a USB cable is connect/disconnected, the system rarely freezes. CAUSE: Since the USB device controller cannot know to disconnect the USB cable, when it is used without detecting VBUS by GPIO, the UDC driver does not notify to USB Gadget. Since USB Gadget cannot know to disconnect, a false setting occurred when the USB cable is connected/disconnect repeatedly. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Fix USB suspend issueTomoya MORINAGA2012-01-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: After USB Suspend, a system rarely freezes. CAUSE: When USB Suspend occurred, the driver is not notifying a gadget of the event. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Fix wrong return valueTomoya MORINAGA2012-01-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: If the return value of pch_udc_pcd_init() is False, the return value of this function is unsettled. Since pch_udc_pcd_init() always returns 0, there is not actually the issue. CAUSE: If pch_udc_pcd_init() is True, the variable, retval, is not set for an appropriate value. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | usb: gadget: pch_udc: Fix disconnect issueTomoya MORINAGA2012-01-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISSUE: When the driver notifies a gadget of a disconnect event, a system rarely freezes. CAUSE: When the driver calls dev->driver->disconnect(), it is not calling spin_unlock(). Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud