Commit 046b07ac authored by Neil Zhang's avatar Neil Zhang Committed by Felipe Balbi

usb: gadget: mv_udc: add shutdown function for it

put the device in idle when shutdown.
Signed-off-by: default avatarNeil Zhang <zhangwm@marvell.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 36616224
...@@ -2206,9 +2206,21 @@ static const struct dev_pm_ops mv_udc_pm_ops = { ...@@ -2206,9 +2206,21 @@ static const struct dev_pm_ops mv_udc_pm_ops = {
}; };
#endif #endif
static void mv_udc_shutdown(struct platform_device *dev)
{
struct mv_udc *udc = the_controller;
u32 mode;
/* reset controller mode to IDLE */
mode = readl(&udc->op_regs->usbmode);
mode &= ~3;
writel(mode, &udc->op_regs->usbmode);
}
static struct platform_driver udc_driver = { static struct platform_driver udc_driver = {
.probe = mv_udc_probe, .probe = mv_udc_probe,
.remove = __exit_p(mv_udc_remove), .remove = __exit_p(mv_udc_remove),
.shutdown = mv_udc_shutdown,
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "pxa-u2o", .name = "pxa-u2o",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment