linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] usb: gadget: Fix gadget deactivaton feature
@ 2015-04-07  8:31 Robert Baldyga
  2015-04-07  8:31 ` [PATCH 1/2] usb: gadget: add usb_gadget_activate/deactivate functions Robert Baldyga
  2015-04-07  8:31 ` [PATCH 2/2] usb: composite: fix usb_function_activate/deactivate functions Robert Baldyga
  0 siblings, 2 replies; 8+ messages in thread
From: Robert Baldyga @ 2015-04-07  8:31 UTC (permalink / raw)
  To: balbi
  Cc: gregkh, linux-usb, linux-kernel, m.szyprowski, andrzej.p, Robert Baldyga

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-30 15:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07  8:31 [PATCH 0/2] usb: gadget: Fix gadget deactivaton feature Robert Baldyga
2015-04-07  8:31 ` [PATCH 1/2] usb: gadget: add usb_gadget_activate/deactivate functions Robert Baldyga
2015-04-28 16:40   ` Felipe Balbi
2015-04-29  9:08     ` Robert Baldyga
2015-04-29 15:30       ` Felipe Balbi
2015-04-30  9:08         ` Robert Baldyga
2015-04-30 15:12           ` Felipe Balbi
2015-04-07  8:31 ` [PATCH 2/2] usb: composite: fix usb_function_activate/deactivate functions Robert Baldyga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).