Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364579
b: refs/heads/master
c: f3e117f
h: refs/heads/master
i:
  364577: 4bff91a
  364575: 9c22a59
v: v3
  • Loading branch information
Felipe Balbi committed Mar 18, 2013
1 parent 06e8ee6 commit 54c8777
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d9a00eeca1deeebf001047aa5e5e9d00e5588cf
refs/heads/master: f3e117f4437af5a2d1b72ae0fa1890dbf9bca72f
56 changes: 56 additions & 0 deletions trunk/drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ struct dwc3_omap {
int irq;
void __iomem *base;

u32 utmi_otg_status;

u32 dma_status:1;
};

Expand Down Expand Up @@ -402,12 +404,66 @@ static const struct of_device_id of_dwc3_match[] = {
};
MODULE_DEVICE_TABLE(of, of_dwc3_match);

#ifdef CONFIG_PM
static int dwc3_omap_prepare(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);

dwc3_omap_disable_irqs(omap);

return 0;
}

static void dwc3_omap_complete(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);

dwc3_omap_enable_irqs(omap);
}

static int dwc3_omap_suspend(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);

omap->utmi_otg_status = dwc3_omap_readl(omap->base,
USBOTGSS_UTMI_OTG_STATUS);

return 0;
}

static int dwc3_omap_resume(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);

dwc3_omap_writel(omap->base, USBOTGSS_UTMI_OTG_STATUS,
omap->utmi_otg_status);

pm_runtime_disable(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);

return 0;
}

static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
.prepare = dwc3_omap_prepare,
.complete = dwc3_omap_complete,

SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
};

#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
#else
#define DEV_PM_OPS NULL
#endif /* CONFIG_PM */

static struct platform_driver dwc3_omap_driver = {
.probe = dwc3_omap_probe,
.remove = dwc3_omap_remove,
.driver = {
.name = "omap-dwc3",
.of_match_table = of_dwc3_match,
.pm = DEV_PM_OPS,
},
};

Expand Down

0 comments on commit 54c8777

Please sign in to comment.