phy: omap-usb2: support suspend/resume
authorSekhar Nori <nsekhar@ti.com>
Tue, 23 Aug 2016 08:57:39 +0000 (11:57 +0300)
committerKishon Vijay Abraham I <kishon@ti.com>
Sat, 10 Sep 2016 11:18:39 +0000 (16:48 +0530)
commit80fc6660caa64ebc7df7c78d886d2023fd652904
tree2fc762720e5364a5ed3f04fa30a57da084ce364b
parent800dcc307dfeea7c3d7ff46f3d7d592a8dac3ea1
phy: omap-usb2: support suspend/resume

Relying on PM-ops for shutting down PHY clocks was a
bad idea since the users (e.g. USB DWC3) might not
have been suspended by then.

Get rid of all PM-ops. It is the sole responsibility
of the PHY user to properly turn OFF and de-initialize
the PHY as part of its suspend routine.

Enable/disable PHY clock as part of ->init()/->exit()
call respectively. With this phy_init() and phy_exit()
can be called by PHY user during suspend/resume.

This is similar to what is done for ti-pipe3 driver.
See 31c8954efb1b ("phy: ti-pipe3: fix suspend")

The pm_runtime_enable() call in omap_usb2_probe()
is still required because without it, phy_create()
will not enable runtime PM on the phy device it
creates and phy_init() will not call
pm_runtime_get_sync().

Without pm_runtime_get_sync(), ocp2scp hwmod will
_not_ enable the IP and, thus, we will have abort
exceptions.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-omap-usb2.c