[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240731122351.GU8146@pendragon.ideasonboard.com>
Date: Wed, 31 Jul 2024 15:23:51 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: 胡连勤 <hulianqin@...o.com>
Cc: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"dan.scally@...asonboard.com" <dan.scally@...asonboard.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"opensource.kernel" <opensource.kernel@...o.com>
Subject: Re: 答复: [PATCH v2] usb: gadget: uvc: Fixes the abnormal
enumeration problem of mobile phone as UVC camera.
On Wed, Jul 31, 2024 at 11:49:11AM +0000, 胡连勤 wrote:
> When the phone is connected to the computer to use the webcam function,
> the phone needs to be enumerated as a uvc camera function.
>
> Because uvc->func.bind_deactivated is configured as true in the f_uvc
> driver uvc_alloc function, the usb_gadget_deactivate function is called
> during the execution of the configfs_composite_bind function to
> set gadget->deactivated to true, which in turn causes the
> usb_gadget_connect_locked function to fail to call the corresponding
> controller pullup operation (such as: dwc3_gadget_pullup,
> mtu3_gadget_pullup), and the USB cannot be enumerated
> normally under the uvc function combination.
>
> After applying this patch, we measured that under the uvc function,
> the dwc3 controller and the mtu3 controller can be enumerated normally,
> and the webcam function is normal.
>
> Fixes this by removing the setting of uvc->func.bind_deactivated to true.
>
> Signed-off-by: Lianqin Hu <hulianqin@...o.com>
> ---
> v2:
> - Add "Fixes:" tag on the commit
> - Modify description information.
> ---
> drivers/usb/gadget/function/f_uvc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
> index 40187b7112e7..6d63bea14211 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -1107,7 +1107,6 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
> uvc->func.disable = uvc_function_disable;
> uvc->func.setup = uvc_function_setup;
> uvc->func.free_func = uvc_free;
> - uvc->func.bind_deactivated = true;
This is done on purpose. The UVC function requires a userspace control
application, so the function is deactivated by default at bind time, and
gets activated when the application is ready.
This patch isn't right.
>
> return &uvc->func;
>
> --
> 2.39.0
>
>
> -----邮件原件-----
> 发件人: gregkh@...uxfoundation.org <gregkh@...uxfoundation.org>
> 发送时间: 2024年7月31日 19:13
> 收件人: 胡连勤 <hulianqin@...o.com>
> 抄送: akpm@...ux-foundation.org; linux-kernel@...r.kernel.org; opensource.kernel <opensource.kernel@...o.com>
> 主题: Re: [PATCH v1] usb: gadget: uvc: Fixed the abnormal enumeration problem of mobile phone as UVC camera.
>
> On Wed, Jul 31, 2024 at 08:45:31AM +0000, 胡连勤 wrote:
> > When the phone is connected to the computer to use the webcam
> > function, the phone needs to be enumerated as a uvc camera function.
>
> <snip>
>
> Note, why aren't you using scripts/get_maintainer.pl to find the proper mailing list and developers for this change? Please do so.
>
> thanks,
>
> greg k-h
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists