Messages in this thread | | | From | Robert Baldyga <> | Subject | [PATCH 0/2] usb: gadget: Fix gadget deactivaton feature | Date | Tue, 07 Apr 2015 10:31:51 +0200 |
| |
Hi,
This patch set introduces two functions usb_gadget_deactivate() and usb_gadget_activate(), designed to prevent udc-core from showing binded gadget to host until it will be ready to work. It also makes usb_function_deactivate()/activate() using these functions.
So far gadget deactivation was made by calling usb_gadget_disconnect(), but since we have usb_gadget_connect() called after gadget->bind() (in udc_bind_to_driver()) this method doesn't provide expected result. Calling function usb_gadget_disconnect() before gadget connection doesn't prevent udc-core from connecting gadget to driver - usb_gadget_disconnect() call is ignored and gadget is connected regardless to it. This usually results with errors, for example because we binded gadget with 0 configurations.
This patch set fixes this problem adding functions allowing to perform effective gadget deactivation from gadget->bind().
Best regards, Robert Baldyga
Robert Baldyga (2): usb: gadget: add usb_gadget_activate/deactivate functions usb: composite: fix usb_function_activate/deactivate functions
drivers/usb/gadget/composite.c | 4 +- include/linux/usb/gadget.h | 100 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 96 insertions(+), 8 deletions(-)
-- 1.9.1
| |