summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-09-09usb: dwc3: gadget: fix GCTL programmingFelipe Balbi
ensure a few bits are cleared before enabling what we need. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: define ScaleDown macro helperFelipe Balbi
We must ensure that those bits aren't set as they should only be used in simulation. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: Fix definition of DWC3_GCTL_U2RSTECNFelipe Balbi
that should be 1 << 16, not 16. Caused so many problems and we never caught it before. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: do not map/unmap ZLP transfersSebastian Andrzej Siewior
If the gadget drivers sends a ZLP we are trying to map this this request which does not work on all implementations. So we simply skip mapping it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: fix IRQ handlingFelipe Balbi
In order to ACK the IRQ we must write back to the same register the bits we read. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: change IRQ name to dwc3-omapFelipe Balbi
dwc3-wrapper can be used by any other wrapper, using dwc3-omap makes it clear that we're running on OMAP SoC. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: add module.h to dwc3-omap.c and core.cFelipe Balbi
We need that header because of THIS_MODULE. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: distinguish between SW and HW modesFelipe Balbi
The OMAP wrapper allows us to either control internal OTG signals via SW or HW. Different boards might wish to use one or the other mode of operation. Let's have have that information passed via platform_data for now. After DT conversion is finished for OMAP, we can easily convert this to a DT attribute. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: drop DEV_PM_OPS for nowFelipe Balbi
We need to have actual HW in order to implement and test that part of the code anyway. Until then it's best to remove it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: use the macro we already haveFelipe Balbi
trivial patch, no functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: do not enable DMA Disable Clear IRQFelipe Balbi
Otherwise that IRQ will trigger forever. It's quite unnecessary. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: omap: fix dev_dbg() callsFelipe Balbi
dev_dbg() macro expects a device pointer as argument, not a memory base address. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: use ep0_next_event fieldFelipe Balbi
Start tracking the next expected event and act on the error conditions as suggested by databook. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: core: add ep0_next_event fieldFelipe Balbi
this field will hold the next expected event. In certain cases, host might fall into some error condition and ask from us the wrong Control phase. On such situations, we should stall and restart. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: drop EP0_STALL stateFelipe Balbi
Whenever we issue a Set Stall command on EP0, the state machine will be restarted and Stall is cleared automatically, when core receives the next SETUP packet. There's no need to track that EP0_STALL state. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: clear all EP0 flagsFelipe Balbi
when we're going to issue Set Stall command, we should clear DWC3_EP_STALL flag, but also we should clear BUSY, HALTED and all others. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: fix Get Status handlingFelipe Balbi
data was prepared on setup_buf but transfer was started on ctrl_req, fix it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: replace mdelay with udelay in the busy loopSebastian Andrzej Siewior
There are two spots where we wait until the HW finishes processing a certain command. Initially we had a few problems and we used 500ms as a limit to be on a the safe side. Paul Zimmerman mentioned this is little too much. After a debugging session, we noticed that we hardly ever go over 20us and didn't pass 30usec so far. Using mdelay() seems way overloaded. Giving the current numbers 500usec as the upper limit is more than enough. Should it ever timeout then something is definitely wrong. While here, also replace the type with u32 since long does not really fit here. Cc: Paul Zimmerman <paul.zimmerman@synopsys.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: rework the dequeue on RESET & DISCONNECTSebastian Andrzej Siewior
- since a while we are disabling an endpoint and purging every requests on RESET and DISCONNECT which leads to a warning since the endpoint was disabled twice (once by the UDC, and second time by the gadget). I think UDC should nuke all requests because all those requests become invalid. It's gadget driver's responsability, though, to disable its used endpoints. This is done by merging dwc3_stop_active_transfer() and dwc3_gadget_nuke_reqs() into dwc3_remove_requests(). - dwc3_stop_active_transfer() is now no longer called unconditionaly. This has the advantage that it is always called to disable an active transfer which means if res_trans_idx 0 than something went wrong and it is an error condition because we can't clean up the requests. - Remove the DWC3_EP_WILL_SHUTDOWN which was introduced while introducing the command complete part for dequeue. All requests on req_queued list should be removed during the dwc3_cleanup_done_reqs() callback so there is no reason to go through the list again. We consider it an error condition if requests are still on this list since we never queue TRB without LST=1 (the last requests has always LST=1, there are no requests with LST=0 behind it). [ balbi@ti.com : reworked commit log a bit, made patch apply ] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: core: move the core check before soft resetSebastian Andrzej Siewior
We read the DWC3_GSNPSID register to make sure we got the correct register offset passed. One of the recent commits moved the soft reset before this so in case of the wrong offset we end up with "reset timed out". This patch moves the "id" check before the reset again. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: debugfs: remove test mode interfaceSebastian Andrzej Siewior
There are some issues around for enabling/disabling this mode and handling it. It does not work perfectly (yet). However we have a few gadgets tested successfuly so far. That means we are quite confident that we won't need this in near future. So I'm for removing it and bringing a working version back once there is a need for it. Thanks to Dan Carpenter who spotted the wrong memory handling here. [ balbi@ti.com : made it actually apply ] Cc: Dan Carpenter <error27@gmail.com> Cc: wharms@bfs.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: simplify EP0 state machineFelipe Balbi
The DesignWare USB3 core tells us which phase of a control transfer should be started, it also tells us which physical endpoint needs that transfer. With these two informations, we have all we need to simply EP0 handling quite a lot and get rid rid of the SW state machine tracking ep0 states. For achieving this perfectly, we needed to add support for situations where we get XferNotReady while endpoint is still busy and XferNotReady while gadget driver still hasn't queued a request. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: core: add flag for EP0 directionFelipe Balbi
Add a flag to keep track of ep0 direction. This flag will be used on a following patch. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: add handling for unaligned OUT transfersFelipe Balbi
In case we have transfers which aren't aligned to wMaxPacketSize, we need to be careful with how we start the transfer with the HW. OUT transfers _must_ be aligned with wMaxPacketSize and in order to guarantee that, we use a bounce buffer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: add a bounce buffer for control endpointsFelipe Balbi
This core cannot handle OUT transfers which aren't aligned to wMaxPacketSize, but that can happen at least on control endpoint with the USB Audio Class. This patch adds a bounce buffer to be used on the case of a non-aligned ep0out request is queued. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: core: add defines for XferNotReady event on Control EPsFelipe Balbi
The status field of the Transfer Not Read event is different on Control Endpoints. On this patch we are just adding the defines to be used on a later patch which will re-work the control endpoint handling. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: improve command completion debug messageFelipe Balbi
the previous message had too little meaning. Make it more human readable and use the macro we already had for extracting the command completion status out of DEPCMDn register. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: set request dma to invalid when unmappingFelipe Balbi
if we don't set DMA address to invalid when unmapping, we might fall in a situation where request buffer can't be mapped to DMA again. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: fix 'transfered' typoFelipe Balbi
trivial patch. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: core: add missing @ for kerneldocFelipe Balbi
trivial patch, no functional changes Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()Dan Carpenter
We may as well fix this potential leak so we don't have to listen to the static checkers complain. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bitSebastian Andrzej Siewior
Without this patch we won't clear that bit and instead will clear all other bits on our endpoint flag. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: use TRB type 6 for ISOC transfersSebastian Andrzej Siewior
Type 6 should be used for the first transfer during an interval. This is also what the reference driver is using. Type 7 seems to be for following or additional transfers within the same interval. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: reset resource index to zeroSebastian Andrzej Siewior
If we collected two requests together (i.e. only the last of them has LST=1) then we only have to stop transfer once: The clean-up code will cleanup everything until first TRB with the LST bit set. After XferComplete this index should be no longer valid since there is no transfer pending. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: gadget: fixing dequeue of TRBsSebastian Andrzej Siewior
A TRB which is dequeued seems to have its HWO bits set to 1. Therefore we ignore it if we dequeue it after the command is completed. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-08-26USB: pl2303: remove unreachable codeMichał Sroczyński
Signed-off-by: Michal Sroczynski <msroczyn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24ums_realtek: do not use stack memory for DMAAdam Cozzette
This patch changes rts51x_read_mem, rts51x_write_mem, and rts51x_read_status to allocate temporary buffers with kmalloc. This way stack addresses are not used for DMA when these functions call rts51x_bulk_transport. Signed-off-by: Adam Cozzette <acozzette@cs.hmc.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24USB host i.MX21: remove dependency on MACH_MX21Sascha Hauer
the MACH_MX* macros are scheduled for removal, so just depend on ARCH_MXC instead. The Kconfig text makes it clear on which SoC the driver runs on. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24USB gadget i.MX1: remove dependency on ARCH_MXCSascha Hauer
The ARCH_MX1 scheduled for removal. Instead, depend on ARCH_MXC and make clear in the Kconfig text that only i.MX1 has this hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24usb: fix ipw.c build error, select USB_SERIAL_WWANRandy Dunlap
USB_SERIAL_IPW needs to select USB_SERIAL_WWAN to fix build errors: ipw.c:(.text+0x333841): undefined reference to `usb_wwan_close' ipw.c:(.text+0x3339e6): undefined reference to `usb_wwan_open' ipw.c:(.text+0x333bb9): undefined reference to `usb_wwan_release' drivers/built-in.o:(.data+0x29dac): undefined reference to `usb_wwan_startup' drivers/built-in.o:(.data+0x29db4): undefined reference to `usb_wwan_disconnect' drivers/built-in.o:(.data+0x29dd4): undefined reference to `usb_wwan_write' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24usb: fix dwc3 build when USB_GADGET_DWC3 is not enabledRandy Dunlap
Fix build error when CONFIG_USB_GADGET_DWC3 is not enabled: ERROR: "dwc3_send_gadget_ep_cmd" [drivers/usb/dwc3/dwc3.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23USB: use usb_endpoint_maxp() instead of le16_to_cpu()Kuninori Morimoto
Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size instead of le16_to_cpu(desc->wMaxPacketSize). This patch fix it up Cc: Armin Fuerst <fuerst@in.tum.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: Johannes Erdfelt <johannes@erdfelt.com> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Oliver Neukum <oliver@neukum.name> Cc: David Kubicek <dave@awk.cz> Cc: Johan Hovold <jhovold@gmail.com> Cc: Brad Hards <bhards@bigpond.net.au> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de> Cc: David Brownell <david-b@pacbell.net> Cc: David Lopo <dlopo@chipidea.mips.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Xie Xiaobo <X.Xie@freescale.com> Cc: Li Yang <leoli@freescale.com> Cc: Jiang Bo <tanya.jiang@freescale.com> Cc: Yuan-hsin Chen <yhchen@faraday-tech.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Xiaochen Shen <xiaochen.shen@intel.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Ben Dooks <ben@simtec.co.uk> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Herbert Pötzl <herbert@13thfloor.at> Cc: Arnaud Patard <arnaud.patard@rtp-net.org> Cc: Roman Weissgaerber <weissg@vienna.at> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Tony Olech <tony.olech@elandigitalsystems.com> Cc: Florian Floe Echtler <echtler@fs.tum.de> Cc: Christian Lucht <lucht@codemercs.com> Cc: Juergen Stuber <starblue@sourceforge.net> Cc: Georges Toth <g.toth@e-biz.lu> Cc: Bill Ryder <bryder@sgi.com> Cc: Kuba Ober <kuba@mareimbrium.org> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23usb: include module.h in the DesignWare USB3 DRD driverStephen Rothwell
Fixes this build error: drivers/usb/dwc3/dwc3-pci.c: In function 'dwc3_pci_init': drivers/usb/dwc3/dwc3-pci.c:211:9: error: 'THIS_MODULE' undeclared (first use in this function) Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfersSebastian Andrzej Siewior
Executing | testusb -a -c 1 -t 3 -v 421 -s 2048 does not complete on the gadget side. g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is done with sending data but the gadget waits for more. Since the protocol does not include transfer-length-field sending a terminating zero packet seems the only way out. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23usb: fhci-hcd: Allocate pram dynamically.Joakim Tjernlund
MPC832x does not have enough MURAM to do fixed MURAM allocation. Change to dynamic allocation. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23usb/isp1760: Clear TT buffer on interrupted low & full speed transfersArvid Brodin
When a low or full speed urb in progress is unlinked (or some other error occurs), the buffer in the transaction translator (part of the hub) might end up in an inconsistent state. This can make all further low and full speed transactions fail, unless the buffer is cleared. The bug can be seen when running the usbtest unlink tests as "set altsetting to 0 failed, -110", and gets fixed by this patch. Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-22drivers/usb/host/ohci-omap3.c: test the just-initialized valueJulia Lawall
Test the just-initialized value rather than some other one. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST}; statement S; @@ x = f(...); ( if (\(x == NULL\|IS_ERR(x)\)) S | *if (\(y == NULL\|IS_ERR(y)\)) { ... when != x return ...; } ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-22USB: otg: remove unused function twl6030_set_phy_clkWanlong Gao
Remove the unused function twl6030_set_phy_clk of twl6030-usb.c. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-22s3c-hsudc: Add basic otg transceiver handlingHeiko Stübner
Makes it possible to use i.e. gpio-vbus to handle vbus events. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-22s3c-hsudc: Fix possible nullpointer dereference during probeHeiko Stübner
The usb-interrupt is requested before the endpoints are initalised. If an interrupt happens in the time between request_irq and the init of the endpoint-data (as seen on the Qisda ESx00 ebook-platforms), it is therefore possible for the interrupt handler to access endpoint- data before its creation resulting in a null-pointer dereference. This patch simply moves the irq request below the endpoint init. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>