--- linux-2.4.19-rmk7-pxa2-adsx6/drivers/usb/hcd/ohci-sa1111.c.orig Mon Dec 1 13:05:27 2003 +++ linux-2.4.19-rmk7-pxa2-adsx6/drivers/usb/hcd/ohci-sa1111.c Tue Dec 16 16:30:14 2003 @@ -338,6 +338,44 @@ static struct usb_hcd *the_sa1111_hcd; #ifdef CONFIG_PM +int ohci_sa1111_shutdown(void) +{ + if (the_sa1111_hcd) { + struct ohci_hcd *ohci = hcd_to_ohci (the_sa1111_hcd); + + dbg ("%s: shutdown %s controller%s", + the_sa1111_hcd->bus_name, + hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS), + ohci->disabled ? " (disabled)" : "" + ); + } + + if (machine_is_adsbitsyx() || + machine_is_adsagc() || + machine_is_adsbitsyplus() || + machine_is_graphicsmaster() || + machine_is_adsbitsy()) { + + // Make sure clock is on + SKPCR |= SKPCR_UCLKEN; + udelay(100); + + // Force a RESET + USB_RESET = USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET; + mdelay(10); + + // Set Power Sense and Control Line + USB_RESET = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW; + USB_STATUS = 0; + mdelay(10); + + // Stop the clock + SKPCR &= ~SKPCR_UCLKEN; + } + + return 0; +} + int ohci_sa1111_restart(void) { int rtn = -ENODEV; @@ -382,6 +420,9 @@ if (rqst == PM_RESUME) ohci_sa1111_restart(); + else if (rqst == PM_SUSPEND) + ohci_sa1111_shutdown(); + return 0; } #endif