The ARM PCI DMA API implementation has an ugly hack in it to deal 
with the fact that ohci-sa1111.c uses it even though it is not a PCI 
device.  This patch cleans up ohci-sa1111.c to use the generic
DMA API so we can kill the hack...I think/hope. It builds, but I do not 
have any StrongARM HW anywhere near me, so I'm hopeing someone can test 
this and let me know the results.

Patch is against 2.6.0-test2-rmk1, but applies cleanly to 2.6.0-test3

Tnx,
~Deepak

===== drivers/usb/host/ohci-sa1111.c 1.16 vs edited =====
--- 1.16/drivers/usb/host/ohci-sa1111.c Wed Aug 13 11:12:01 2003
+++ edited/drivers/usb/host/ohci-sa1111.c       Tue Aug 19 11:31:55 2003
@@ -167,7 +167,6 @@
        hcd->description = driver->description;
        hcd->irq = dev->irq[1];
        hcd->regs = dev->mapbase;
-       hcd->pdev = SA1111_FAKE_PCIDEV;
        hcd->self.controller = &dev->dev;
        hcd->controller = hcd->self.controller;
 
@@ -264,15 +263,28 @@
 
 /*-------------------------------------------------------------------------*/
 
+static inline void
+ohci_sa1111_free_hcca(struct usb_hcd *hcd)
+{
+       struct ohci_hcd *ohci = hcd_to_ohci (hcd);
+
+       if (ohci->hcca) {
+               dma_free_coherent (hcd->controller, sizeof *ohci->hcca,
+                       ohci->hcca, ohci->hcca_dma);
+               ohci->hcca = NULL;
+       }
+}
+
 static int __devinit
 ohci_sa1111_start (struct usb_hcd *hcd)
 {
        struct ohci_hcd *ohci = hcd_to_ohci (hcd);
        int             ret;
 
-       if (hcd->pdev) {
-               ohci->hcca = pci_alloc_consistent (hcd->pdev,
-                               sizeof *ohci->hcca, &ohci->hcca_dma);
+       if (hcd->controller) {
+
+               ohci->hcca = dma_alloc_coherent (hcd->controller,
+                               sizeof *ohci->hcca, &ohci->hcca_dma, GFP_DMA);
                if (!ohci->hcca)
                        return -ENOMEM;
        }
@@ -301,6 +313,16 @@
        return 0;
 }
 
+static void
+ohci_sa1111_stop (struct usb_hcd *hcd)
+{
+       if (hcd->controller)
+               ohci_sa1111_free_hcca(hcd);
+
+       ohci_stop(hcd);
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static const struct hc_driver ohci_sa1111_hc_driver = {
@@ -320,7 +342,7 @@
        /* suspend:             ohci_sa1111_suspend,  -- tbd */
        /* resume:              ohci_sa1111_resume,   -- tbd */
 #endif
-       .stop =                 ohci_stop,
+       .stop =                 ohci_sa1111_stop,
 
        /*
         * memory lifecycle (except per-request)



-- 
Deepak Saxena - [EMAIL PROTECTED] - http://www.plexity.net/

"Waste equals food"
  - William McDonough & Michael Braungart, Cradle to Cradle


-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to