On Saturday 29 January 2005 6:13 am, Richard wrote: > I'm using linux 2.6.10 kernel and want to write my own USB OHCI > driver because there is no ported one.
I suspect there actually _is_ an ohci-at91rm200.c floating around somewhere, there are a fair number of Linux folk using that chip. But maybe not; someone has to be first! I tend to call such software the "glue" to the OHCI driver itself; there's PCI glue, and there's glue for each different SOC chip. And SOC glue tends to need board-specific customization hooks. > I tried to port my own driver using ohci-pxa27x.c's structure, > in the ohci_hcd_xxx_init function,it only register the and then return. > And I think there may be some function in some subsystems call the > .probe of the ohci_hcd_xxx_driver structue,e.g.the ohci_hcd_xxx_drv_probe > function which I filled in the .probe section of the ohci_hcd_xxx_driver > structue,however,I cannot get the ohci_hcd_xxx_probe function invoked. > I think it needn't to fill the .id_table secion in the structure > registered,right? Your board initialization function needs to create a platform device to register the OHCI hardware. When both the device and its driver are registered, the driver model core matches them (device name must be the same as driver name!) and calls the probe function. That code is in drivers/base/platform.c as I recall. For ARM, make your board's INIT_MACHINE macro -- in the MACHINE_START section of your arch/arm/mach-XXX/board-YYY.c file -- register that device along with the others that are wired out on your board. That is, don't bother creating that platform device except on boards that wire out at least one of the root hub ports (to a USB "A" connector, or to some on-board device). Some boards will probably also allocate one or more GPIO lines to manage power switching and/or overcurrent detection; you'll want to plan your glue code so it can easily handle those board-specific details. That's what the platform_data field is used for. - Dave ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
