From: Neil Zhang Date: Wed, 12 Oct 2011 08:49:35 +0000 (+0800) Subject: usb: gadget: mv_udc: add shutdown function for it X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=046b07ac0458fba8c5ca8d9ee04658c02066ee03;p=linux-beck.git usb: gadget: mv_udc: add shutdown function for it put the device in idle when shutdown. Signed-off-by: Neil Zhang Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index f8dc5b3dd796..ffa6f3097a64 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -2206,9 +2206,21 @@ static const struct dev_pm_ops mv_udc_pm_ops = { }; #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 = { .probe = mv_udc_probe, .remove = __exit_p(mv_udc_remove), + .shutdown = mv_udc_shutdown, .driver = { .owner = THIS_MODULE, .name = "pxa-u2o",