]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ohci-pxa27x.c
iget: stop the MINIX filesystem from using iget() and read_inode()
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ohci-pxa27x.c
index e176b04d7aeb4ea4921c102ab614dc69ea037906..ff9a79843471624ceb9f164f2089127bfb39d09a 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/device.h>
 #include <linux/signal.h>
 #include <linux/platform_device.h>
+#include <linux/clk.h>
 
 #include <asm/mach-types.h>
 #include <asm/hardware.h>
@@ -32,6 +33,8 @@
 
 #define UHCRHPS(x)              __REG2( 0x4C000050, (x)<<2 )
 
+static struct clk *usb_clk;
+
 /*
   PMM_NPS_MODE -- PMM Non-power switching mode
       Ports are powered continuously.
@@ -47,7 +50,7 @@ static int pxa27x_ohci_select_pmm( int mode )
        switch ( mode ) {
        case PMM_NPS_MODE:
                UHCRHDA |= RH_A_NPS;
-               break; 
+               break;
        case PMM_GLOBAL_MODE:
                UHCRHDA &= ~(RH_A_NPS & RH_A_PSM);
                break;
@@ -60,7 +63,7 @@ static int pxa27x_ohci_select_pmm( int mode )
                break;
        default:
                printk( KERN_ERR
-                       "Invalid mode %d, set to non-power switch mode.\n", 
+                       "Invalid mode %d, set to non-power switch mode.\n",
                        mode );
 
                UHCRHDA |= RH_A_NPS;
@@ -80,7 +83,7 @@ static int pxa27x_start_hc(struct device *dev)
 
        inf = dev->platform_data;
 
-       pxa_set_cken(CKEN10_USBHOST, 1);
+       clk_enable(usb_clk);
 
        UHCHR |= UHCHR_FHR;
        udelay(11);
@@ -123,7 +126,7 @@ static void pxa27x_stop_hc(struct device *dev)
        UHCCOMS |= 1;
        udelay(10);
 
-       pxa_set_cken(CKEN10_USBHOST, 0);
+       clk_disable(usb_clk);
 }
 
 
@@ -158,6 +161,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
                return -ENOMEM;
        }
 
+       usb_clk = clk_get(&pdev->dev, "USBCLK");
+       if (IS_ERR(usb_clk))
+               return PTR_ERR(usb_clk);
+
        hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x");
        if (!hcd)
                return -ENOMEM;
@@ -201,6 +208,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
  err1:
        usb_put_hcd(hcd);
+       clk_put(usb_clk);
        return retval;
 }
 
@@ -225,6 +233,7 @@ void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *pdev)
        iounmap(hcd->regs);
        release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
        usb_put_hcd(hcd);
+       clk_put(usb_clk);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -270,7 +279,7 @@ static const struct hc_driver ohci_pxa27x_hc_driver = {
         */
        .start =                ohci_pxa27x_start,
        .stop =                 ohci_stop,
-       .shutdown =             ohci_shutdown,
+       .shutdown =             ohci_shutdown,
 
        /*
         * managing i/o requests and associated device resources
@@ -359,9 +368,9 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
 static struct platform_driver ohci_hcd_pxa27x_driver = {
        .probe          = ohci_hcd_pxa27x_drv_probe,
        .remove         = ohci_hcd_pxa27x_drv_remove,
-       .shutdown       = usb_hcd_platform_shutdown,
+       .shutdown       = usb_hcd_platform_shutdown,
 #ifdef CONFIG_PM
-       .suspend        = ohci_hcd_pxa27x_drv_suspend, 
+       .suspend        = ohci_hcd_pxa27x_drv_suspend,
        .resume         = ohci_hcd_pxa27x_drv_resume,
 #endif
        .driver         = {
@@ -369,19 +378,3 @@ static struct platform_driver ohci_hcd_pxa27x_driver = {
        },
 };
 
-static int __init ohci_hcd_pxa27x_init (void)
-{
-       pr_debug (DRIVER_INFO " (pxa27x)");
-       pr_debug ("block sizes: ed %d td %d\n",
-               sizeof (struct ed), sizeof (struct td));
-
-       return platform_driver_register(&ohci_hcd_pxa27x_driver);
-}
-
-static void __exit ohci_hcd_pxa27x_cleanup (void)
-{
-       platform_driver_unregister(&ohci_hcd_pxa27x_driver);
-}
-
-module_init (ohci_hcd_pxa27x_init);
-module_exit (ohci_hcd_pxa27x_cleanup);