Gadget driver unload issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Gadget driver unload issue

跳至解决方案
2,759 次查看
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

标签 (2)
0 项奖励
回复
1 解答
2,568 次查看
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 项奖励
回复
1 回复
2,569 次查看
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 项奖励
回复