• Tony Lindgren's avatar
    usb: phy: twl4030-usb: Fix regressions to runtime PM on omaps · 96be39ab
    Tony Lindgren authored
    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: default avatarFelipe Balbi <balbi@ti.com>
    Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
    96be39ab
phy-twl4030-usb.c 22.6 KB