Merge current mainline tree into linux-omap tree
[pandora-kernel.git] / drivers / usb / gadget / omap_udc.c
index 03a7f49..34e9e39 100644 (file)
@@ -52,8 +52,9 @@
 #include <asm/unaligned.h>
 #include <asm/mach-types.h>
 
-#include <asm/arch/dma.h>
-#include <asm/arch/usb.h>
+#include <mach/dma.h>
+#include <mach/usb.h>
+#include <mach/control.h>
 
 #include "omap_udc.h"
 
@@ -786,7 +787,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
                        omap_set_dma_dest_params(ep->lch,
                                OMAP_DMA_PORT_TIPB,
                                OMAP_DMA_AMODE_CONSTANT,
-                               (unsigned long) io_v2p(UDC_DATA_DMA),
+                               UDC_DATA_DMA,
                                0, 0);
                }
        } else {
@@ -803,7 +804,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
                        omap_set_dma_src_params(ep->lch,
                                OMAP_DMA_PORT_TIPB,
                                OMAP_DMA_AMODE_CONSTANT,
-                               (unsigned long) io_v2p(UDC_DATA_DMA),
+                               UDC_DATA_DMA,
                                0, 0);
                        /* EMIFF or SDRC */
                        omap_set_dma_dest_burst_mode(ep->lch,
@@ -1120,7 +1121,7 @@ static int omap_ep_set_halt(struct usb_ep *_ep, int value)
                        status = -EINVAL;
                else if (value) {
                        if (ep->udc->ep0_set_config) {
-                               WARN("error changing config?\n");
+                               WARNING("error changing config?\n");
                                omap_writew(UDC_CLR_CFG, UDC_SYSCON2);
                        }
                        omap_writew(UDC_STALL_CMD, UDC_SYSCON2);
@@ -1764,7 +1765,7 @@ do_stall:
                                        u.r.bRequestType, u.r.bRequest, status);
                        if (udc->ep0_set_config) {
                                if (udc->ep0_reset_config)
-                                       WARN("error resetting config?\n");
+                                       WARNING("error resetting config?\n");
                                else
                                        omap_writew(UDC_CLR_CFG, UDC_SYSCON2);
                        }
@@ -2310,10 +2311,17 @@ static int proc_otg_show(struct seq_file *s)
        u32             trans;
        char            *ctrl_name;
 
-       tmp = OTG_REV_REG;
+       tmp = omap_readl(OTG_REV);
        if (cpu_is_omap24xx()) {
+               /*
+                * REVISIT: Not clear how this works on OMAP2.  trans
+                * is ANDed to produce bits 7 and 8, which might make
+                * sense for USB_TRANSCEIVER_CTRL on OMAP1,
+                * but with CONTROL_DEVCONF, these bits have something to
+                * do with the frame adjustment counter and McBSP2.
+                */
                ctrl_name = "control_devconf";
-               trans = CONTROL_DEVCONF_REG;
+               trans = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
        } else {
                ctrl_name = "tranceiver_ctrl";
                trans = omap_readw(USB_TRANSCEIVER_CTRL);
@@ -2686,7 +2694,7 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv)
        udc->gadget.name = driver_name;
 
        device_initialize(&udc->gadget.dev);
-       strcpy (udc->gadget.dev.bus_id, "gadget");
+       dev_set_name(&udc->gadget.dev, "gadget");
        udc->gadget.dev.release = omap_udc_release;
        udc->gadget.dev.parent = &odev->dev;
        if (use_dma)
@@ -3076,7 +3084,7 @@ static int omap_udc_suspend(struct platform_device *dev, pm_message_t message)
         * which would prevent entry to deep sleep...
         */
        if ((devstat & UDC_ATT) != 0 && (devstat & UDC_SUS) == 0) {
-               WARN("session active; suspend requires disconnect\n");
+               WARNING("session active; suspend requires disconnect\n");
                omap_pullup(&udc->gadget, 0);
        }