summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * usb: musb: fix order of conditions for assigning end point operationsBen Hutchings2015-05-261-7/+7
| | | | | | | | | | | | | | | | | | | | Currently we always assign one of the two common implementations of ep_offset and ep_select operations, overwriting any platform-specific implementations. Fixes: d026e9c76aac ("usb: musb: Change end point selection to use ...") Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: ux500: fix build warningsFelipe Balbi2015-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the following build warnings: drivers/usb/musb/ux500.c:346:12: warning: ‘ux500_suspend’ defined but not used [-Wunused-function] drivers/usb/musb/ux500.c:357:12: warning: ‘ux500_resume’ defined but not used [-Wunused-function] Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: am35x: fix build warningsFelipe Balbi2015-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following build warnings: drivers/usb/musb/am35x.c:573:12: warning: ‘am35x_suspend’ defined but not used [-Wunused-function] drivers/usb/musb/am35x.c:589:12: warning: ‘am35x_resume’ defined but not used [-Wunused-function] drivers/usb/musb/am35x.c:573:12: warning: ‘am35x_suspend’ defined but not used [-Wunused-function] drivers/usb/musb/am35x.c:589:12: warning: ‘am35x_resume’ defined but not used [-Wunused-function] Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Fix platform code being unable to override ep access opsHans de Goede2015-05-261-7/+6
| | | | | | | | | | | | | | | | | | musb-core was setting the ops to the default indexed or flat handlers after checking for platform overrides. Reverse the order of this so that platform overrides actually work. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Do not use musb_read[b|w] / _write[b|w] wrappers in generic fifo ↵Hans de Goede2015-05-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | functions The generic fifo functions already use non wrapped accesses in various cases through the iowrite#_rep functions, and all platforms which override the default musb_read[b|w] / _write[b|w] functions also provide their own fifo access functions, so we can safely drop the unnecessary indirection from the fifo access functions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Make busctl_offset an io-op rather then a defineHans de Goede2015-05-265-48/+68
| | | | | | | | | | | | | | | | | | | | | | The Allwinner (sunxi) implementation of the musb has its busctl registers indexed by the MUSB_INDEX register rather then in a flat address space. This commit turns MUSB_BUSCTL_OFFSET from a macro into an io-op which can be overridden from the platform ops. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Make musb_write_rxfun* and musb_write_rxhub* work like their tx ↵Hans de Goede2015-05-264-35/+21
| | | | | | | | | | | | | | | | | | | | | | | | versions For some reason the musb_write_rxfun* and musb_write_rxhub* functions had a different function prototype and some extra magic needed on the caller side compared to their tx counterparts, this commit makes them work the same as their tx counterparts. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Add pre and post root port reset end callbacksHans de Goede2015-05-262-0/+18
| | | | | | | | | | | | | | | | | | | | | | The sunxi otg phy has a bug where it wrongly detects a high speed squelch when reset on the root port gets de-asserted with a lo-speed device. The workaround for this is to disable squelch detect before de-asserting reset, and re-enabling it after the reset de-assert is done. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: add softconnect for host modeBin Liu2015-05-071-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a debugfs interface - softconnect - for host mode to connect/disconnect the devices without physically remove the them. This adds the capability to re-enumerate the devices which are permanently mounted on the board with the MUSB controller together. Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part5Tony Lindgren2015-05-071-114/+140
| | | | | | | | | | | | | | | | Remove ifdefs for musb_host_rx to get closer to building in all the DMA drivers. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part4Tony Lindgren2015-05-071-4/+2
| | | | | | | | | | | | | | | | Remove ifdefs for musb_host_rx to get closer to building in all the DMA drivers. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part3Tony Lindgren2015-05-071-50/+74
| | | | | | | | | | | | | | | | Remove ifdefs for musb_host_rx to get closer to building in all the DMA drivers. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part2Tony Lindgren2015-05-071-4/+3
| | | | | | | | | | | | | | | | Remove ifdefs for musb_host_rx to get closer to building in all the DMA drivers. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part1Tony Lindgren2015-05-071-17/+44
| | | | | | | | | | | | | | | | Remove ifdefs for musb_host_rx to get closer to building in all the DMA drivers. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove ifdefs for TX DMA for musb_host.cTony Lindgren2015-05-071-13/+48
| | | | | | | | | | | | | | | | | | | | | | We can remove the ifdefs by setting up helper functions for mentor DMA and cppi/tusb DMA. Note that I've kept the existing formatting as otherwise this patch becomes pretty much unreadable. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Remove DMA ifdef for musb_gadget.c short_packetTony Lindgren2015-05-071-6/+10
| | | | | | | | | | | | | | | | | | Let's get rid of the horrible ifdef in middle of the expression. We can do it by adding a variable for short_packet and testing it separately for DMA related code. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Get rid of the DMA ifdefs for musb_core.cTony Lindgren2015-05-071-2/+0
| | | | | | | | | | | | | | | | | | For musb_core.c we can now just drop the DMA related ifdef and use the already existing runtime test for !is_cppi_enabled(musb) instead. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Set up function pointers for DMATony Lindgren2015-05-0717-23/+118
| | | | | | | | | | | | | | | | Set up function pointers for DMA so get closer to being able to build in all the DMA engines. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: Fix up DMA related macrosTony Lindgren2015-05-0714-29/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass struct musb to tusb_dma_omap() and is_cppi_enabled(), and add macros for the other DMA controllers. Populate the platform specific quirks with the DMA type and use it during runtime. Note that platform glue layers with no custom DMA code are tagged with MUSB_DMA_INVENTRA which may have a chance of working. Looks like the defconfigs for these use PIO_ONLY, so this should not break existing configs. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: only set test mode onceBin Liu2015-04-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | The MUSB test mode register can only be set once, otherwise the result is undefined. This prevents the debugfs testmode entry to set the register more than once which causes test failure. Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: fix inefficient copy of unaligned buffersJohan Hovold2015-04-271-2/+7
|/ | | | | | | | | Make sure only to copy any actual data rather than the whole buffer, when releasing the temporary buffer used for unaligned non-isochronous transfers. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'usb-for-v4.1-part2' of ↵Greg Kroah-Hartman2015-04-102-4/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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: musb: use new USB_RESUME_TIMEOUTFelipe Balbi2015-04-072-4/+5
| | | | | | | | | | | | | | | | | | | | | | Make sure we're using the new macro, so our resume signaling will always pass certification. Based on original work by Bin Liu <Bin Liu <b-liu@ti.com>> Cc: Bin Liu <b-liu@ti.com> Cc: <stable@vger.kernel.org> # v3.10+ Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: musb: dsps: fix build on i386 when COMPILE_TEST is setTony Lindgren2015-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3e457371f436 ("usb: musb: Fix fifo reads for dm816x with musb_dsps") fixed a USB error on dm816x, but introduced a new build error on i386 when COMPILE_TEST is set: drivers/usb/musb/musb_dsps.c: In function ‘dsps_read_fifo32’: drivers/usb/musb/musb_dsps.c:624:3: error: implicit declaration of function ‘readsl’ [-Werror=implicit-function-declaration] readsl(fifo, dst, len >> 2); Let's fix this by using ioread32_rep() instead of readsl() as that's more portable. Fixes: 3e457371f436 ("usb: musb: Fix fifo reads for dm816x with musb_dsps") Reported-by: Fengguang Wu <fengguang.wu@intel.com> Cc: Bin Liu <binmlist@gmail.com> Cc: Brian Hutchinson <b.hutchman@gmail.com> Cc: George Cherian <george.cherian@ti.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | musb_virthub: 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-245-256/+201
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: musb: Fix fifo reads for dm816x with musb_dspsTony Lindgren2015-03-241-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like dm81xx can only do 32-bit fifo reads like am35x. Let's set up musb-dsps with a custom read_fifo function based on the compatible flag. Otherwise we can get the following errors when starting dhclient on a asix USB Ethernet adapter: asix 2-1:1.0 eth2: asix_rx_fixup() Bad Header Length 0xffff003c, offset 4 While at it, let's also remove pointless cast of the driver data. Cc: Bin Liu <binmlist@gmail.com> Cc: Brian Hutchinson <b.hutchman@gmail.com> Cc: George Cherian <george.cherian@ti.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: cppi41: fix condition to call cppi41_trans_done().Takeyoshi Kikuchi2015-03-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connect AR9271(USB wifi) to AM335x, and send a flood ping from Mac OSX, AR9271 is stopped. on USB bus, the following occurs. - OUT transaction is ACKed (NYET). - IN transaction is ACKed (512bytes). - PING-NAK transaction is continued for about 2 seconds (AR9271 timeout?). In current imprementation, IN-transaction is not completed because it checks the empty of TX-FIFO in cppi41_dma_callback(). As a result, communication to AR9271 stops. This patch modified to check the empty of TX-FIFO only when OUT-transaction. Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: don't fake of_node to musb coreFelipe Balbi2015-03-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we pass our own of_node to musb_core, at least pinctrl settings will be duplicated, meaning that pinctrl framework will try to select default pin state for musb_core when they were already requested by musb-dsps. A Warning will be printed however things will still work. Reported-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: request phy using our device pointerFelipe Balbi2015-03-111-1/+1
| | | | | | | | | | | | | | musb shouldn't have of_node and phy phandle is passed to dsps device, not musb's. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: just start polling alreadyFelipe Balbi2015-03-101-3/+2
| | | | | | | | | | | | | | there's no need to fake an IRQ, just check if VBUS is valid already. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: use msecs_to_jiffies insteadFelipe Balbi2015-03-101-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | when polling, we were using n * HZ (where n is an integer in seconds), however HZ isn't always correct if we're using cpufreq. A better way is to use msecs_to_jiffies(n) (where n is now an integer in miliseconds). while at that, also rename poll_seconds to poll_timeout and change its type to unsigned int. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: cppi41: do not call udelay()Felipe Balbi2015-03-101-1/+1
| | | | | | | | | | | | | | | | | | according to comment in code, HS completion will happen pretty fast, instead of using udelay(), let's just busy loop and drop a cpu_relax() where udelay() was. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: cppi41: exit early when tx fifo is emptyFelipe Balbi2015-03-101-8/+4
| | | | | | | | | | | | | | | | | | as soon as we find out tx fifo is empty, there's no need to break out of the loop just to have another branch to complete the transfer. We can just complete transfer and exit early. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: cppi41: decrease indentation levelFelipe Balbi2015-03-101-43/+45
| | | | | | | | | | | | no functional changes, clean up only. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: always try to recover from babbleFelipe Balbi2015-03-101-16/+6
| | | | | | | | | | | | | | | | | | | | | | we can also have babble conditions with LS/FS and we also want to recover in that case. Because of that we will drop the check of HSMODE and always try to run babble recovery. Suggested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: disable irqs inside babble recoveryFelipe Balbi2015-03-101-4/+3
| | | | | | | | | | | | | | | | | | | | There's no point is splitting those anymore. We're now also able to drop another forward declaration. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: remove unnecessary forward declarationFelipe Balbi2015-03-101-1/+0
| | | | | | | | | | | | | | no functional changes, cleanup only. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: drop recover_workFelipe Balbi2015-03-102-9/+9
| | | | | | | | | | | | | | | | | | that's not needed anymore. Everything that we call is irq-safe, so we might as well not have a delayed work for babble recovery. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: rename ->reset() to ->recover()Felipe Balbi2015-03-103-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | recover is a much better name than reset, considering we don't really reset the IP, just run platform-specific babble recovery algorithm. while at that, also fix a typo in comment and add kdoc for recover memeber of platform_ops. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: simplify musb_recover_work()Felipe Balbi2015-03-101-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | we're not resetting musb at all, just restarting the session. This means we don't need to touch PHYs or VBUS or anything like that. Just make sure session bit is reenabled after MUSB dropped it. while at that, make sure to tell usbcore that we're dropping the session and, thus, disconnecting the device. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: do not reset musb on babbleFelipe Balbi2015-03-101-21/+2
| | | | | | | | | | | | | | | | | | | | | | All we have to do is, really, drop session bit and let the session restart. Big thanks goes to Bin Liu <b-liu@ti.com> for inspiring this work. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: decrease delayed_work timeFelipe Balbi2015-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | When babble IRQ happens, we need to wait only 5.3us (320 cycles of 60MHz clock), we will give it some slack and schedule our work a 10 usecs into the future. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: don't touch devctl from babble recoveryFelipe Balbi2015-03-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | We do *not* want to touch devctl at all when trying to recover from babble. All we want to do is mask IRQs until we're done without our babble recovery, at which point we will unmask IRQs. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: refactor IRQ enable/disable to separate functionsFelipe Balbi2015-03-101-11/+26
| | | | | | | | | | | | | | | | | | | | sometimes we want to just mask/unmask interrupts without touching devctl register. For those cases, let's introduce musb_enable_interrupts and musb_disable_interrupts() Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: add dsps_ prefix to sw_babble_controlFelipe Balbi2015-03-101-2/+2
| | | | | | | | | | | | | | | | this makes it easier to filter function traces. No functional changes. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: controller drops session automaticallyFelipe Balbi2015-03-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever babble happens, MUSB controller will drop session automatically. The only case where it won't drop the session, is when we're running on AM335x and SW_SESSION_CTRL bit has been set. In that case, controller will not touch session bit so SW has a chance to recover from babble condition. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: check for the single bitFelipe Balbi2015-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | We want to check if that particular bit is set. It could very well be that bootloader (or romcode) has fiddled with MUSB before us which could leave other bits set in this register. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: dsps: remove babble check from dsps irq handlerFelipe Balbi2015-03-102-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | musb->int_usb already contains the correct information for musb-core to handle babble. In fact, this very check was just causing a nonsensical babble interrupt storm. With this I can get test.sh to run and, even though all tests fail with timeout, that's still better than locking up the system due to IRQ storm. Also, if I remove g_zero and load g_mass_storage, then everything works fine again. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: musb: core: there is no connect interrupt in peripheral modeFelipe Balbi2015-03-101-4/+0
| | | | | | | | | | | | | | | | MUSB does not generate a connect IRQ when working in peripheral mode. Tested-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>