mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
usb: gadget: udc: core: fix uvc gadget disconnect issue
This patch fix the issue that users fail to do a logical
disconnection from the USB Host via the kernel node:
/sys/class/udc/<udc>/soft_connect
Fixes: 3099e13bdb ("usb: gadget: f_uvc: support uvc and adb use independently")
Change-Id: I2a19f72dc0a5dc34e430d384f5b475b488731311
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -682,11 +682,9 @@ int usb_gadget_disconnect(struct usb_gadget *gadget)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!gadget->uvc_enabled) {
|
||||
ret = gadget->ops->pullup(gadget, 0);
|
||||
if (!ret)
|
||||
gadget->connected = 0;
|
||||
}
|
||||
ret = gadget->ops->pullup(gadget, 0);
|
||||
if (!ret)
|
||||
gadget->connected = 0;
|
||||
|
||||
out:
|
||||
trace_usb_gadget_disconnect(gadget, ret);
|
||||
@@ -713,7 +711,7 @@ int usb_gadget_deactivate(struct usb_gadget *gadget)
|
||||
if (gadget->deactivated)
|
||||
goto out;
|
||||
|
||||
if (gadget->connected) {
|
||||
if (gadget->connected && !gadget->uvc_enabled) {
|
||||
ret = usb_gadget_disconnect(gadget);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user