1. 16 7月, 2014 1 次提交
  2. 01 7月, 2014 2 次提交
  3. 22 4月, 2014 3 次提交
  4. 16 4月, 2014 1 次提交
    • D
      usb: musb: dsps: move debugfs_remove_recursive() · 0fca91b8
      Daniel Mack 提交于
      When the platform initialization fails due to missing resources, it will
      return -EPROBE_DEFER after dsps_musb_init() has been called.
      
      dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs
      nodes. At a later point in time, the probe will be retried, and
      dsps_musb_dbg_init() will be called again. debugfs_create_dir() will
      fail this time, as the node already exists, and so the entire device
      probe will fail with -ENOMEM.
      
      Fix this by moving debugfs_remove_recursive() from dsps_remove() to the
      plaform's exit function, so it will be cleanly torn down when the probe
      fails. It also feels more natural this way, as .exit is the counterpart
      to .init.
      Signed-off-by: NDaniel Mack <zonque@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0fca91b8
  5. 20 2月, 2014 1 次提交
  6. 19 2月, 2014 1 次提交
  7. 09 1月, 2014 1 次提交
  8. 27 11月, 2013 4 次提交
  9. 17 10月, 2013 4 次提交
    • S
      usb: musb: dsps: run the timer only on OTG systems · 24616eb6
      Sebastian Andrzej Siewior 提交于
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      24616eb6
    • S
      usb: musb: dsps: redo the otg timer · 0f901c98
      Sebastian Andrzej Siewior 提交于
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0f901c98
    • S
      usb: musb: dsps: remove declartion for dsps_musb_try_idle() · 807d0d2b
      Sebastian Andrzej Siewior 提交于
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      807d0d2b
    • S
      usb: musb: dsps: move try_idle to start hook · 8b9fcce2
      Sebastian Andrzej Siewior 提交于
      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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8b9fcce2
  10. 12 10月, 2013 1 次提交
  11. 01 10月, 2013 2 次提交
    • S
      usb: musb_dsps: Remove redundant of_match_ptr · b432cb83
      Sachin Kamat 提交于
      The data structure of_match_ptr() protects is always compiled in.
      Hence of_match_ptr() is not needed.
      Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
      Cc: Ravi B <ravibabu@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      b432cb83
    • S
      usb: musb: dsps: do not bind to "musb-hdrc" · 4fc4b274
      Sebastian Andrzej Siewior 提交于
      This went unnoticed in durin the merge window:
      The dsps driver creates a child device for the musb core driver _and_
      attaches the of_node to it so devm_usb_get_phy_by_phandle() grabs the
      correct phy and attaches the devm resources to the proper device. We
      could also use the parent device but then devm would attach the
      resource to the wrong device and it would be destroyed once the parent
      device is gone - not the device that is used by the musb core driver.
      
      If the phy is now not available then dsps_musb_init() /
      devm_usb_get_phy_by_phandle() returns with EPROBE_DEFER. Since the
      of_node is attached it tries OF drivers as well and matches the driver
      against DSPS. That one creates a new child device for the musb core
      driver which gets probed immediately.
      
      The whole thing repeats itself until the stack overflows.
      
      I belive the same problem exists in ux500 glue code (since 313bdb11
      ("usb: musb: ux500: add device tree probing support") but the drivers are
      now probed in the right order so they don't see it.
      
      The problem is that the dsps driver gets bound to the musb-child device
      due to the same of_node / matching binding. I don't really agree with
      having yet another child node in DT to fix this. Ideally we would have
      musb core driver with DT bindings and according to the binding we would
      select the few extra hacks / gleue layer.
      
      Therefore I suggest the driver to reject the musb-core device.
      
      Cc: Lee Jones <lee.jones@linaro.org>
      Tested-by: NTom Rini <trini@ti.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4fc4b274
  12. 28 8月, 2013 4 次提交
    • S
      usb: musb: am335x-evm: Do not remove the session bit HOST-only mode · 781f1798
      Sebastian Andrzej Siewior 提交于
      This is what I observe:
      On the first connect, the musb starts with DEVCTL.Session set. On
      disconnect, musb_core calls try_idle. That functions removes the Session
      bit signalizing that the session is over (something that only in OTG is
      required). A new device, that is plugged, is no longer recognized.
      I've setup a timer and checked the DEVCTL register and I haven't seen a
      change in VBus and I saw the B-Device bit set. After setting the IDDIG
      into A mode and forcing the device to behave like a A device, I didn't
      see a change.
      Neither VBUS goes to 0b11 nor does a session start request comes.
      In the TI-v3.2 kernel they skip to call musb_platform_try_idle() in the
      OTG_STATE_A_WAIT_BCON state while not in OTG mode.
      Since the second port hast a standard A plug the patch changes the port
      to run in host mode only and skips the timer which would remove
      DEVCTL.Session so we can reconnect to another device later.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      781f1798
    • S
      usb: musb: dsps: do not set is_active on the first drvbus interrupt · 9dfa3621
      Sebastian Andrzej Siewior 提交于
      Quite early on init there is an vbus / drvvbus interrupt comming and the
      dsps code sets is_active to one. As a result we see a lot of
      
      |musb_bus_suspend 2459: trying to suspend as a_wait_bcon while active
      
      until a device is plugged in with pm_runtime enabled in the kernel.
      After checking davinci, am35, da8xx I noticed that dsps is actually the
      only one doing this.
      So remove it and we won't flooded with mesages and the idle port can be
      suspended.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9dfa3621
    • S
      usb: usb: dsps: update code according to the binding document · c031a7d4
      Sebastian Andrzej Siewior 提交于
      This relfects the code and dts requires changes due to recent .dts
      binding updates:
      - use mg prefix for the Metor Graphics specific attributes
      - use power in mA not in mA/2 as specifed in the USB2.0 specification
      - remove the child node for USB. This is driver specific on won't be
        reflected in the device tree
      - use the "mentor" prefix instead of "mg".
      - use "dr_mode" istead of "mg,port-mode" for the port mode. The former
        is used by a few other drivers.
      
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: devicetree@vger.kernel.org
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c031a7d4
    • J
      usb: musb: dsps: fix devm_ioremap_resource error detection code · 51ef74f6
      Julia Lawall 提交于
      devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
      Furthermore, the value returned by devm_ioremap_resource should be tested.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression e,e1;
      statement S;
      @@
      
      *e = devm_ioremap_resource(...);
      if (!e1) S
      
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      51ef74f6
  13. 09 8月, 2013 3 次提交
    • S
      usb: musb: dsps: use proper child nodes · 97238b35
      Sebastian Andrzej Siewior 提交于
      This moves the two instances from the big node into two child nodes. The
      glue layer ontop does almost nothing.
      
      There is one devices containing the control module for USB (2) phy,
      (2) usb and later the dma engine. The usb device is the "glue device"
      which contains the musb device as a child. This is what we do ever since.
      
      The new file musb_am335x is just here to prob the new bus and populate
      child devices.
      
      There are a lot of changes to the dsps file as a result of the changes:
      
      - musb_core_offset
        This is gone. The device tree provides memory ressources information
        for the device there is no need to "fix" things
      
      - instances
        This is gone as well. If we have two instances then we have have two
        child enabled nodes in the device tree. For instance the SoC in beagle
        bone has two USB instances but only one has been wired up so there is
        no need to load and init the second instance since it won't be used.
      
      - dsps_glue is now per glue device
        In the past there was one of this structs but with an array of two and
        each instance accessed its variable depending on the platform device
        id.
      
      - no unneeded copy of structs
        I do not know why struct dsps_musb_wrapper is copied but it is not
        necessary. The same goes for musb_hdrc_platform_data which allocated
        on demand and then again by platform_device_add_data(). One copy is
        enough.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      97238b35
    • S
      usb: musb: dsps: remove the hardcoded phy pieces · e96bdc3d
      Sebastian Andrzej Siewior 提交于
      dsps uses a nop driver which is added in dsps itself and does the PHY
      on/off calls within dsps. Since those calls are now moved the nop driver
      itself, we can now request the phy proper phy and remove those calls.
      Currently only the first musb interface is used so we only add one phy
      node for now.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      e96bdc3d
    • S
      usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv · 3fa4d734
      Sebastian Andrzej Siewior 提交于
      The "nop" driver isn't a do-nothing-stub but supports a couple functions
      like clock on/off or is able to use a voltage regulator. This patch
      simply renames the driver to "generic" since it is easy possible to
      extend it by a simple function istead of writing a complete driver.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3fa4d734
  14. 30 7月, 2013 1 次提交
  15. 29 7月, 2013 4 次提交
  16. 28 5月, 2013 1 次提交
  17. 15 5月, 2013 1 次提交
  18. 02 4月, 2013 1 次提交
  19. 18 3月, 2013 3 次提交
  20. 23 1月, 2013 1 次提交