]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/gadget/pxa2xx_udc.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
[linux-2.6-omap-h63xx.git] / drivers / usb / gadget / pxa2xx_udc.c
index 484de6e97662fff5f0eb1cc7a4edf73f165a013e..3e715082de36fe9789ded4f272184034ca41877f 100644 (file)
@@ -54,7 +54,7 @@
 #include <asm/hardware.h>
 
 #include <linux/usb/ch9.h>
-#include <linux/usb_gadget.h>
+#include <linux/usb/gadget.h>
 
 #include <asm/mach/udc_pxa2xx.h>
 
@@ -93,8 +93,6 @@ static const char driver_name [] = "pxa2xx_udc";
 static const char ep0name [] = "ep0";
 
 
-// #define     DISABLE_TEST_MODE
-
 #ifdef CONFIG_ARCH_IXP4XX
 
 /* cpu-specific register addresses are compiled in to this code */
@@ -113,17 +111,6 @@ static const char ep0name [] = "ep0";
 #define SIZE_STR       ""
 #endif
 
-#ifdef DISABLE_TEST_MODE
-/* (mode == 0) == no undocumented chip tweaks
- * (mode & 1)  == double buffer bulk IN
- * (mode & 2)  == double buffer bulk OUT
- * ... so mode = 3 (or 7, 15, etc) does it for both
- */
-static ushort fifo_mode = 0;
-module_param(fifo_mode, ushort, 0);
-MODULE_PARM_DESC (fifo_mode, "pxa2xx udc fifo mode");
-#endif
-
 /* ---------------------------------------------------------------------------
  *     endpoint related parts of the api to the usb controller hardware,
  *     used by gadget driver; and the inner talker-to-hardware core.
@@ -341,26 +328,6 @@ pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
        kfree(req);
 }
 
-
-static void *
-pxa2xx_ep_alloc_buffer(struct usb_ep *_ep, unsigned bytes,
-       dma_addr_t *dma, gfp_t gfp_flags)
-{
-       char                    *retval;
-
-       retval = kmalloc (bytes, gfp_flags & ~(__GFP_DMA|__GFP_HIGHMEM));
-       if (retval)
-               *dma = (dma_addr_t)~0;
-       return retval;
-}
-
-static void
-pxa2xx_ep_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma,
-               unsigned bytes)
-{
-       kfree (buf);
-}
-
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -927,9 +894,6 @@ static struct usb_ep_ops pxa2xx_ep_ops = {
        .alloc_request  = pxa2xx_ep_alloc_request,
        .free_request   = pxa2xx_ep_free_request,
 
-       .alloc_buffer   = pxa2xx_ep_alloc_buffer,
-       .free_buffer    = pxa2xx_ep_free_buffer,
-
        .queue          = pxa2xx_ep_queue,
        .dequeue        = pxa2xx_ep_dequeue,
 
@@ -1003,7 +967,7 @@ static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active)
        udc = container_of(_gadget, struct pxa2xx_udc, gadget);
 
        /* not all boards support pullup control */
-       if (!udc->mach->udc_command)
+       if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
                return -EOPNOTSUPP;
 
        is_active = (is_active != 0);
@@ -1275,23 +1239,6 @@ static void udc_enable (struct pxa2xx_udc *dev)
                UDC_RES2 = 0x00;
        }
 
-#ifdef DISABLE_TEST_MODE
-       /* "test mode" seems to have become the default in later chip
-        * revs, preventing double buffering (and invalidating docs).
-        * this EXPERIMENT enables it for bulk endpoints by tweaking
-        * undefined/reserved register bits (that other drivers clear).
-        * Belcarra code comments noted this usage.
-        */
-       if (fifo_mode & 1) {    /* IN endpoints */
-               UDC_RES1 |= USIR0_IR1|USIR0_IR6;
-               UDC_RES2 |= USIR1_IR11;
-       }
-       if (fifo_mode & 2) {    /* OUT endpoints */
-               UDC_RES1 |= USIR0_IR2|USIR0_IR7;
-               UDC_RES2 |= USIR1_IR12;
-       }
-#endif
-
        /* enable suspend/resume and reset irqs */
        udc_clear_mask_UDCCR(UDCCR_SRM | UDCCR_REM);
 
@@ -2362,7 +2309,7 @@ static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct pxa2xx_udc       *udc = platform_get_drvdata(dev);
 
-       if (!udc->mach->udc_command)
+       if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
                WARN("USB host won't detect disconnect!\n");
        pullup(udc, 0);