]> err.no Git - linux-2.6/commitdiff
[PATCH] USB: at91 usb driver supend/resume fixes
authorDavid Brownell <david-b@pacbell.net>
Mon, 3 Apr 2006 04:26:21 +0000 (20:26 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Apr 2006 18:12:25 +0000 (11:12 -0700)
AT91: the two USB drivers (OHCI, UDC) got out of sync with various
usbcore and driver model PM updates; fix.

Also minor fixes to ohci:  whitespace/style, MODULE_ALIAS so coldplug works
using /sys/.../modalias, and turn off _both_ clocks during suspend.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/at91_udc.c
drivers/usb/host/ohci-at91.c

index 865858cfd1c2bdce353262dceea3cc4158d53ad3..b8d0b7825bf360c7a446aaa683e4b0a006cfa75d 100644 (file)
@@ -1709,7 +1709,7 @@ static int __devexit at91udc_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level)
+static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg)
 {
        struct at91_udc *udc = platform_get_drvdata(dev);
 
@@ -1731,7 +1731,7 @@ static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level)
        return 0;
 }
 
-static int at91udc_resume(struct platform_device *dev, u32 level)
+static int at91udc_resume(struct platform_device *dev)
 {
        struct at91_udc *udc = platform_get_drvdata(dev);
 
index 980030d684d516d3f6eaa5b0ec419938a51b82df..6b7350b52419fc57e925081e21ea9757b6e33ef5 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/arch/board.h>
 
 #ifndef CONFIG_ARCH_AT91RM9200
-#error "This file is AT91RM9200 bus glue.  CONFIG_ARCH_AT91RM9200 must be defined."
+#error "CONFIG_ARCH_AT91RM9200 must be defined."
 #endif
 
 /* interface and function clocks */
@@ -84,8 +84,6 @@ static int usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
  * Allocates basic resources for this USB host controller, and
  * then invokes the start() method for the HCD associated with it
  * through the hotplug entry's driver_data.
- *
- * Store this function in the HCD's struct pci_driver as probe().
  */
 int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev)
 {
@@ -148,7 +146,6 @@ int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *
 }
 
 
-/* may be called without controller electrically present */
 /* may be called with controller, bus, and devices active */
 
 /**
@@ -166,11 +163,11 @@ static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pde
        usb_remove_hcd(hcd);
        at91_stop_hc(pdev);
        iounmap(hcd->regs);
-       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 
-       clk_put(fclk);
-       clk_put(iclk);
-       fclk = iclk = NULL;
+       clk_put(fclk);
+       clk_put(iclk);
+       fclk = iclk = NULL;
 
        dev_set_drvdata(&pdev->dev, NULL);
        return 0;
@@ -235,8 +232,8 @@ static const struct hc_driver ohci_at91_hc_driver = {
        .hub_control =          ohci_hub_control,
 
 #ifdef CONFIG_PM
-       .hub_suspend =          ohci_hub_suspend,
-       .hub_resume =           ohci_hub_resume,
+       .bus_suspend =          ohci_bus_suspend,
+       .bus_resume =           ohci_bus_resume,
 #endif
        .start_port_reset =     ohci_start_port_reset,
 };
@@ -254,21 +251,21 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int ohci_hcd_at91_drv_suspend(struct platform_device *dev, u32 state, u32 level)
-{
-       printk("%s(%s:%d): not implemented yet\n",
-               __func__, __FILE__, __LINE__);
 
+/* REVISIT suspend/resume look "too" simple here */
+
+static int
+ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg)
+{
        clk_disable(fclk);
+       clk_disable(iclk);
 
        return 0;
 }
 
-static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state)
+static int ohci_hcd_at91_drv_resume(struct platform_device *dev)
 {
-       printk("%s(%s:%d): not implemented yet\n",
-               __func__, __FILE__, __LINE__);
-
+       clk_enable(iclk);
        clk_enable(fclk);
 
        return 0;
@@ -278,6 +275,8 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *dev, u32 state)
 #define ohci_hcd_at91_drv_resume  NULL
 #endif
 
+MODULE_ALIAS("at91rm9200-ohci");
+
 static struct platform_driver ohci_hcd_at91_driver = {
        .probe          = ohci_hcd_at91_drv_probe,
        .remove         = ohci_hcd_at91_drv_remove,