1. 17 11月, 2016 1 次提交
  2. 14 9月, 2016 2 次提交
    • A
      phy-twl4030-usb: initialize charging-related stuff via pm_runtime · b78ea84a
      Andreas Kemnade 提交于
      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: NAndreas Kemnade <andreas@kemnade.info>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      b78ea84a
    • A
      phy-twl4030-usb: better handle musb_mailbox() failure · 78489c7c
      Andreas Kemnade 提交于
      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: NAndreas Kemnade <andreas@kemnade.info>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      78489c7c
  3. 02 6月, 2016 1 次提交
    • T
      usb: musb: Return error value from musb_mailbox · 12b7db2b
      Tony Lindgren 提交于
      At least on n900 we have phy-twl4030-usb only generating cable
      interrupts, and then have a separate USB PHY.
      
      In order for musb to know the real cable status, we need to
      clear any cached state until musb is ready. Otherwise the cable
      status interrupts will get just ignored if the status does
      not change from the initial state.
      
      To do this, let's add a return value to musb_mailbox(), and
      reset cached linkstat to MUSB_UNKNOWN on error. Sorry to cause
      a bit of churn here, I should have added that already last time
      patching musb_mailbox().
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      12b7db2b
  4. 04 3月, 2016 1 次提交
    • A
      phy: twl4030: use __maybe_unused to hide pm functions · 8073fb82
      Arnd Bergmann 提交于
      The twl4030 USB PHY driver uses UNIVERSAL_DEV_PM_OPS to access
      its suspend/resume functions, which causes a warning about
      unused symbols when CONFIG_PM is disabled:
      
      drivers/phy/phy-twl4030-usb.c:394:12: error: 'twl4030_usb_runtime_suspend' defined but not used [-Werror=unused-function]
      drivers/phy/phy-twl4030-usb.c:408:12: error: 'twl4030_usb_runtime_resume' defined but not used [-Werror=unused-function]
      
      This adds __maybe_unused annotations to let the compiler know
      it can silently drop the function definition.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8073fb82
  5. 10 2月, 2016 2 次提交
    • T
      phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload · 58a66dba
      Tony Lindgren 提交于
      If we reload phy-twl4030-usb, we get a warning about unbalanced
      pm_runtime_enable. Let's fix the issue and also fix idling of the
      device on unload before we attempt to shut it down.
      
      If we don't properly idle the PHY before shutting it down on removal,
      the twl4030 ends up consuming about 62mW of extra power compared to
      running idle with the module loaded.
      
      Cc: stable@vger.kernel.org
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: NeilBrown <neil@brown.name>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      58a66dba
    • T
      phy: twl4030-usb: Relase usb phy on unload · b241d31e
      Tony Lindgren 提交于
      Otherwise rmmod omap2430; rmmod phy-twl4030-usb; modprobe omap2430
      will try to use a non-existing phy and oops:
      
      Unable to handle kernel paging request at virtual address b6f7c1f0
      ...
      [<c048a284>] (devm_usb_get_phy_by_node) from [<bf0758ac>]
      (omap2430_musb_init+0x44/0x2b4 [omap2430])
      [<bf0758ac>] (omap2430_musb_init [omap2430]) from [<bf055ec0>]
      (musb_init_controller+0x194/0x878 [musb_hdrc])
      
      Cc: stable@vger.kernel.org
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: NeilBrown <neil@brown.name>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      b241d31e
  6. 17 12月, 2015 1 次提交
    • T
      usb: musb: core: Fix handling of the phy notifications · 8055555f
      Tony Lindgren 提交于
      We currently can't unload omap2430 MUSB platform glue driver module and
      this cause issues for fixing the MUSB code further. The reason we can't
      remove omap2430 is because it uses the PHY functions and also exports the
      omap_musb_mailbox function that some PHY drivers are using.
      
      Let's fix the issue by exporting a more generic musb_mailbox function
      from the MUSB core and allow platform glue layers to register phy_callback
      function as needed.
      
      And now we can now also get rid of the include/linux/musb-omap.h.
      
      Cc: Bin Liu <b-liu@ti.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: NeilBrown <neil@brown.name>
      Reviewed-by: NKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8055555f
  7. 01 6月, 2015 3 次提交
  8. 13 3月, 2015 1 次提交
  9. 22 11月, 2014 2 次提交
  10. 11 11月, 2014 1 次提交
    • F
      phy: twl4030: Fix build breakage · 8b9ca276
      Felipe Balbi 提交于
      commit e47d9254 (usb: move the OTG state
      from the USB PHY to the OTG structure) moved
      the OTG state field from struct usb_phy to
      struct usb_otg but, even though I fixed many
      other build breakages, I still missed one
      on phy-twl4030-usb.c.
      
      Fix the build breakage now.
      
      While at that, also a build warning introduced
      by the same commit.
      
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      8b9ca276
  11. 24 9月, 2014 6 次提交
  12. 24 8月, 2014 2 次提交
    • T
      usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down · 85601b8d
      Tony Lindgren 提交于
      Commit 249751f2 ("usb: phy: twl4030-usb: poll for ID disconnect")
      added twl4030_id_workaround_work() to deal with lost interrupts
      after ID pin goes down. Looks like commit f1ddc24c ("usb: phy:
      twl4030-usb: remove *set_suspend* and *phy_init* ops") changed
      things around for the generic phy framework, and delayed work no
      longer got called except initially during boot.
      
      The PHY connect and disconnect interrupts for twl4030-usb are not
      working after disconnecting a USB-A cable from the board, and the
      deeper idle states for omap are blocked as the USB controller
      stays busy.
      
      The issue can be solved by calling delayed work from twl4030_usb_irq()
      when ID pin is down and the PHY is not asleep like we already do
      in twl4030_id_workaround_work().
      
      But as both twl4030_usb_irq() and twl4030_id_workaround_work()
      already do pretty much the same thing, let's call twl4030_usb_irq()
      from twl4030_id_workaround_work() instead of adding some more
      duplicate code. We also must call sysfs_notify() only when we have
      an interrupt and not from the delayed work as notified by
      Grazvydas Ignotas <notasas@gmail.com>.
      
      Fixes: f1ddc24c ("usb: phy: twl4030-usb: remove *set_suspend* and *phy_init* ops")
      Cc: stable@vger.kernel.org # v3.13+
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      85601b8d
    • T
      usb: phy: twl4030-usb: Fix regressions to runtime PM on omaps · 96be39ab
      Tony Lindgren 提交于
      Commit 30a70b02 ("usb: musb: fix obex in g_nokia.ko causing kernel
      panic") attempted to fix runtime PM handling for PHYs that are on the
      I2C bus. Commit 3063a12b ("usb: musb: fix PHY power on/off") then
      changed things around to enable of PHYs that rely on runtime PM.
      
      These changes however broke idling of the PHY and causes at least
      100 mW extra power consumption on omaps, which is a lot with
      the idle power consumption being below 10 mW range on many devices.
      
      As calling phy_power_on/off from runtime PM calls in the USB
      causes complicated issues with I2C connected PHYs, let's just let
      the PHY do it's own runtime PM as needed. This leaves out the
      dependency between PHYs and USB controller drivers for runtime
      PM.
      
      Let's fix the regression for twl4030-usb by adding minimal runtime
      PM support. This allows idling the PHY on disconnect.
      
      Note that we are changing to use standard runtime PM handling
      for twl4030_phy_init() as that function just checks the state
      and does not initialize the PHY. The PHY won't get initialized
      until in twl4030_phy_power_on().
      
      Fixes: 30a70b02 ("usb: musb: fix obex in g_nokia.ko causing kernel panic")
      Fixes: 3063a12b ("usb: musb: fix PHY power on/off")
      Cc: stable@vger.kernel.org # v3.15+
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      96be39ab
  13. 22 7月, 2014 1 次提交
  14. 02 3月, 2014 2 次提交
  15. 19 2月, 2014 1 次提交
  16. 28 9月, 2013 2 次提交
  17. 30 7月, 2013 1 次提交
  18. 03 4月, 2013 1 次提交
  19. 02 4月, 2013 1 次提交
  20. 21 3月, 2013 4 次提交
  21. 18 3月, 2013 4 次提交