From nobody Sat Sep 21 01:09:10 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B1BFC4321E for ; Fri, 2 Dec 2022 16:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbiLBQpW (ORCPT ); Fri, 2 Dec 2022 11:45:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiLBQpS (ORCPT ); Fri, 2 Dec 2022 11:45:18 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87FDCC9369 for ; Fri, 2 Dec 2022 08:45:17 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id vv4so12820602ejc.2 for ; Fri, 02 Dec 2022 08:45:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Y9YuQZPfQH7INMeWnExg9RJB6GIXNP96OMFwpn/eTk0=; b=MFAQf7MRaeF6KI0xct23Zt6cZ9beHfQ45/YQn5TJoIhPQAiC8wo3T8Xs4AS3lfFwCO /ZcwqonocuQ2ZbJcawBO4jwbZQvugo9TgWTqlj7Kr4VDENcfxy9D3RHNt/4OUHSmKAh5 WxIzYnLBNIeIzCdahNIOBKU4xnGtJn/uSOer0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y9YuQZPfQH7INMeWnExg9RJB6GIXNP96OMFwpn/eTk0=; b=fGmK/RcFciqYr15/YkndjzZqyMipYKTe6M87jWqzv9Tk06ewLCPKfHIx0ypTp0q0JH cuejFARpl9IyHZI3F97ShQ3yGPvL1YUoEFvESQLOOxfLX7I+k+orOCEiVU6zdiByKJwe PngUG6UiLsYwMaqCYd0Bjah7q26Xtwuwueqx1OQfAaTyZ4LNud68+MewgNWMY6OILKUf yR2XYMDomtiF43PcHbPj20XqHctM4EjGFpphHg1o3ilhRQ9W2uwAx2AxgXJnL6ng6pQM +3ZXbGIbrjTbUAahJ5GN6zFJiAWwmqbT17FKq+akqnLw+PP2YZB/cJmAaZ+x711CDbpx /Eyw== X-Gm-Message-State: ANoB5pnzc8NoIdA5hTn7wLORCMUAZ2m4e0TGgs/GmUBC93jSRhivYqdW 3Jl9Pnmd+h6VfXMb3lz4p8tKew== X-Google-Smtp-Source: AA0mqf6cQ5WOWMt57lHhYnHV9mp2aDSiTgBEhoH5l4mEIFJCrL/eOwevZFeeDU+3wya5iYPvuNZZHA== X-Received: by 2002:a17:906:28d6:b0:7c0:817c:3d38 with SMTP id p22-20020a17090628d600b007c0817c3d38mr17459544ejd.63.1669999516162; Fri, 02 Dec 2022 08:45:16 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id t15-20020aa7d4cf000000b0046c53c3b2dfsm111981edr.38.2022.12.02.08.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 08:45:15 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 17:45:06 +0100 Subject: [PATCH RESEND v2 1/2] media: uvcvideo: Limit power line control for Acer EasyCamera MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20221101-easycam-v2-1-ffe3e3a152df@chromium.org> References: <20221101-easycam-v2-0-ffe3e3a152df@chromium.org> In-Reply-To: <20221101-easycam-v2-0-ffe3e3a152df@chromium.org> To: Mauro Carvalho Chehab , Laurent Pinchart Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1795; i=ribalda@chromium.org; h=from:subject:message-id; bh=p2q94kR+vhAMdPTWu0QPZfb6YaqxhRkENb+/7vNPhJY=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjiiuXkfHKoKbGsfejnSL9XOArIlm3zi731T00oRh6 MZmU7QaJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4orlwAKCRDRN9E+zzrEiGbGD/ 9dJlDD4glfqsu2BFSqEpdWEJB5+aIi2c37rimUb+0zr/GzV9+1JjZiWl7YIQVI1EmcmD82hs2T11aK oZDjJwC4OqgsLgAtlEOKmHr6+qGTKbWi3u5NBN+uhN+uYea01lKMjWeeibpfAwQ1nYyiM2d74/Tpud gD1X74V5QZVsMuB2StZg8HfUwhE310bPB0cgyw212v2dHUPRzIGWzaAXk8dPxnwMuV/vlQnXtdmMFN MT5T0mue6Ba3ohg5ERAtw63hA4mhMNRYH3++3ClRjgJ/KMwFZqQasScO18ZeFQX2VQvguPk0V1eSkr qbcQko+663P2S06W1ekrPAIlrSJGntZOV7vmlzuRrJnMX77VFcWb4qCM2dZjOlKUrAKlXVWOYdR5B4 1t2Ez6qvw300rZQhrUpLsNU5l6k/Zce9UT1Jw/Jbs2Zoph01kkA90uyz7WxuNxTrHQZiqONUS2aVLG vckY+Z0s+PehvHbqNJ2rKVpnxq0XIO+aywap0qpRrxMoNa5n135PiGv4mJefFF9PI7KmhvhppSt+vR jAv1NM2dzK9em1yxIOck5aVC23vC/VSSwwrvdoSoTzz3rYY4E+xCRhhhUP5FfMSP4vrW2YTTIb20gx aPPAjJnU+hh4mTrMOKdQosoZv/+uO4HByupsDy6lB5ae1OgG7TEQnVgySPvw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device does not implement the power line control correctly. Add a corresponding control mapping override. Bus 003 Device 002: ID 5986:1180 Acer, Inc EasyCamera Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x5986 Acer, Inc idProduct 0x1180 bcdDevice 56.04 iManufacturer 3 Bison iProduct 1 EasyCamera iSerial 2 bNumConfigurations 1 Signed-off-by: Ricardo Ribalda Reviewed-by: Sergey Senozhatsky Reviewed-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc= _driver.c index 215fb483efb0..cca3012c8912 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2994,6 +2994,15 @@ static const struct usb_device_id uvc_ids[] =3D { .bInterfaceSubClass =3D 1, .bInterfaceProtocol =3D 0, .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, + /* Acer EasyCamera */ + { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor =3D 0x5986, + .idProduct =3D 0x1180, + .bInterfaceClass =3D USB_CLASS_VIDEO, + .bInterfaceSubClass =3D 1, + .bInterfaceProtocol =3D 0, + .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* Intel RealSense D4M */ { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, --=20 2.39.0.rc0.267.gcb52ba06e7-goog-b4-0.11.0-dev-696ae From nobody Sat Sep 21 01:09:10 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE59DC4321E for ; Fri, 2 Dec 2022 16:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234022AbiLBQp0 (ORCPT ); Fri, 2 Dec 2022 11:45:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233765AbiLBQpT (ORCPT ); Fri, 2 Dec 2022 11:45:19 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AB54C7267 for ; Fri, 2 Dec 2022 08:45:18 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id l11so7231478edb.4 for ; Fri, 02 Dec 2022 08:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sWhyuOgAR3tJq3LBvDj1lg7AzkgIK7zVd0B6OOAMYrY=; b=AL1rW8hDe+2RKMwRiTR/ZNF/A2WEZBPkWHi+/CSPJfeph6tMJsbJnA1lfzQqk1P8eM hOqPlGXy+U8VAUnbjqrWymUMrFyVF+SgPeHO/eFaj7pZcFqKCcuA2K19KNx/W2m0m4yf kjSmhsRtyrOl5eFNywQAllUboagtfP92WQYTE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sWhyuOgAR3tJq3LBvDj1lg7AzkgIK7zVd0B6OOAMYrY=; b=yWBTp728+4N9lweXDGiAmX3O1Rr6WhCHCZXDoox8ukgYKfPYpDVF38QL7EoTk3u1CW KUPa6kqiOBEGjhcBWuZhDM4Ml/V34IGUEd4ZXjdBWvWGnuG5rhOTZLKCzeACaUJwxFCY 83416H/ykD5xvNcmtQP4J7xuQdMdXQWb3qhbHQ0GVVE2Etcjt7c6yfMdwVunAyR0Jsiw 3ofR/oxdFv6yBcGPSmJjdFKYWpJuUYZm7aXdAxxvQ0wBmsr3Vr9wHm3vBnr2M4i1FaAS u9aDBARLun54+pnigLdaLbEX2+2sFvnEc3RM5tXJxGutzPcafqd003OwI/7ViF+vS7gK syBg== X-Gm-Message-State: ANoB5pkuY0U/KHxoAwPShToQToYA0JvwUxgJzjtVng/ne2r3ym5wX1mm s5L0HpnIEyk1O5a9CRJyFhcQShKHlYPA2bEGInE= X-Google-Smtp-Source: AA0mqf7lNjEvvs8jGNFvAsLuQXF6RZVHwpRRANujMCTbcveNhpdvovCHVLkVPx3jYI+5uqlQ7IFPTg== X-Received: by 2002:aa7:d7d4:0:b0:46b:7f11:10a4 with SMTP id e20-20020aa7d7d4000000b0046b7f1110a4mr15910247eds.59.1669999516951; Fri, 02 Dec 2022 08:45:16 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id t15-20020aa7d4cf000000b0046c53c3b2dfsm111981edr.38.2022.12.02.08.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 08:45:16 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 17:45:07 +0100 Subject: [PATCH RESEND v2 2/2] media: uvcvideo: Limit power line control for Lenovo Integrated Camera MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20221101-easycam-v2-2-ffe3e3a152df@chromium.org> References: <20221101-easycam-v2-0-ffe3e3a152df@chromium.org> In-Reply-To: <20221101-easycam-v2-0-ffe3e3a152df@chromium.org> To: Mauro Carvalho Chehab , Laurent Pinchart Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=2864; i=ribalda@chromium.org; h=from:subject:message-id; bh=C/uBBpj4LsicA+QlhxpKIRS8BFwjHReaadkNXEaD+Nc=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjiiuZJWESF3BxOdqAjgp0C3Jsv6F0jNqcC1ZU4CdH UUdkhGWJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4ormQAKCRDRN9E+zzrEiPK9D/ 9QeMT7lYBXRdBOQ812IZfZQ0GVB0/83V8HrFXZf+B2xf9CAfZXwv59wrGhz9FhIqCKD9ki3N+JLUEq rSbqtGSRrrg1OJPdbx/l+zSVK0sOTXr71SV8Ep4OkXLDcWWocJZoBF2Q6KOOOxgIyK4A6/z5ElGh3s sm/WldlblGSZUceINf6J1PA5WODq6E+5MVzwtdltP+MjfPQreQkt9DQyZIXfklKtTCVOg8W+TdELvE 2AFVe/8qb2PBGLCEuo6XVk1rdDzxKdaXt6nxBxCgbOIu49//z69Br89jdwVEbCkMvHrx38Fzt7/l2v V08DvYdIUYLuMQh2271aZSGSfdGSMXctQrxvRw4zvCTwDxXmeJzMBJgJSzXZmD8QagIFsK8yocGNK4 MOKiJa6KYuOfXox6mBD/Utiq1x3GChBAJingbKnAlZuuVr2+rZcbkWASI0ZCdWZ53VUKBDKX64qevX mTgIW9CkcLaLLtVmlaXJ6C9ecP6tafkjNTYydi7uqTSIAXWog2JWomusA9H0MN6epYW2QlS0PJZHWG Vau9N5BJqi05wdyjBtNoTMt5z61HJoTs9mouqat7tyIhDQXaeNAYt+zziV/3TyG0T6uSv7iDNTpoin bloE9k7OCFhyFWjLJ8gd9f43oQLxgKcQrNEkYWOaqlAV25xp8utKGU36xFLw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device does not implement the power line control correctly. Add a corresponding control mapping override. Bus 003 Device 002: ID 30c9:0093 Lenovo Integrated Camera Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x30c9 idProduct 0x0093 bcdDevice 0.07 iManufacturer 3 Lenovo iProduct 1 Integrated Camera iSerial 2 8SSC21J75356V1SR2830069 bNumConfigurations 1 Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc= _driver.c index cca3012c8912..e0bb21f2e133 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2373,6 +2373,30 @@ MODULE_PARM_DESC(timeout, "Streaming control request= s timeout"); * Driver initialization and cleanup */ =20 +static const struct uvc_menu_info power_line_frequency_controls_uvc11[] = =3D { + { 0, "Disabled" }, + { 1, "50 Hz" }, + { 2, "60 Hz" }, +}; + +static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11 = =3D { + .id =3D V4L2_CID_POWER_LINE_FREQUENCY, + .entity =3D UVC_GUID_UVC_PROCESSING, + .selector =3D UVC_PU_POWER_LINE_FREQUENCY_CONTROL, + .size =3D 2, + .offset =3D 0, + .v4l2_type =3D V4L2_CTRL_TYPE_MENU, + .data_type =3D UVC_CTRL_DATA_TYPE_ENUM, + .menu_info =3D power_line_frequency_controls_uvc11, + .menu_count =3D ARRAY_SIZE(power_line_frequency_controls_uvc11), +}; + +static const struct uvc_device_info uvc_ctrl_power_line_uvc11 =3D { + .mappings =3D (const struct uvc_control_mapping *[]) { + &uvc_ctrl_power_line_mapping_uvc11, + NULL, /* Sentinel */ + }, +}; static const struct uvc_menu_info power_line_frequency_controls_limited[] = =3D { { 1, "50 Hz" }, { 2, "60 Hz" }, @@ -2976,6 +3000,15 @@ static const struct usb_device_id uvc_ids[] =3D { .bInterfaceSubClass =3D 1, .bInterfaceProtocol =3D 0, .driver_info =3D UVC_INFO_QUIRK(UVC_QUIRK_FORCE_BPP) }, + /* Lenovo Integrated Camera */ + { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor =3D 0x30c9, + .idProduct =3D 0x0093, + .bInterfaceClass =3D USB_CLASS_VIDEO, + .bInterfaceSubClass =3D 1, + .bInterfaceProtocol =3D UVC_PC_PROTOCOL_15, + .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 }, /* Sonix Technology USB 2.0 Camera */ { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, --=20 2.39.0.rc0.267.gcb52ba06e7-goog-b4-0.11.0-dev-696ae