summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2
Commit message (Collapse)AuthorAgeFilesLines
* usb: dwc2: host: sleep USB_RESUME_TIMEOUT during resumeGregory Herrero2015-04-101-2/+2
| | | | | | | | | msleep(USB_RESUME_TIMEOUT) must be done when the controller drives the resume. This is true after HPRT0_RES is written. Moreover, restore the delay after controller power is up. Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'usb-for-v4.1-part2' of ↵Greg Kroah-Hartman2015-04-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testing Felipe writes: usb: generic resume timeout for v4.1 This part 2 pull request contains only the patches which make sure everybody on linux uses the same resume timeout value. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: hcd: use new USB_RESUME_TIMEOUTFelipe Balbi2015-04-071-1/+1
| | | | | | | | | | | | | | | | Make sure we're using the new macro, so our resume signaling will always pass certification. Cc: <stable@vger.kernel.org> # v3.10+ Signed-off-by: Felipe Balbi <balbi@ti.com>
* | dwc2: hcd: use USB_DT_HUBSergei Shtylyov2015-04-031-1/+1
| | | | | | | | | | | | | | | | Fix using the bare number to set the 'bDescriptorType' field of the Hub Descriptor while the value is #define'd in <linux/usb/ch11.h>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge tag 'usb-for-v4.1' of ↵Greg Kroah-Hartman2015-03-246-103/+110
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.1 merge window As usual, a big pile of commits. This time a total of 111 non-merge commits. Other than the usual set of cleanups and non-critical fixes, we have some interesting work for AM335x's MUSB babble recovery. Now that takes a lot less time and we don't have to Reset MUSB all the time. The printer gadget has been converted to configfs interface and the atmel udc has learned suspend/resume with wakeup. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: pci: Correctly compile dwc2-pci as a module or built-inJohn Youn2015-03-191-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | The dwc2-pci driver should be compiled as a module when configured to do so. If the dwc2-pci is configured as a module but actually built-in, it can cause build errors due to the fact that the generic-phy will be allowed to compile as a module causing undefined references. Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: avoid leaking DMA channels on disconnectionVincent Palatin2015-03-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the HCD is disconnected, the DMA transfers still in-flight were cleaned-up but the count of available DMA channels (e.g. available_host_channels) was not reset. The pool of DMA channels can be depleted when doing unclean disconnection of USB peripherals, and reaches the point where no transfer was possible until the next reboot/reload of the driver. Tested by putting a programmable USB mux on the port and randomly plugging/unpluging a USB HUB with USB mass-storage key, USB-audio and USB-ethernet dongle connected to its downstream ports, and also doing the disconnection early while the devices are still enumerating to get more URBs in-flight. After the patch, the devices are still enumerating after thousands of cycles, while the port was totally dead before. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: pci: Select the generic PHY for dwc2-pci driverJohn Youn2015-03-131-0/+1
| | | | | | | | | | | | | | | | | | The dwc2-pci driver requires the generic PHY. This fixes undefined reference issues when it is not selected. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: rework initialization of host and gadget in dual-role modeMarek Szyprowski2015-03-122-8/+23
| | | | | | | | | | | | | | | | | | | | If device is configured to work only in HOST or DEVICE mode, there is no point in initializing both subdrivers. This patch also fixes resource leakage if host subdriver fails to initialize. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: pci: Add device mode to the dwc2-pci driverJohn Youn2015-03-112-90/+76
| | | | | | | | | | | | | | | | | | | | | | | | The pci driver now registers a platform driver, like in dwc3, and lets its probe function do all the initialization. This allows it to account for changes to the platform driver that were not added to the pci driver. Also future changes to the probe function don't have to be duplicated. This also has the effect of adding device and DRD mode to the pci driver. Tested on the Synopsys HAPS PCIe platform. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: move definition of PCI_VENDOR_ID_SYNOPSYS to linux/pci_ids.hJoseph Kogut2015-03-101-1/+0
| | | | | | | | | | | | | | | | Removed FIXME from usb/dwc3/dwc3-pci.c by moving definition of PCI_VENDOR_ID_SYNOPSYS shared with usb/dwc2 to linux/pci_ids.h. Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc2: host: fix dwc2 disconnect bugYunzhi Li2015-03-101-0/+3
|/ | | | | | | | | | | | When dwc2 controller detects a disconnect interrupt, dwc2_hcd_disconnect() should be called immediately to do clean-up jobs and set port_connect_status_change flag to notify usb hub driver disconnect status. Tested-by: Vincent Palatin <vpalatin@chromium.org> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'usb-for-v3.20' of ↵Greg Kroah-Hartman2015-02-047-459/+932
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.20 merge window Here's the big pull request for Gadgets and PHYs. It's a total of 217 non-merge commits with pretty much everything being touched. The most important bits are a ton of new documentation for almost all usb gadget functions, a new isp1760 UDC driver, several improvements to the old net2280 UDC driver, and some minor tracepoint improvements to dwc3. Other than that, a big list of minor cleanups, smaller bugfixes and new features all over the place. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: Fix a bug in reading the endpoint directions from reg.Roshan Pius2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the DWC2 datasheet, the HWCFG1 register stores the configured endpoint directions for endpoints 0-15 in bit positions 0-31. ========================== Endpoint Direction (EpDir) This 32-bit field uses two bits per endpoint to determine the endpoint direction. Endpoint Bits [31:30]: Endpoint 15 direction Bits [29:28]: Endpoint 14 direction .... Bits [3:2]: Endpoint 1 direction Bits[1:0]: Endpoint 0 direction (always BIDIR) ========================== The DWC2 driver is currently interpreting the contents of the register as directions for endpoints 1-15 which leads to an error in determining the configured endpoint directions in the core because the first 2 bits determine the direction of endpoint 0 and not 1. This is based on testing/next branch in Felipe's git. Signed-off-by: Roshan Pius <rpius@chromium.org> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: fix USB core dependenciesArnd Bergmann2015-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is currently possible to configure the dwc2 driver as built-in when host mode or dual-role is enabled, but the USB core is a loadable module. This leads to a link failure: drivers/built-in.o: In function `_dwc2_hcd_start': :(.text+0x84538): undefined reference to `usb_hcd_resume_root_hub' drivers/built-in.o: In function `_dwc2_hcd_urb_dequeue': :(.text+0x84aa0): undefined reference to `usb_hcd_check_unlink_urb' :(.text+0x84e4c): undefined reference to `usb_hcd_unlink_urb_from_ep' :(.text+0x84e74): undefined reference to `usb_hcd_giveback_urb' drivers/built-in.o: In function `dwc2_assign_and_init_hc': :(.text+0x86b98): undefined reference to `usb_hcd_unmap_urb_for_dma' drivers/built-in.o: In function `_dwc2_hcd_urb_enqueue': :(.text+0x8717c): undefined reference to `usb_hcd_link_urb_to_ep' :(.text+0x872f4): undefined reference to `usb_hcd_unlink_urb_from_ep' drivers/built-in.o: In function `dwc2_host_complete': :(.text+0x875d4): undefined reference to `usb_hcd_unlink_urb_from_ep' :(.text+0x87600): undefined reference to `usb_hcd_giveback_urb' drivers/built-in.o: In function `dwc2_hcd_init': :(.text+0x87ba8): undefined reference to `usb_disabled' :(.text+0x87d38): undefined reference to `usb_create_hcd' :(.text+0x88094): undefined reference to `usb_add_hcd' :(.text+0x880dc): undefined reference to `usb_put_hcd' drivers/built-in.o: In function `dwc2_hcd_remove': :(.text+0x8821c): undefined reference to `usb_remove_hcd' :(.text+0x8823c): undefined reference to `usb_put_hcd' drivers/built-in.o: In function `dwc2_hc_handle_tt_clear.isra.10': :(.text+0x88e2c): undefined reference to `usb_hub_clear_tt_buffer' drivers/built-in.o: In function `dwc2_hcd_qtd_add': :(.text+0x8b554): undefined reference to `usb_calc_bus_time' To fix the problem, this patch changes the dependencies so that dwc2 host mode can only be enabled if either the USB core is built-in or both USB and dwc2 are modules. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: initialize controller in pullup callbackGregory Herrero2015-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | USB reset interrupt is no more used to reset the controller. Thus, reset the controller in pullup callback as described by Synopsys programming guide. Otherwise enumeration sometimes fails when usb configuration is switched without physical disconnection. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: replace constants with definesMian Yousaf Kaukab2015-01-302-12/+13
| | | | | | | | | | | | | | | | | | Defines are more readable and searchable than constants. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: fix phy interface configurationMian Yousaf Kaukab2015-01-301-3/+7
| | | | | | | | | | | | | | | | | | | | | | hsotg->phyif is set in dwc2_gadget_init according to phy interface width. Use it for configuration instead of hardcoded value. Moreover, set USB turnaround time according to phy width. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: fix debug message for zlpMian Yousaf Kaukab2015-01-301-1/+6
| | | | | | | | | | | | | | | | | | | | Print debug message according to zlp direction. Always saying "Sending" is misleading. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: don't modify pullup status during resetGregory Herrero2015-01-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | Pullup doesn't need to be enabled during usb reset since it is already enabled. This leads to shorter chirp-k duration if done during usb reset. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: add reset flag in init functionGregory Herrero2015-01-303-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a flag to request physical reset of the controller when s3c_hsotg_core_init_disconnected is called. During the usb reset, controller must not be fully reconfigured and resetted. Else this leads to shorter chirp-k duration during enumeration. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: add unaligned buffers supportMian Yousaf Kaukab2015-01-302-1/+63
| | | | | | | | | | | | | | | | | | | | When using DMA, dwc2 requires buffers to be 4 bytes aligned. Use bounce buffers if they are not. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: remove hardcoded if (0) and if (1) checksMian Yousaf Kaukab2015-01-301-13/+1
| | | | | | | | | | | | | | | | | | Remove dead code as well. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: fix a typo in commentGregory Herrero2015-01-301-1/+1
| | | | | | | | | | | | | | | | | | s3c_hsotg_process_req_feature comments was not correct Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: add TEST_MODE feature supportGregory Herrero2015-01-302-7/+186
| | | | | | | | | | | | | | | | | | | | | | | | Handle SET_FEATURE TEST_MODE request sent by the host. Slightly rework FEATURE request handling to allow parsing other request types than Endpoint. Also add a debugfs to change test mode value from user space. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: gadget: fix clear halt feature handlingGregory Herrero2015-01-301-7/+13
| | | | | | | | | | | | | | | | | | | | | | When clearing HALT on an endpoint, req->complete of in progress requests must be called with locks off. New request should only be started if there is not already a pending request on the endpoint. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: host: resume root hub on remote wakeupGregory Herrero2015-01-301-2/+4
| | | | | | | | | | | | | | | | | | When a remote wakeup happens during bus_suspend, hcd needs to resume its root hub. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc2: hcd: use HUB_CHAR_*Sergei Shtylyov2015-01-191-1/+3
| | | | | | | | | | | | | | | | Fix using the bare number to set the 'wHubCharacteristics' field of the Hub Descriptor while the values are #define'd in <linux/usb/ch11.h>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * Revert "usb: dwc2: add bus suspend/resume for dwc2"Paul Zimmerman2015-01-191-77/+11
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0cf884e819e05437287a668b9bfcc198bab6329c. Even after applying the follow-on patch at https://patchwork.kernel.org/patch/5325111 there are still problems with device connect on the Altera SOCFPGA platform at least. One possible fix would be to add a whitelist to enable suspend/resume on platforms where it does work correctly. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * Merge tag 'v3.19-rc5' into nextFelipe Balbi2015-01-191-1/+5
| |\ | | | | | | | | | | | | | | | | | | | | | Linux 3.19-rc5 Conflicts: drivers/usb/dwc2/gadget.c drivers/usb/gadget/udc/bdc/bdc_ep.c
| * | usb: dwc2: gadget: report disconnection after resetMian Yousaf Kaukab2015-01-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If usb bus is reset without a physical disconnection, all endpoints will remain open. Call s3c_hsotg_disconnect() from reset handler to report a disconnect to gadget framework. hsotg->connected is checked in s3c_hsotg_disconnect() before processing disconnect. In some cases, USBRst is seen before EnumDone and after it as well. So move setting of hsotg->connected to set-address to avoid reporting extra disconnection in this case. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: force gadget initialization in dev modeGregory Herrero2015-01-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When booting with id pin grounded, dwc2 default to host mode. Thus, force device mode prior initializing gadget part. Else fifo init will fail since fifo values are not correct in host mode. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: add vbus_draw supportGregory Herrero2015-01-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This callback informs the driver about the total amount of current it is allowed to draw. Share this information with the phy so that current limits can be set for charging for example. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: fix pullup handlingGregory Herrero2015-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gadget must be informed about disconnection when pullup is removed. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: reset fifo_map when initializing fifosGregory Herrero2015-01-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After all endpoints are disabled, fifo_map should have reached 0. Its a bug if if didn't, so warn about it and reset it to 0 so that driver can continue using all the fifos. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: fix fifo allocation leakMian Yousaf Kaukab2015-01-121-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When selecting different alt setting, s3c_hsotg_ep_enable can be called with fifo already allocated. Allocate fifo again only if required and after deallocating the previous fifo. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: pick smallest acceptable fifoMian Yousaf Kaukab2015-01-121-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current algorithm picks the first fifo which is equal to or greater than the required size. This can result in bigger fifos assigned to endpoints with smaller maxps. Change the algorithm to pick the smallest fifo which is greater than or equal to the required size. Moreover, only use signed variables when required. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: rename sent_zlp to send_zlpMian Yousaf Kaukab2015-01-122-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag is set before sending the zlp. So use present tense instead of the past tense. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: add vbus_session supportGregory Herrero2015-01-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable phy driver to report vbus session. This allows us to remove D+ pullup when vbus is not present. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: don't block after fifo flush timeoutGregory Herrero2015-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Can't stay in the loop forever. Break it after timeout. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: dont warn if endpoint is not enabledMian Yousaf Kaukab2015-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning is probably good but it has false positives in both dma and non-dma cases. So its not very helpful in either. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: fix zero length packet transfersMian Yousaf Kaukab2015-01-121-29/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to programming guide, zero length packet should be programmed on its own and should not be counted in DIEPTSIZ.PktCnt with other packets. For ep0, this is the zlp for DATA IN stage (if required) and not for the STATUS stage. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: manage ep0 state in softwareMian Yousaf Kaukab2015-01-122-80/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manage ep0 state in software to add handling of status OUT stage. Just toggling hsotg->setup in s3c_hsotg_handle_outdone leaves it in wrong state in 2-stage control transfers. Moreover, ensure that for setup-packet s3c_hsotg_handle_outdone is called either from SetupDone or OutDone but not both. Dwc2 ip v3.00a generates both SetupDone and OutDone on setup packets. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: kill requests after disabling epMian Yousaf Kaukab2015-01-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kill_all_requests() can flush the fifo. Call it after disabling the endpoint. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: consider all tx fifosMian Yousaf Kaukab2015-01-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When matching tx fifo to endpoint, consider all fifos instead of hard limiting to 8 Moreover, print error in case no fifo could be found. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: fix debug loop limitsMian Yousaf Kaukab2015-01-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < 15 check doesn't show debug information for endpoint 15. It is possible to have less than 15 endpoints so use limit provided by hardware configuration. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: remove unused members from hsotg_reqMian Yousaf Kaukab2015-01-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | These members are only occupying space. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: configure fifos from device treeGregory Herrero2015-01-122-28/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As fifo size can vary between SOCs, add possibility to configure them from device tree. Fifo sizes used by the legacy driver will be used If they are not provided by the device tree. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Reviewed-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: check interrupts for all endpointsMian Yousaf Kaukab2015-01-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code does not check endpoint 15 interrupt. Use number of endpoint configured in hardware instead of the hardcoded value. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc2: gadget: add bi-directional endpoint supportMian Yousaf Kaukab2015-01-122-119/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHWCFG1 provides hardware configuration of each endpoint. Use it to configure the endpoints instead of assuming all even endpoint are OUT and all odd endpoints are IN. Tested-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud