* ohci-au1xxx.c breakage
@ 2005-03-22 15:38 Ulrich Eckhardt
2005-03-22 16:44 ` Pete Popov
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Eckhardt @ 2005-03-22 15:38 UTC (permalink / raw)
To: linux-mips
Greetings!
There seem to have been some changes to the USB driver kernel API which the
Au1xxx driver wasn't adapted to. I just wanted to say that I'm working on it,
but without really knowing much about the framework so success is not
guaranteed...
If someone else wants to earn the fame I will happily step back. ;)
Uli
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ohci-au1xxx.c breakage
2005-03-22 15:38 Ulrich Eckhardt
@ 2005-03-22 16:44 ` Pete Popov
0 siblings, 0 replies; 4+ messages in thread
From: Pete Popov @ 2005-03-22 16:44 UTC (permalink / raw)
To: Ulrich Eckhardt; +Cc: linux-mips
Ulrich Eckhardt wrote:
>Greetings!
>
>There seem to have been some changes to the USB driver kernel API which the
>Au1xxx driver wasn't adapted to. I just wanted to say that I'm working on it,
>but without really knowing much about the framework so success is not
>guaranteed...
>
>If someone else wants to earn the fame I will happily step back. ;)
>
>
I assume you're talking about 2.6?
If you can fix it correctly, go for it and send the patch. Otherwise
we'll have to fix it, again, soon.
Pete
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ohci-au1xxx.c breakage
@ 2005-03-23 0:12 joeg
2005-03-23 8:45 ` Ulrich Eckhardt
0 siblings, 1 reply; 4+ messages in thread
From: joeg @ 2005-03-23 0:12 UTC (permalink / raw)
To: linux-mips, ppopov, eckhardt
This patch works for me on an Au1550 little endian.
Joe
--- linux-2.6.11-3/drivers/usb/host/ohci-au1xxx.c 2005-03-18 10:37:49.000000000 -0700
+++ test_2.6.11_3_tree/drivers/usb/host/ohci-au1xxx.c 2005-03-22 15:29:14.376513351 -0700
@@ -84,97 +84,48 @@ static void au1xxx_stop_hc(struct platfo
*
*/
int usb_hcd_au1xxx_probe (const struct hc_driver *driver,
- struct usb_hcd **hcd_out,
struct platform_device *dev)
{
int retval;
- struct usb_hcd *hcd = 0;
-
- unsigned int *addr = NULL;
-
- if (!request_mem_region(dev->resource[0].start,
- dev->resource[0].end
- - dev->resource[0].start + 1, hcd_name)) {
- pr_debug("request_mem_region failed");
- return -EBUSY;
- }
-
- au1xxx_start_hc(dev);
-
- addr = ioremap(dev->resource[0].start,
- dev->resource[0].end
- - dev->resource[0].start + 1);
- if (!addr) {
- pr_debug("ioremap failed");
- retval = -ENOMEM;
- goto out_release;
- }
+ struct usb_hcd *hcd;
if (dev->resource[1].flags != IORESOURCE_IRQ) {
pr_debug ("resource[1] is not IORESOURCE_IRQ");
retval = -ENOMEM;
- goto out_iounmap;
}
- hcd = usb_create_hcd(driver);
- if (hcd == NULL) {
- pr_debug ("usb_create_hcd failed");
- retval = -ENOMEM;
- goto out_iounmap;
- }
- ohci_hcd_init(hcd_to_ohci(hcd));
+ hcd = usb_create_hcd(driver, &dev->dev, "Au1xxx");
+ if (!hcd)
+ return -ENOMEM;
+ hcd->rsrc_start = dev->resource[0].start;
+ hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
- hcd->irq = dev->resource[1].start;
- hcd->regs = addr;
- hcd->self.controller = &dev->dev;
-
- retval = hcd_buffer_create (hcd);
- if (retval != 0) {
- pr_debug ("pool alloc fail");
- goto out_put_hcd;
- }
-
- retval = request_irq (hcd->irq, usb_hcd_au1xxx_hcim_irq, SA_INTERRUPT,
- hcd->driver->description, hcd);
- if (retval != 0) {
- pr_debug("request_irq failed");
+ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+ pr_debug("request_mem_region failed");
retval = -EBUSY;
- goto out_free_buffer;
+ goto err1;
}
- pr_debug ("%s (Au1xxx) at 0x%p, irq %d",
- hcd->driver->description, hcd->regs, hcd->irq);
-
- hcd->self.bus_name = "au1xxx";
-
- if ((retval = usb_register_bus(&hcd->self)))
- goto out_free_irq;
-
- if ((retval = driver->start(hcd)) < 0) {
- usb_hcd_au1xxx_remove(hcd, dev);
- printk("bad driver->start\n");
- return retval;
+ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+ if (!hcd->regs) {
+ pr_debug("ioremap failed");
+ retval = -ENOMEM;
+ goto err2;
}
- *hcd_out = hcd;
+ au1xxx_start_hc(dev);
+ ohci_hcd_init(hcd_to_ohci(hcd));
- return 0;
+ retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
+ if (retval == 0)
+ return retval;
-out_unregister_bus:
- usb_deregister_bus(&hcd->self);
-out_free_irq:
- free_irq(hcd->irq, hcd);
-out_free_buffer:
- hcd_buffer_destroy (hcd);
-out_put_hcd:
- usb_put_hcd(hcd);
-out_iounmap:
- iounmap(addr);
-out_release:
au1xxx_stop_hc(dev);
- release_mem_region(dev->resource[0].start,
- dev->resource[0].end
- - dev->resource[0].start + 1);
+ iounmap(hcd->regs);
+ err2:
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ err1:
+ usb_put_hcd(hcd);
return retval;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ohci-au1xxx.c breakage
2005-03-23 0:12 ohci-au1xxx.c breakage joeg
@ 2005-03-23 8:45 ` Ulrich Eckhardt
0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Eckhardt @ 2005-03-23 8:45 UTC (permalink / raw)
To: linux-mips
joeg wrote:
> This patch works for me on an Au1550 little endian.
AOL, on a DB1100 derived board.
thanks
Uli
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-03-23 8:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-23 0:12 ohci-au1xxx.c breakage joeg
2005-03-23 8:45 ` Ulrich Eckhardt
-- strict thread matches above, loose matches on Subject: below --
2005-03-22 15:38 Ulrich Eckhardt
2005-03-22 16:44 ` Pete Popov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox