We have a discussion at http://www.spinics.net/lists/linux-usb/msg111860.html about current pullup dp limitations, this patchset is intended to fix two problems in discussion, they are: - Some function drivers (uvc, obex) can't pullup on demand, they needs to pullup dp after app loads. - Some udc drivers (chipidea) don't want to pullup dp when the vbus is not there, they have no hardware logic to avoid violating usb 2.0 spec 7.2.1 and 7.1.5. So, we can't pullup dp unconditionally at udc-core, the strateries for pullup dp at this patchset: - If the udc is ready to pullup dp and all functions at gadget driver want to pullup dp, it will pullup dp. This patchset defines one .connect API at usb_gadget_driver, and the udc driver can call it on demand, besides, we disable function default when adding it, the function driver can enable itself on demand. Tested at below gadget driver at chipidea platforms g_zero g_mass_storage g_serial configfs (mass storage/acm) Pass allmodconfig compile for this change. Tests and comments are welcome, thanks. Peter Chen (13): usb: gadget: introduce .connect gadget driver API usb: udc: set the udc is ready to pullup dp when it needs usb: gadget: composite: add .connect API for its usb_gadget_driver usb: gadget: configfs: add .connect API for its usb_gadget_driver usb: gadget: gadgetfs: add .connect API for its usb_gadget_driver usb: gadget: dbgp: add .connect API for its usb_gadget_driver usb: gadget: composite: change pullup/pulldown dp strategy usb: gadget: composite: deactivate function default usb: gadget: function: activate function at bind usb: gagdet: f_obex: delete the deactivate function operation at bind usb: gagdet: f_uvc: delete the deactivate function operation at bind usb: gadget: udc-core: change dp pullup/pulldown strategy usb: gadget: udc-core: change dp pullup/pulldown strategy for soft_connect drivers/usb/chipidea/udc.c | 9 ++++---- drivers/usb/dwc2/gadget.c | 2 ++ drivers/usb/dwc3/gadget.c | 2 ++ drivers/usb/gadget/composite.c | 27 +++++++++++++++++++++++- drivers/usb/gadget/configfs.c | 1 + drivers/usb/gadget/function/f_acm.c | 2 ++ drivers/usb/gadget/function/f_ecm.c | 1 + drivers/usb/gadget/function/f_eem.c | 1 + drivers/usb/gadget/function/f_fs.c | 1 + drivers/usb/gadget/function/f_hid.c | 1 + drivers/usb/gadget/function/f_loopback.c | 1 + drivers/usb/gadget/function/f_mass_storage.c | 1 + drivers/usb/gadget/function/f_midi.c | 1 + drivers/usb/gadget/function/f_ncm.c | 1 + drivers/usb/gadget/function/f_obex.c | 10 +-------- drivers/usb/gadget/function/f_phonet.c | 1 + drivers/usb/gadget/function/f_rndis.c | 1 + drivers/usb/gadget/function/f_serial.c | 1 + drivers/usb/gadget/function/f_sourcesink.c | 1 + drivers/usb/gadget/function/f_subset.c | 1 + drivers/usb/gadget/function/f_uac1.c | 1 + drivers/usb/gadget/function/f_uac2.c | 1 + drivers/usb/gadget/function/f_uvc.c | 6 ------ drivers/usb/gadget/legacy/dbgp.c | 12 +++++++++++ drivers/usb/gadget/legacy/inode.c | 12 +++++++++++ drivers/usb/gadget/legacy/printer.c | 1 + drivers/usb/gadget/legacy/tcm_usb_gadget.c | 1 + drivers/usb/gadget/udc/amd5536udc.c | 1 + drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++ drivers/usb/gadget/udc/bcm63xx_udc.c | 2 ++ drivers/usb/gadget/udc/dummy_hcd.c | 1 + drivers/usb/gadget/udc/fotg210-udc.c | 1 + drivers/usb/gadget/udc/fsl_qe_udc.c | 1 + drivers/usb/gadget/udc/fsl_udc_core.c | 2 ++ drivers/usb/gadget/udc/fusb300_udc.c | 1 + drivers/usb/gadget/udc/gr_udc.c | 2 ++ drivers/usb/gadget/udc/lpc32xx_udc.c | 2 ++ drivers/usb/gadget/udc/m66592-udc.c | 2 ++ drivers/usb/gadget/udc/mv_u3d_core.c | 1 + drivers/usb/gadget/udc/mv_udc_core.c | 2 ++ drivers/usb/gadget/udc/net2272.c | 1 + drivers/usb/gadget/udc/net2280.c | 1 + drivers/usb/gadget/udc/omap_udc.c | 1 + drivers/usb/gadget/udc/pch_udc.c | 1 + drivers/usb/gadget/udc/pxa25x_udc.c | 1 + drivers/usb/gadget/udc/pxa27x_udc.c | 1 + drivers/usb/gadget/udc/r8a66597-udc.c | 1 + drivers/usb/gadget/udc/s3c-hsudc.c | 1 + drivers/usb/gadget/udc/s3c2410_udc.c | 1 + drivers/usb/gadget/udc/udc-core.c | 6 ++---- drivers/usb/musb/musb_gadget.c | 2 ++ drivers/usb/renesas_usbhs/mod_gadget.c | 7 ++++++- include/linux/usb/composite.h | 4 ++++ include/linux/usb/gadget.h | 29 +++++++++++++++++++++++++- 54 files changed, 150 insertions(+), 27 deletions(-) -- 1.7.9.5 -- 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