Gadget driver unload issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Gadget driver unload issue

Jump to solution
1,606 Views
hardikpadhariya
Contributor I

We are working on i.mx6ul based custom board and using L4.1.15-1.2.0.

Our requirement is to support  g_serial, g_hid, g_mass_storage drivers over USB OTG port. We are facing one issue that  unloading the USB gadget driver does not remove the device from PC. For example, if we unload the g_serial then host PC shows com port and if we unload the g_mass_storage driver then also host PC shows the device.

Is there any way so that device gets automatically disconnected from  PC after removing the gadget driver?

Regards,

Hardik

Labels (2)
0 Kudos
Reply
1 Solution
1,415 Views
igorpadykov
NXP Employee
NXP Employee

Hi Hardik

one can try to debug it using description in sect.65.6.18 USB Command Register (USB_nUSBCMD)

i.MX6DQ RM:

RS: Writing a 0 to this will cause a detach event.

RST: In order to ensure that the device is not in an attached state before initiating a device controller reset,

all primed endpoints should be flushed and the USBCMD Run/Stop bit should be set to 0.

One can check "remove" events in usb driver sources described in sect.39.2.2 Source Code Structure

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
---------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
1,416 Views
igorpadykov
NXP Employee
NXP Employee

Hi Hardik

one can try to debug it using description in sect.65.6.18 USB Command Register (USB_nUSBCMD)

i.MX6DQ RM:

RS: Writing a 0 to this will cause a detach event.

RST: In order to ensure that the device is not in an attached state before initiating a device controller reset,

all primed endpoints should be flushed and the USBCMD Run/Stop bit should be set to 0.

One can check "remove" events in usb driver sources described in sect.39.2.2 Source Code Structure

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
---------------------------------------------------------------------------------------------------------

0 Kudos
Reply