aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/otg
diff options
context:
space:
mode:
authorHema HK <hemahk@ti.com>2011-02-17 01:36:08 -0500
committerFelipe Balbi <balbi@ti.com>2011-02-18 07:05:50 -0500
commit070b8ed96e01adeb978d4f8487fb1350a28fcd0d (patch)
treec99e976d3bc669459d42dd5f7f9341bf540b009f /drivers/usb/otg
parentee896e348cf6f323a00e4ee52e6386f515f86cee (diff)
usb: otg: TWL6030: Introduce the twl6030_phy_suspend function.
Introduce the twl6030_phy_suspend function and assign to otg.set_suspend function pointer. This function is used by the musb-omap2430 platform driver during suspend/resume. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r--drivers/usb/otg/twl6030-usb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index 88989e61430c..b4eda02c97f7 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -177,6 +177,17 @@ static void twl6030_phy_shutdown(struct otg_transceiver *x)
177 pdata->phy_power(twl->dev, 0, 0); 177 pdata->phy_power(twl->dev, 0, 0);
178} 178}
179 179
180static int twl6030_phy_suspend(struct otg_transceiver *x, int suspend)
181{
182 struct twl6030_usb *twl = xceiv_to_twl(x);
183 struct device *dev = twl->dev;
184 struct twl4030_usb_data *pdata = dev->platform_data;
185
186 pdata->phy_suspend(dev, suspend);
187
188 return 0;
189}
190
180static int twl6030_usb_ldo_init(struct twl6030_usb *twl) 191static int twl6030_usb_ldo_init(struct twl6030_usb *twl)
181{ 192{
182 193
@@ -388,6 +399,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)
388 twl->otg.set_vbus = twl6030_set_vbus; 399 twl->otg.set_vbus = twl6030_set_vbus;
389 twl->otg.init = twl6030_phy_init; 400 twl->otg.init = twl6030_phy_init;
390 twl->otg.shutdown = twl6030_phy_shutdown; 401 twl->otg.shutdown = twl6030_phy_shutdown;
402 twl->otg.set_suspend = twl6030_phy_suspend;
391 403
392 /* init spinlock for workqueue */ 404 /* init spinlock for workqueue */
393 spin_lock_init(&twl->lock); 405 spin_lock_init(&twl->lock);
@@ -432,6 +444,7 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)
432 444
433 twl->asleep = 0; 445 twl->asleep = 0;
434 pdata->phy_init(dev); 446 pdata->phy_init(dev);
447 twl6030_phy_suspend(&twl->otg, 0);
435 twl6030_enable_irq(&twl->otg); 448 twl6030_enable_irq(&twl->otg);
436 dev_info(&pdev->dev, "Initialized TWL6030 USB module\n"); 449 dev_info(&pdev->dev, "Initialized TWL6030 USB module\n");
437 450