On Wed, 20 Jan 2010, sai pavan wrote: > Hi All, > > We have a usb device which supports multiple usb functions. We would > like to support dynamic configuration based on user input. i.e We have > a array of product ids and each product id consists of different usb > functions. for example > > product id A : mass storage > > product id B: CDC-ECM > > product id C: mass storage + CDC-ACM > > We can compile composite driver as a DLKM (g_myusb.ko) which takes > product id as a module parameter. Based on product id we can prepare > configuration and the corresponding functions only will be active i.e > remaining function drivers bind will not be called. Every time user > wants to switch to a different composition, we reload the module with > a different product id as module parameter. > > We want to extend the same functionality for statically compiled > composite driver as well. We can register sysfs handler function to > receive a product id module parameter. The default product id can be > passed via kernel command line. If nothing is passed, usb device will > not be enumerated till product id is passed from user. > > sysfs_function(u16 pid) > { > composite_driver_unregister(&previous); > composite_driver_register(&new); > } > > But gadget function driver bind and unbind methods are marked as > __init and __exit. Is it okay to remove these macros to support this > feature? Is there a better approach to achieve this functionality? Any > pointers on how different usb devices (mostly phones) support this > functionality? Since you want to support dynamic configuration, why not use multiple USB configurations? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html