19 #include <linux/module.h>
21 #include <linux/slab.h>
62 static void omap_usb_phy_power(
struct omap_usb *
phy,
int on)
88 static int omap_usb_start_srp(
struct usb_otg *otg)
98 static int omap_usb_set_host(
struct usb_otg *otg,
struct usb_bus *
host)
109 static int omap_usb_set_peripheral(
struct usb_otg *otg,
127 omap_usb_phy_power(phy, 0);
128 pm_runtime_put_sync(phy->
dev);
131 ret = pm_runtime_get_sync(phy->
dev);
133 dev_err(phy->
dev,
"get_sync failed with err %d\n",
137 omap_usb_phy_power(phy, 1);
152 dev_err(&pdev->
dev,
"unable to allocate memory for USB2 PHY\n");
158 dev_err(&pdev->
dev,
"unable to allocate memory for USB OTG\n");
165 phy->
phy.label =
"omap-usb2";
166 phy->
phy.set_suspend = omap_usb2_suspend;
173 dev_err(&pdev->
dev,
"Failed to obtain io memory\n");
178 omap_usb_phy_power(phy, 0);
188 dev_err(&pdev->
dev,
"unable to get usb_phy_cm_clk32k\n");
195 platform_set_drvdata(pdev, phy);
204 struct omap_usb *phy = platform_get_drvdata(pdev);
212 #ifdef CONFIG_PM_RUNTIME
214 static int omap_usb2_runtime_suspend(
struct device *
dev)
217 struct omap_usb *phy = platform_get_drvdata(pdev);
224 static int omap_usb2_runtime_resume(
struct device *
dev)
228 struct omap_usb *phy = platform_get_drvdata(pdev);
232 dev_err(phy->
dev,
"Failed to enable wkupclk %d\n", ret);
237 static const struct dev_pm_ops omap_usb2_pm_ops = {
242 #define DEV_PM_OPS (&omap_usb2_pm_ops)
244 #define DEV_PM_OPS NULL
248 static const struct of_device_id omap_usb2_id_table[] = {
256 .probe = omap_usb2_probe,