patch "usb: chipidea: otg: gadget module load and unload support" added to usb-linus
Subsystems (3)
This is a note to let you know that I've just added the patch titled
usb: chipidea: otg: gadget module load and unload support
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
85da852df66e5e0d3aba761b0fece7c958ff0685Mon Sep 17 00:00:00 2001
From: Li Jun <[email protected]>
Date: Fri, 12 Dec 2014 09:11:42 +0800
Subject: usb: chipidea: otg: gadget module load and unload support
This patch is to support load and unload gadget driver in full OTG mode.
--- drivers/usb/chipidea/udc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/usb/chipidea/udc.c +17 -0
@@ -1751,6 +1751,22 @@ static int ci_udc_start(struct usb_gadget *gadget,return retval; } +static void ci_udc_stop_for_otg_fsm (struct ci_hdrc *ci) +{ +if (!ci_otg_is_fsm_mode (ci)) +return ; + +mutex_lock (&ci->fsm.lock); +if (ci->fsm.otg->state ==OTG_STATE_A_PERIPHERAL ) { + ci->fsm.a_bidl_adis_tmout =1 ; +ci_hdrc_otg_fsm_start (ci); + }else if (ci->fsm.otg->state ==OTG_STATE_B_PERIPHERAL ) { + ci->fsm.protocol =PROTO_UNDEF ; + ci->fsm.otg->state =OTG_STATE_UNDEFINED ; + } +mutex_unlock (&ci->fsm.lock); +} +/** * ci_udc_stop: unregister a gadget driver */
@@ -1775,6 +1791,7 @@ static int ci_udc_stop(struct usb_gadget *gadget) ci->driver =NULL ;spin_unlock_irqrestore (&ci->lock, flags); +ci_udc_stop_for_otg_fsm (ci);return 0 ; }
Signature · 1 line
2.6.2