aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2/core.c
AgeCommit message (Collapse)AuthorFilesLines
2015-08-07treewide: Fix typo in printkMasanari Iida1-1/+1
This patch fix spelling typo inv various part of sources. Signed-off-by: Masanari Iida <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2015-07-06usb: dwc2: embed storage for reg backup in struct dwc2_hsotgMian Yousaf Kaukab1-40/+15
Register backup function can be called from atomic context. Instead of using atomic memory pool, embed backup storage space in struct dwc2_hsotg. Also add a valid flag in each struct as NULL pointer can't be used as the content validity check any more. Acked-by: John Youn <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Tested-by: Doug Anderson <[email protected]> Signed-off-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: add hibernation core parameterGregory Herrero1-0/+24
dwc2 may not be able to exit from hibernation if the hardware does not provide a way to detect resume signalling in this state. Thus, add the possibility to disable hibernation feature. Acked-by: John Youn <[email protected]> Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: remove dwc2_platform.koMian Yousaf Kaukab1-3/+0
As dwc2 pci module is now exporting dwc2 platform device, include platform.o in dwc2-y and remove USB_DWC2_PLATFORM configuration option. Driver will be built as two modules, dwc2.ko and dwc2_pci.ko. dwc2.ko is the new platform driver. Remove all EXPORT_SYMBOL_GPL as they are not needed any more. Acked-by: John Youn <[email protected]> Signed-off-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: set parameter values in probe functionMian Yousaf Kaukab1-0/+19
So the parameters can be used in both host and gadget modes. Also consolidate param functions in the core.h Acked-by: John Youn <[email protected]> Signed-off-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: add external_id_pin_ctl core parameterGregory Herrero1-1/+21
This is required due to an Intel specific hardware issue. Where id- pin setup causes glitches on the interrupt line when CONIDSTSCHG interrupt is enabled. Specify external_id_pin_ctl when an external driver (for example phy) can handle id change, so that CONIDSTSCHG interrupt can be disabled from the controller. Acked-by: John Youn <[email protected]> Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-04-29usb: dwc2: add controller hibernation supportGregory Herrero1-0/+377
When suspending usb bus, phy driver may disable controller power. In this case, registers need to be saved on suspend and restored on resume. Acked-by: John Youn <[email protected]> Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-01-12usb: dwc2: Fixed a few typos in commentsMickael Maison1-1/+1
Fixed 3 typos in comments Signed-off-by: Mickael Maison <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-11-14usb: dwc2: Update common interrupt handler to call gadget interrupt handlerDinh Nguyen1-10/+0
Make dwc2_handle_common_intr call the gadget interrupt function when operating in peripheral mode. Remove the spinlock functions in s3c_hsotg_irq as dwc2_handle_common_intr() already has the spinlocks. Move the registeration of the IRQ to common code for platform and PCI. Remove duplicate interrupt conditions that was in gadget, as those are handled by dwc2 common interrupt handler. Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Dinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2014-09-19usb: dwc2: clip max_transfer_size to 65535Paul Zimmerman1-0/+7
Clip max_transfer_size to 65535 for host. dwc2_hc_setup_align_buf() allocates coherent buffers with this size, and if it's too large we can exhaust the coherent DMA pool. Tested on Raspberry Pi and Altera SOCFPGA. Signed-off-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-08usb: dwc2: add 'mode' which based on Kconfig select or dts settingKever Yang1-0/+18
According to the "dr_mode", the otg controller can work as device role and host role. Some boards always want to use host mode and some other boards want to use gadget mode. We use the dts setting to set dwc2's mode, rather than fixing it to whatever hardware says. Signed-off-by: Kever Yang <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Tested-by: Doug Anderson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-09-08usb: dwc2: Read GNPTXFSIZ when in forced HOST mode.Doug Anderson1-3/+3
The documentation for GNPTXFSIZ says that "For host mode, this field is always valid." Since we're already switching to host mode for HPTXFSIZ, let's also read GNPTXFSIZ in host mode. On an rk3288 SoC, without this change we see this at bootup: dwc2 ff580000.usb: gnptxfsiz=00100400 dwc2 ff580000.usb: 128 invalid for host_nperio_tx_fifo_size. Check HW configuration. After this change we see: dwc2 ff580000.usb: gnptxfsiz=04000400 Signed-off-by: Doug Anderson <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-27usb: dwc2: Add function to calculate correct FIFO sizesDinh Nguyen1-0/+68
The dwc2 IP on the SOCFPGA cannot use the default HW configured FIFO sizes. The total FIFO depth as read from GHWCFG3 reports 0x1f80 or 8064 32-bit words. But the GRXFSIZ, GNPTXFSIZ, and HPTXFSIZ register defaults to 0x2000 or 8192 32-bit words. So the driver cannot just use the fifo sizes as read from those registers. For platforms that face the same issue, this commits sets the RX, periodic TX, and non-periodic TX fifo size to those that are recommended v2.93a spec for the DWC2 IP. Implements Method #2 from the Synopsys v2.93a spec for the DWC2. Signed-off-by: Dinh Nguyen <[email protected]> Acked-by: Paul Zimmerman <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-02-04usb: dwc2: fix role switch breakagePaul Zimmerman1-1/+1
Commit beb7e592bc "staging: dwc2: add check on dwc2_core_reset return" broke the B -> A role switching on OTG-enabled platforms. This commit fixes it. Reported-by: Dinh Nguyen <[email protected]> Tested-by: Dinh Nguyen <[email protected]> Signed-off-by: Paul Zimmerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-01-13Move DWC2 driver out of stagingPaul Zimmerman1-0/+2777
The DWC2 driver should now be in good enough shape to move out of staging. I have stress tested it overnight on RPI running mass storage and Ethernet transfers in parallel, and for several days on our proprietary PCI-based platform. Signed-off-by: Paul Zimmerman <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>