Skip to content

Commit

Permalink
phy: twl4030-usb: Fix for musb session bit based PM
Browse files Browse the repository at this point in the history
Now with musb driver implementing generic session bit based
PM, we need to have the USB PHYs behaving in a sane way for
platforms implementing PM.

Currently twl4030-usb enables PM in twl4030_phy_power_on()
and then disables it in twl4030_phy_power_off(). This will
block PM runtime for the SoC when no cable is connected.

Fix the issue by moving PM runtime autosuspend call to
happen where it gets called in twl4030_phy_power_on().

Note that this patch should not be backported to anything
before commit 467d5c9 ("usb: musb: Implement session bit
based runtime PM for musb-core") as before that all the
glue layers implemented their own PM.

Fixes: 467d5c9 ("usb: musb: Implement session bit based
runtime PM for musb-core")
Tested-by: Ladislav Michl <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Acked-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Bin Liu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tmlind authored and gregkh committed Nov 17, 2016
1 parent 2475291 commit f7c4a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/phy/phy-twl4030-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ static int twl4030_phy_power_off(struct phy *phy)
struct twl4030_usb *twl = phy_get_drvdata(phy);

dev_dbg(twl->dev, "%s\n", __func__);
pm_runtime_mark_last_busy(twl->dev);
pm_runtime_put_autosuspend(twl->dev);

return 0;
}
Expand All @@ -472,6 +470,8 @@ static int twl4030_phy_power_on(struct phy *phy)
dev_dbg(twl->dev, "%s\n", __func__);
pm_runtime_get_sync(twl->dev);
schedule_delayed_work(&twl->id_workaround_work, HZ);
pm_runtime_mark_last_busy(twl->dev);
pm_runtime_put_autosuspend(twl->dev);

return 0;
}
Expand Down

0 comments on commit f7c4a46

Please sign in to comment.