]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/gadget/pxa2xx_udc.h
usb gadget: fix fsl_usb2_udc potential OOPS
[linux-2.6-omap-h63xx.git] / drivers / usb / gadget / pxa2xx_udc.h
index d0bc396a85d50041e030289ae4c0ab99396f525b..1db46d705777a39881cca5f395700e8410e84feb 100644 (file)
@@ -54,8 +54,6 @@ struct pxa2xx_ep {
        const struct usb_endpoint_descriptor    *desc;
        struct list_head                        queue;
        unsigned long                           pio_irqs;
-       unsigned long                           dma_irqs;
-       short                                   dma; 
 
        unsigned short                          fifo_size;
        u8                                      bEndpointAddress;
@@ -63,7 +61,7 @@ struct pxa2xx_ep {
 
        unsigned                                stopped : 1;
        unsigned                                dma_fixup : 1;
-                                                        
+
        /* UDCCS = UDC Control/Status for this EP
         * UBCR = UDC Byte Count Remaining (contents of OUT fifo)
         * UDDR = UDC Endpoint Data Register (the fifo)
@@ -72,12 +70,6 @@ struct pxa2xx_ep {
        volatile u32                            *reg_udccs;
        volatile u32                            *reg_ubcr;
        volatile u32                            *reg_uddr;
-#ifdef USE_DMA
-       volatile u32                            *reg_drcmr;
-#define        drcmr(n)  .reg_drcmr = & DRCMR ## n ,
-#else
-#define        drcmr(n)  
-#endif
 };
 
 struct pxa2xx_request {
@@ -85,7 +77,7 @@ struct pxa2xx_request {
        struct list_head                        queue;
 };
 
-enum ep0_state { 
+enum ep0_state {
        EP0_IDLE,
        EP0_IN_DATA_PHASE,
        EP0_OUT_DATA_PHASE,
@@ -108,7 +100,6 @@ struct udc_stats {
 
 #ifdef CONFIG_USB_PXA2XX_SMALL
 /* when memory's tight, SMALL config saves code+data.  */
-#undef USE_DMA
 #define        PXA_UDC_NUM_ENDPOINTS   3
 #endif
 
@@ -134,6 +125,7 @@ struct pxa2xx_udc {
        struct timer_list                       timer;
 
        struct device                           *dev;
+       struct clk                              *clk;
        struct pxa2xx_udc_mach_info             *mach;
        u64                                     dma_mask;
        struct pxa2xx_ep                        ep [PXA_UDC_NUM_ENDPOINTS];
@@ -144,62 +136,10 @@ struct pxa2xx_udc {
 #ifdef CONFIG_ARCH_LUBBOCK
 #include <asm/arch/lubbock.h>
 /* lubbock can also report usb connect/disconnect irqs */
-
-#ifdef DEBUG
-#define HEX_DISPLAY(n) if (machine_is_lubbock()) { LUB_HEXLED = (n); }
-#endif
-
-#endif
-
-/*-------------------------------------------------------------------------*/
-
-/* LEDs are only for debug */
-#ifndef HEX_DISPLAY
-#define HEX_DISPLAY(n)         do {} while(0)
-#endif
-
-#ifdef DEBUG
-#include <asm/leds.h>
-
-#define LED_CONNECTED_ON       leds_event(led_green_on)
-#define LED_CONNECTED_OFF      do { \
-                                       leds_event(led_green_off); \
-                                       HEX_DISPLAY(0); \
-                               } while(0)
 #endif
 
-#ifndef LED_CONNECTED_ON
-#define LED_CONNECTED_ON       do {} while(0)
-#define LED_CONNECTED_OFF      do {} while(0)
-#endif
-
-/*-------------------------------------------------------------------------*/
-
 static struct pxa2xx_udc *the_controller;
 
-/* one GPIO should be used to detect VBUS from the host */
-static inline int is_vbus_present(void)
-{
-       if (!the_controller->mach->udc_is_connected)
-               return 1;
-       return the_controller->mach->udc_is_connected();
-}
-
-/* one GPIO should control a D+ pullup, so host sees this device (or not) */
-static inline void pullup_off(void)
-{
-       if (!the_controller->mach->udc_command)
-               return;
-       the_controller->mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
-}
-
-static inline void pullup_on(void)
-{
-       if (!the_controller->mach->udc_command)
-               return;
-       the_controller->mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
-}
-
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -227,7 +167,7 @@ static const char *state_name[] = {
 #    define UDC_DEBUG DBG_NORMAL
 #endif
 
-static void __attribute__ ((__unused__))
+static void __maybe_unused
 dump_udccr(const char *label)
 {
        u32     udccr = UDCCR;
@@ -243,7 +183,7 @@ dump_udccr(const char *label)
                (udccr & UDCCR_UDE) ? " ude" : "");
 }
 
-static void __attribute__ ((__unused__))
+static void __maybe_unused
 dump_udccs0(const char *label)
 {
        u32             udccs0 = UDCCS0;
@@ -260,7 +200,7 @@ dump_udccs0(const char *label)
                (udccs0 & UDCCS0_OPR) ? " opr" : "");
 }
 
-static void __attribute__ ((__unused__))
+static void __maybe_unused
 dump_state(struct pxa2xx_udc *dev)
 {
        u32             tmp;