1. 14 Sep, 2016 2 commits
    • Andreas Kemnade's avatar
      phy-twl4030-usb: initialize charging-related stuff via pm_runtime · b78ea84a
      Andreas Kemnade authored
      twl4030_phy_power_on() initializes some bits which are required for
      charging. As they are not set in twl4030_usb_runtime_resume()
      a call to pm_runtime_get_sync() is not sufficient to enable charging.
      
      This patch moves the initialization to twl4030_usb_runtime_resume()
      so everything needed for charging is initialized upon
      pm_runtime_get_sync().
      
      That also gives improved possibilities to debug problems in that area
      because the relevant parts can be checked separately. Charging can be
      enabled without having the musb subsystem active.
      
      As a side effect this hides some bugs in musb which causes
      unbalanced calls to phy_power_off()/phy_power_on() so that
      phy->power_count becomes -1.
      
      The result is that e.g. the GTA04 phone (dm3730 + twl4030) works
      finally as a usb gadget again and charging is working.
      Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      b78ea84a
    • Andreas Kemnade's avatar
      phy-twl4030-usb: better handle musb_mailbox() failure · 78489c7c
      Andreas Kemnade authored
      setting twl->linkstat = MUSB_UNKNOWN upon error in musb_mailbox as
      introduced in
      commit 12b7db2b ("usb: musb: Return error value from musb_mailbox")
      causes twl4030_usb_irq() to not detect a state change form cable connected
      to cable disconnected after such an error so that
      pm_runtime_put_autosuspend() will not be called and the usage counter
      gets unbalanced. Such errors happen e.g. if the omap2430 module is not
      (yet) loaded during plug/unplug events.
      
      This patch introduces a flag instead that indicates whether there is
      information for the musb_mailbox pending and calls musb_mailbox() if
      that flag is set.
      Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      78489c7c
  2. 10 Sep, 2016 38 commits