USB: port to 2.6.22.
authorQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:19:15 +0000 (21:19 -0600)
committerQuinn Jensen <quinn.jensen@freescale.com>
Thu, 25 Oct 2007 03:19:15 +0000 (21:19 -0600)
Port Freescale USB to linux kernel 2.6.22.
Switch to delayed_work() and fix irq flags.
Applies to linux 2.6.22 kernel for MX platforms.

http://www.bitshrine.org/gpp/linux-2.6.22-mx-USB-port-to-2.6.22.patch

drivers/usb/otg/fsl_otg.c
drivers/usb/otg/fsl_otg.h

index a85fac66264770ac7d12714279868036e12ab191..de188bea0969e84ebfe18170dbda9a53ecc76eda 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/list.h>
 #include <linux/usb.h>
 #include <linux/platform_device.h>
-#include <linux/usb_ch9.h>
+#include <linux/usb/ch9.h>
 #include <linux/usb_gadget.h>
 #include <linux/time.h>
 
@@ -626,9 +626,10 @@ static int fsl_otg_set_power(struct otg_transceiver *otg_p, unsigned mA)
  * roles, the pin-detect interrupts are delayed, and handled
  * by this routine. 
  */
-static void fsl_otg_event(void *ptr)
+static void fsl_otg_event(struct work_struct *work)
 {
-       struct otg_fsm *fsm = &((struct fsl_otg *)ptr)->fsm;
+       struct fsl_otg *og = container_of(work, struct fsl_otg, otg_event.work);
+       struct otg_fsm *fsm = &og->fsm;
 
        if (fsm->id) {          /* switch to gadget */
                fsl_otg_start_host(fsm, 0);
@@ -728,7 +729,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
        DBG("set dr_mem_map to 0x%p", pdata->regs);
        spin_lock_init(&usb_dr_regs_lock);
 
-       INIT_WORK(&fsl_otg_tc->otg_event, fsl_otg_event, fsl_otg_tc);
+       INIT_DELAYED_WORK(&fsl_otg_tc->otg_event, fsl_otg_event);
 
        INIT_LIST_HEAD(&active_timers);
        status = fsl_otg_init_timers(&fsl_otg_tc->fsm);
@@ -796,7 +797,8 @@ int usb_otg_start(struct platform_device *pdev)
        }
        p_otg->irq = res->start;
        DBG("requesting irq %d", p_otg->irq);
-       status = request_irq(p_otg->irq, fsl_otg_isr, 0, "fsl_arc", p_otg);
+       status = request_irq(p_otg->irq, fsl_otg_isr, IRQF_SHARED, "fsl_arc",
+                            p_otg);
        if (status) {
                dev_dbg(p_otg->otg.dev, "can't get IRQ %d, error %d\n",
                        p_otg->irq, status);
index 8488ac6232e7c811992415deb1e6517735434c1b..72d880e4a07d4320f9b07af70645abea5c03eeaa 100644 (file)
@@ -222,7 +222,7 @@ struct fsl_otg {
        struct otg_transceiver otg;
        struct otg_fsm fsm;
        struct usb_dr_mmap *dr_mem_map;
-       struct work_struct otg_event;
+       struct delayed_work otg_event;
 
        /*used for usb host */
        u8 host_working;