]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: gadget: mv_udc: add shutdown function for it
authorNeil Zhang <zhangwm@marvell.com>
Wed, 12 Oct 2011 08:49:35 +0000 (16:49 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:42:06 +0000 (20:42 +0300)
put the device in idle when shutdown.

Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/mv_udc_core.c

index f8dc5b3dd796d5a02aec3d6c2c7a1f1b7284ff99..ffa6f3097a649dcd80ec32bffe82896e5b245bde 100644 (file)
@@ -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",