aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
Commit message (Collapse)AuthorAge
...
| * usb: dwc3: gadget: drop useless codeFelipe Balbi2012-06-06
| | | | | | | | | | | | | | | | We never set CMDIOC bit for Start Transfer command, so that code will never be used. Tested-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: Fix break from cleanup request loopPratyush Anand2012-06-04
| | | | | | | | | | | | | | | | | | If event status says that its last completed TRB but TRB is still owned by HW then break from the loop, because we are not going to get correct TRB status from trb control/size register. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: Fix missed isoc IN transactionPratyush Anand2012-06-04
| | | | | | | | | | | | | | | | | | | | If an IN transfer is missed on isoc endpoint, then driver must insure that next ep_queue is properly handled. This patch fixes this issue by starting a new transfer for next queued request. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * USB: DWC3: Correct DWC3_DSTS_SOFFN_MASK definitionPratyush Anand2012-06-04
| | | | | | | | | | | | | | SOF Number is bit16:3 of DSTS. Correct the mask accordingly. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * USB: DWC3: Correct DWC3_TRB_SIZE_TRBSTS definitionPratyush Anand2012-06-04
| | | | | | | | | | | | | | Correct define for DWC3_TRB_SIZE_TRBSTS. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * USB: DWC3: Generate interrupt on each TRB as default optionPratyush Anand2012-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in case of isoc, interrupt is programmed after each TRB_NUM/4 ie 8th TRB. A TRB is programmed against each submitted request from gadget. If we do not want to limit the minimum number of necessary request to be submitted from gadget then we must receive interrupt on each TRB submission. There can be such situation with a gadget working with ping-pong buffer. If a gadget does not want to receive interrupt after each request completion then it may set no_interrupt flag. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: rename dwc3_ep0_complete_req to dwc3_ep0_complete_statusFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | | | | | That's a much more intuitive name as that function is only called at the completion of a Status Phase. It also matches dwc3_ep0_complete_data() for the completion of Data Phase. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: be careful with endianness on SetSEL commandFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | USB is always little endian, but this driver could run on non little endian cpus. Let's be carefull with that. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: simplify error handling on dwc3_ep0_inspect_setupFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | There's no need for returning early. Instead, we can call dwc3_ep0_stall_and_restart() conditionally. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: move AcceptU1Ena and AcceptU2Ena to Reset IRQGerard CAUVY2012-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the databook, the DWC3 Core will reset those bits to 0 on USB Bus Reset. This means we must re-enable those bits on every reset interrupt. Because we will always get a Reset interrupt after loading a gadget driver, we can, instead of re-enabling something that was just lost, move the handling of those bits to the Reset Interrupt. This patch fixes USB30CV U1/U2 Test. Signed-off-by: Gerard CAUVY <g-cauvy1@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: disable U1/U2 on disconnectFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | If we get a disconnect IRQ, we should take the core out of low power mode so we can reconnect afterwards. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: prevent DCTL register corruptionFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | | | If we don't read out the contents of the register (in order to reinitialize 'reg' variable) we will be writing unknown contents to the DCTL register whenever we try to use dwc3_gadget_wakeup() function. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: core: make sure evt->lpos is correctly initializedPaul Zimmerman2012-06-03
| | | | | | | | | | | | | | | | | | | | | | The same event buffers will be reused when coming out of hibernation, so we must reinitialize them properly to avoid any mistakes. While at that, also take dwc3_event_buffers_setup() out of __devinit section. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: support new revisions of DWC3 corePaul Zimmerman2012-06-03
| | | | | | | | | | | | | | | | | | | | Recent cores (>= 1.94a) have a set of new features, commands and a slightly different programming model. This patch aims to support those changes. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: rename phy_power() to phy_suspend()Paul Zimmerman2012-06-03
| | | | | | | | | | | | | | | | | | those two functions don't power PHYs, they simply put them in suspend state. Rename to reflect better what functions actually do. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: reinitialize retriesPaul Zimmerman2012-06-03
| | | | | | | | | | | | | | retries is used twice without being reinitialized. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: add definitions for new registersPaul Zimmerman2012-06-03
| | | | | | | | | | | | | | | | This patch adds definitions for some new registers that have been added to later versions of the controller, up to v2.10a. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: remove trailing semicolonFelipe Balbi2012-06-03
| | | | | | | | | | | | | | That semicolon doesn't do anything, it's not needed and should be removed. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: fix a typo in commentFelipe Balbi2012-06-03
| | | | | | | | | | | | | | s/has/have. No functional changes, just a typo fix on a code comment. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: align on function signatureFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | | | | | | | | | On our Transfer Not Ready handlers, only dwc3_ep0_do_control_status() had a different list of parameters. Align on the parameters in order to keep consistency. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: switch over to IS_ALIGNEDFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | | | IS_ALIGNED provides a much faster operation for checking proper size alignment then a modulo operation. Let's use it. Reported-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: handle pending unaligned Control OUT data phase correctlyFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | When DWC3_EP_PENDING_REQUEST flag is set for a Control OUT Data phase transfer, we would be missing the proper handling for unaligned OUT requests, thus hanging a transfer. Since proper handling is already done on dwc3_ep0_do_control_data(), we simply re-factor that function so it can be re-used from __dwc3_gadget_ep0_queue(). Reported-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: fix a WARN and a commentFelipe Balbi2012-06-03
| | | | | | | | | | | | | | | | we're now have DWC3_EP0_BOUNCE_SIZE to tell us the actual size of the bufer. Let's use that instead of ep0 wMaxPacketSize. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | Merge tag 'gadget-for-v3.6' of ↵Greg Kroah-Hartman2012-07-05
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: gadget: patches for v3.6 merge window This is quite a big pull request and contains patches all over the place. omap_udc is now a bit cleaner after removing omap2 support, fixing some checkpatch.pl warnings and errors, switching over to generic map/unmap routines and preventing a NULL pointer de-reference. s3c-hsotg has been switched over to devm_* API, got some locking fixes and improvements and it also got an implementation for the pullup() method. the mass storage gadgets changed default value of the removable parameter, dropped some unused options and made "file" and "ro" module_parameters read-only in some cases. ffs function got support for HID descriptor. Some UDCs have been converted to clk_prepare_enable() and clk_disable_unprepare(). Marvell now got support for its USB3 controller in mainline after introducing its mv_u3d_core.c driver.
| * | usb: gadget: composite: fix ep->maxburst initializationFelipe Balbi2012-06-12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | bMaxBurst field on endpoint companion descriptor is supposed to contain the number of burst minus 1. When passing that to controller drivers, we should be passing the real number instead (by incrementing 1). While doing that, also fix the assumption on dwc3 that value comes decremented by one. Signed-off-by: Felipe Balbi <balbi@ti.com>
* / usb: dwc3: fix giveback of queued request in ep_dequeuePratyush Anand2012-06-15
|/ | | | | | | | | In case of ep_dequeue , if dequeued request was submitted for dma transfer, then endpoint is stopped. Once endpoint is stooped, callback for the dequeued request must be called. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: Fix the dwc3 dependencyjoseph daniel2012-05-11
| | | | | | | | | The warning shown up when ran with randconfig, warning: (USB_DWC3) selects USB_XHCI_PLATFORM which has unmet direct dependencies (USB_SUPPORT && USB_XHCI_HCD) Signed-off-by: joseph daniel <josephdanielwalter@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'dwc3-for-v3.5' of ↵Greg Kroah-Hartman2012-05-07
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: dwc3: patches for v3.5 merge window This pull request contains one workaround for a Silicon Issue found on all RTL releases prior to 2.20a, which would cause a metastability state on Run/Stop bit. We also have some patches implementing a few extra Standard requests introduced by USB3 spec (Set SEL and Set Isoch Delay), as well as one patch, which has been pending for a long time, implementing LPM support. Last, but not least, we are splitting the host address space out of the dwc3 core driver otherwise xHCI won't be able to request_mem_region() its own address space. This patch is only needed because we are (as we should) re-using the xHCI driver, which is a completely separate module. Together with these three big changes, come a few extra preparatory patches which most move code around, define macros and so on, as well as a fix for Isochronous transfers which hasn't been triggered before. [ resolved conflicts and build error in drivers/usb/dwc3/gadget.c - gregkh]
| * usb: dwc3: define DWC3_EP0_BOUNCE_SIZEFelipe Balbi2012-05-04
| | | | | | | | | | | | | | | | to avoid sprinkling magic constants on the driver we define a constant to be used when allocating setup_buffer and ep0_bounce buffer. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: issue Update Transfer command after queuing isoc requestPaul Zimmerman2012-05-02
| | | | | | | | | | | | | | | | | | | | | | Issue an Update Transfer command after queuing a request to an isoc EP with an active transfer. This is required according to the dwc3 databook. Pratyush Anand reports that this fixes a problem he was having with Isoc IN transfers. Tested-by: Pratyush Anand<pratyush.anand@st.com> Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: implement support for Set Isoch Delay requestFelipe Balbi2012-05-02
| | | | | | | | | | | | | | | | | | This is basically a noop for DWC3. We don't have to do anything. Basically we test if the request parameters are correct, cache the Isochronous Delay and return success. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: increase setup buffer sizeFelipe Balbi2012-05-02
| | | | | | | | | | | | | | | | | | We want to re-use that buffer for other USB requests, so let's increase it to biggest wMaxPacketSize for ep0 so it works for everything we have in mind. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: implement Set SEL supportFelipe Balbi2012-05-02
| | | | | | | | | | | | | | | | | | This patch implements Set SEL Standard Request support for dwc3 driver. It needs to issue a command to the controller passing the timing we received on the data phase of the Set SEL request. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: gadget: implement Global Command supportFelipe Balbi2012-05-02
| | | | | | | | | | | | | | This will be used by the ep0 layer for implementing Set SEL Standard Request. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: add LPM handlingSebastian Andrzej Siewior2012-04-30
| | | | | | | | | | | | | | | | | | | | On device loading the driver enables LPM and the acceptance of U1 and U2 states. The [Set|Clear]Feature requests for "U1/U2" are forwarded directly to the hardware and allow / forbid the initiation of the low power links. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: core: split host address spaceIdo Shayevitz2012-04-24
| | | | | | | | | | | | | | | | | | This fix prevents a problem with dwc3 and host mode where we were requesting the entire memory region in dwc3/core.c, thus preventing xhci-plat from ever ioremapping its own address space. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: omap: add dwc3_omap_readl/writel functionsIdo Shayevitz2012-04-24
| | | | | | | | | | | | | | | | | | We separate between dwc3-omap helper functions to dwc3-core helper functions. This will allow us to change the helper functions implementation according to each module need. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: workaround: metastability state on Run/Stop bitFelipe Balbi2012-04-11
| | | | | | | | | | | | | | | | | | | | | | | | All revisions prior to 2.20a have a known issue which causes metastability state on Run/Stop bit if we configure the core to work on any of the USB2-only speeds. The suggested workaround is just to never configure the core to anything other than SuperSpeed. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: core: define more revision macrosFelipe Balbi2012-04-11
| | | | | | | | | | | | | | | | We have other revisions already released, let's define revision macros for those so we can do runtime detection of known erratas. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: Update dwc3 udc to use usb_endpoint_descriptor inside the struct ↵Ido Shayevitz2012-05-04
| | | | | | | | | | | | | | | | | | usb_ep Remove redundant pointer to struct usb_endpoint_descriptor. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: Free event buffers arrayAnton Tikhomirov2012-04-10
| | | | | | | | | | | | | | | | Array should be freed together with event buffers, since it was allocated dynamically. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: ep0: add a default case for SetFeature commandGerard Cauvy2012-04-10
| | | | | | | | | | | | | | | | | | | | Without this default case returning an error, thus replying with a stall, we would fail USB30CV TD 9.11 Bad Feature test case. Cc: stable@vger.kernel.org Signed-off-by: Gerard Cauvy <g-cauvy1@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: ep0: increment "actual" on bounced ep0 caseFelipe Balbi2012-04-10
| | | | | | | | | | | | | | | | | | | | | | | | due to a HW limitation we have a bounce buffer for ep0 out transfers which are not aligned with MaxPacketSize. On such case we were not increment r->actual as we should. This patch fixes that mistake. Cc: stable@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: ep0: Handle requests greater than wMaxPacketSizeMoiz Sonasath2012-04-10
|/ | | | | | | | | | | To allow ep0 out transfers of upto bounce buffer size instead of maxpacketsize, use the transfer size as multiple of ep0 maxpacket size. Cc: stable@vger.kernel.org Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Partha Basak <p-basak2@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'usb-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds2012-03-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: dwc3: pci: fix another failure path in dwc3_pci_probe()Felipe Balbi2012-03-13
| | | | | | | | | | | | | | | | | | | | | | | | When applying commit 7d26b58 (fix failure path in dwc3_pci_probe()), I mistakenly left out one of the possible failures where we would return success even on the error case. This patch fixes that mistake. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: core: Convert to module_platform_driverTobias Klauser2012-03-02
| | | | | | | | | | | | | | Use the module_platform_driver macro. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge tag 'dwc3-for-v3.4' of ↵Greg Kroah-Hartman2012-03-02
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>