1. 17 Oct, 2013 10 commits
    • Sachin Kamat's avatar
      usb: phy: twl6030-usb: Include linux/of.h header · 80d7d8a7
      Sachin Kamat authored
      'of_match_ptr' is defined in linux/of.h. Include it explicitly to
      avoid build breakage in the future.
      Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      80d7d8a7
    • Sebastian Andrzej Siewior's avatar
      usb: musb: cppi41: allow to defer probing if DMA isn't yet available · 48054147
      Sebastian Andrzej Siewior authored
      If everything (musb, cppi41, phy) is built-in then musb will start
      without the dma engine printing only
      
      |musb-hdrc musb-hdrc.0.auto: Falied to request rx1.
      
      The reason for this is that the musb device structs are created & probed
      before those of the cppi41 device. So the cppi41 device is probed too
      late.
      As a workaround for this allow the musb_cppi41 part to defer the probe
      if everything is fine except for the missing DMA controller. In case of
      another error we continue.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      48054147
    • Sebastian Andrzej Siewior's avatar
      usb: musb: core: Call dma_controller_destroy() in error path only once. · 8d1aad74
      Sebastian Andrzej Siewior authored
      In commit f3ce4d5b ("usb: musb: core: call dma_controller_destroy() in the err path")
      I erroneously assumed that the dma controller is not removed in the
      error patch. This was wrong because it happens later via musb_free().
      That means the original commit can be reverted because it is wrong or we
      do this, so it is more obvious.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      8d1aad74
    • Sebastian Andrzej Siewior's avatar
      usb: musb: core: properly free host / device structs in err path · 0d2dd7ea
      Sebastian Andrzej Siewior authored
      The patch fixes two issues in the error path cleanup:
      - in MUSB_PORT_MODE_DUAL_ROLE mode, if musb_gadget_setup() fails we
        never cleanup the host struct earlier allocated.
      - if musb_init_debugfs() or sysfs_create_group() fails, then we never
        free the host part initialization, only device part.
      
      Cc: stable@vger.kernel.org # v3.11
      Cc: Daniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      0d2dd7ea
    • Andrzej Pietrasiewicz's avatar
      usb: gadget: f_mass_storage: style corrections, cleanup & simplification · 5bb7289d
      Andrzej Pietrasiewicz authored
      Fix spacing, improve error code returned, remove unused #define,
      use strtobool() instead of kstrtou8().
      Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5bb7289d
    • Sebastian Andrzej Siewior's avatar
      usb: musb: dsps: run the timer only on OTG systems · 24616eb6
      Sebastian Andrzej Siewior authored
      I introduced this check here because it looked wrong in HOST only
      configurions. The timer would remove that session bit and will never
      come back and so there would not be another session.
      Now that I played with OTG for a while I belive this workaround is
      only required for the OTG mode because we have to end the session and
      then we have to try to start manually.
      Therefore, this patch limits this timer to the OTG only port mode so we
      don't need to poll around in device only mode.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      24616eb6
    • Sebastian Andrzej Siewior's avatar
      usb: musb: dsps: redo the otg timer · 0f901c98
      Sebastian Andrzej Siewior authored
      According to the comments, we rely on the OTG timer because the core
      does not expose some important OTG details. So far this is all I
      know. After playing with OTG I stumbled over a problem:
      musb is recognized as a B-device without a problem. Whenever a cable is
      plugged, the VBUS rises, musb recognizes this as a starting session,
      sets the MUSB_DEVCTL_SESSION bit by itself and a RESET interrupt occurs,
      the session starts. Good.
      After a disconnect, the timer is started and re-starts itself because
      it remains in B_IDLE with the BDEVICE set. I didn't figure the the
      reason or the need for it. Nothing changes here except for OTG state
      from B to A device if the BDEVICE bit disappears. This doesn't make much
      sense to me because nothing happens after this. _IF_ we receive an
      interrupt before the state change then we may act on wrong condition.
      Plugging a B-device (and letting MUSB act as host) doesn't work here.
      The reason seems to be that the MUSB tries to start a session, it fails
      and then it removes the bit. So we never start as a host.
      
      This patch sets the MUSB_DEVCTL_SESSION bit in the IDLE state so musb
      can try to establish a session as host. After the bit is set, musb tries
      to start a session and if it fails it clears the bit. Therefore it will
      try over and over again until a session either as host or as device is
      established.
      
      The readout of the MUSB_DEVCTL register after the removal the
      MUSB_DEVCTL_SESSION (in A_WAIT_BCON) has been removed because it did not
      contain the BDEVICE bit set (in the second read) leading to A_IDLE. After
      plugging a host musb assumed that it is also a host and complained about
      a missing reset. However a third read of the register has has the BDEVICE
      bit set so it seems that it is not stable.
      This mostly what da8xx.c is doing except that we set the timer also
      after A_WAIT_BCON so the session bit can be triggered.
      
      Whit this change I was able to keep am335x-evm in OTG mode and plug in
      either a HOST or a DEVICE and in a random order and the device was
      recognized.
      
      Cc: stable@vger.kernel.org # v3.11
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      0f901c98
    • Sebastian Andrzej Siewior's avatar
      usb: musb: dsps: remove declartion for dsps_musb_try_idle() · 807d0d2b
      Sebastian Andrzej Siewior authored
      This patch moves dsps_musb_try_idle() before dsps_musb_enable() so the
      declaration (of dsps_musb_try_idle() can be removed.
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      807d0d2b
    • Sebastian Andrzej Siewior's avatar
      usb: musb: dsps: move try_idle to start hook · 8b9fcce2
      Sebastian Andrzej Siewior authored
      The timer is initialized right after musb is probed. There is actually
      no need to have this timer running because _nothing_ will happen until
      we have the gadget loaded. Also we need this timer only if we run in OTG
      mode _and_ we need it also after the gadget has been replaced with
      another one.
      
      I've been looking at am35x.c, da8xx.c, omap2430.c, tusb6010.c. da8xx
      seem to have the same problem as dsps and doing mostly the same thing.
      tusb6010 seem to do something different and do some actual "idle / power
      saving" work so I am not too comfortable to remove
      musb_platform_try_idle() from musb_gadget_setup().
      
      Therefore this patch does not start the timer if there is no gadget
      active (which is at musb_gadget_setup() at time). In order to have the
      timer active after the gadget is loaded it will be triggered from
      dsps_musb_enable().
      
      Cc: stable@vger.kernel.org # v3.11
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      8b9fcce2
    • Sebastian Andrzej Siewior's avatar
      usb: musb: call musb_start() only once in OTG mode · ae44df2e
      Sebastian Andrzej Siewior authored
      In commit 001dd84a ("usb: musb: start musb on the udc side, too") it was
      ensured that the state engine is started also in OTG mode after a
      removal / insertion of the gadget.
      Unfortunately this change also introduced a bug: If the device is
      configured as OTG and it connected with a remote host _without_ loading
      a gadget then we bug() later (because musb->otg->gadget is not
      initialized).
      Initially I assumed it might be nice to have the host part of musb in
      OTG mode working without having a gadget loaded. This bug and fact that
      it wasn't working like this before the host/gadget split made me realize
      that this was a silly idea.
      This patch now introduces back the old behavior where in OTG mode the
      host mode is only working after the gadget has been loaded.
      
      Cc: stable@vger.kernel.org # v3.11
      Cc: Daniel Mack <zonque@gmail.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      ae44df2e
  2. 15 Oct, 2013 10 commits
  3. 11 Oct, 2013 6 commits
  4. 10 Oct, 2013 14 commits