On Thursday 13 April 2006 11:22 pm, Jan Veldeman wrote: > As the board can be both host and peripheral at the same time, I was > thinking of doing it this way: > * have 1 "core" driver with separate host and gadget modules > (all tristate in Kconfig) > * have the platform_data specify which ports are host/peripheral/otg > (this platform data belongs to the core driver) > * the host and gadget modules can then ask the core driver which > port(s) it may use
Better to have just one driver module, IMO, with the host and peripheral parts conditionally linked and then initialized by the core (tell them what to do, don't make them ask). So the "driver mode" would be a boolean choice, dependant on a tristate value controlling the driver itself. > usb/ > control/ # or another name ;-) > c67x00/ > c67x00_core.c > c67x00_host.c > c67x00_gadget.c I'd go for drivers/usb/c67x00/... and probably you'll find that some of the "core" stuff splits naturally into multiple files. Dependencies are a little wierd; host and OTG modes must depend on USB (host side), peripheral and OTG must depend on gadget, and you'll have to "select ..." to make that c67x00 gadget apply in the drivers/usb/gadget director. ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel