From patchwork Tue Jan 3 11:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 38376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4552595wrt; Tue, 3 Jan 2023 03:04:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtf4HtmYED+tYkp5KymVpANY7jBGO5hzUWtxidQ/z2y4zSE2iFYvUImpeDR58M1x4YNcmpl X-Received: by 2002:a05:6a20:be15:b0:ad:5cee:4d0 with SMTP id ge21-20020a056a20be1500b000ad5cee04d0mr36563339pzb.12.1672743874341; Tue, 03 Jan 2023 03:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672743874; cv=none; d=google.com; s=arc-20160816; b=m5RtzZQWmnNtHZcbVzk9oamirOn0nO5y59EH38lPE9H0in5eKPvsZ+N0zebVgFAl4v oMcaPoQcFqGj/4jzGKn0Fvqtb19ihHB8QYMRezbsSbWvDXMc/B4tHwjNJvX2OufLc/c1 a6col7kevCk79IVD+xCfLPJ3owI839stlaquSMhQF35WTRZQwOnqXeTaG7x9iw7neaOZ yCNzcSUnYY9+ecCW2RlrdzZ9pSWh+3oHucr+IJEdqCTZX30y40NPBbAl5u9SZ4oV7/ge D73yQiyAE6wWqmgB3rEAIuSxr+ix00Etk+ljURehE9JtW4eVIiKO/jJKDoj6nMxOUZsO SzvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Co9IVvG+/S6WvoqX0pBLNaNrTdqsJyhBz/38h+pUNcQ=; b=ovTKRwccvfdOImc4UwhK6RNLGb50YRf+pe/dHjJEKpUsLcvp45F/YgR2fHmLE5of8k YNP5zQFe9ykcvLg8Ek94GAAJcGz4pC4XS4Abo8D6OY6XwCd8p1JE7EzHJyT+awXTxqDW HEvlYnGns2rMTo9FhWyLFo7ZgZTMtJgvo05ULgEZx4V7DGa2t8QFCAGINijIhbM2eDff Gazrrsnl1m1ZaHlK6y3LBVN7M7u+eMomaNTl+soOxxd8gdflkQTYg8tdHQIVvwd+r2ue cssqezf1AjrI0godZ2inoDK36KdUzreEljy5M6U2tC6/dMPtM2Jev0c42w8rJ+tZ4BsH XIjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PNXXFXIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a656bc7000000b00476bfc9e1f5si31531339pgw.610.2023.01.03.03.04.17; Tue, 03 Jan 2023 03:04:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PNXXFXIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237460AbjACLCL (ORCPT + 99 others); Tue, 3 Jan 2023 06:02:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237168AbjACLB4 (ORCPT ); Tue, 3 Jan 2023 06:01:56 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ED6110D9 for ; Tue, 3 Jan 2023 03:01:55 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id m18so72609164eji.5 for ; Tue, 03 Jan 2023 03:01:55 -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=Co9IVvG+/S6WvoqX0pBLNaNrTdqsJyhBz/38h+pUNcQ=; b=PNXXFXIq+faqpY2Liq7EY/E7M78Zi+NAF2s5xp+2bI1depV/ZFGgtfGg3DaeAmlK2w 77aqj/inIHQokfyHkn1PvhTYD4WQuxdkQKud4EUbOQlrBPpp70eenxPZnumWgnNbeyHK NfeGLIwhNoGllFYDPc/UDKAG/gCrb0NsNCir4= 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=Co9IVvG+/S6WvoqX0pBLNaNrTdqsJyhBz/38h+pUNcQ=; b=MQQnlHWZoOe0uD+HwEXG0evbMagzMcbv+Rz/qQE/KS3/NHouDZLX5hbIwbreVIK3Q8 M/Gno3hNuyimNCkpbBj2+HchQfUnDnyyAdGhPQR0Oo4fRZZaurouM0jTIcjYEXVDViZa UZUL5DguIjwY9KHRmCRCDJUxoeKYEGJoBPqjYJmN4/sMTC3wgk1HvpZsSfyP2MqTXrUI h8XJXXKMAzQ+/23MxxcvV4iE2vAlCJchEa2r/A+8qwcyNlDIML/shwi7xQgWBff11Peo mftl/w5J7WS1CRw+g/U5qqqNSxoonbRK09emmEcUDpYiFRef1JnurtgyjZzSeEI8ZGsf BIXw== X-Gm-Message-State: AFqh2koeE/WMNwCaWAFVBSi3xJZpwDMnT6Z4ONw8AikLgeClxYVXxwUU hmyHgFi/5+F1PVlNmACmx4qzdbJOxXt9OCQ13+c= X-Received: by 2002:a17:907:6e16:b0:7e0:eed0:8beb with SMTP id sd22-20020a1709076e1600b007e0eed08bebmr50674638ejc.41.1672743714098; Tue, 03 Jan 2023 03:01:54 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:ef23:1430:9acc:b68]) by smtp.gmail.com with ESMTPSA id l12-20020a17090615cc00b007c0cd272a06sm13944331ejd.225.2023.01.03.03.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 03:01:53 -0800 (PST) From: Ricardo Ribalda Date: Tue, 03 Jan 2023 12:01:21 +0100 Subject: [PATCH v3 1/3] media: uvcvideo: Limit power line control for Acer EasyCamera MIME-Version: 1.0 Message-Id: <20221101-easycam-v3-1-2c9881a7a4f7@chromium.org> References: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> In-Reply-To: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Ricardo Ribalda , linux-kernel@vger.kernel.org, Sergey Senozhatsky X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1859; i=ribalda@chromium.org; h=from:subject:message-id; bh=rO1fkJL8+8p1iNyVTD4jSQz4HIqEXb4KMbzC4AEwi/0=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjtAsZuAFlyAU0OVj1MY8bdt/khTMDCzwe3OKTs8DM bi51/RSJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY7QLGQAKCRDRN9E+zzrEiM8gD/ 9/PDhrsZcm4p8YEssdUzKS1CTASCQ6oDA6Je7r2pDnjab0mpapPCh1Gur5rqkAMGtSkiMHQhYMblWZ Ic/HIIWaQgEoQaY/K++MqsT+D8pvG0G/BEa0JZaSQ2btZBw1va2+znLxCuet8juawAAGCiho1ZaW1l x5QvEmNlXtrfC/0RJkThtbZ2tqq1Me+ZGEhy9Qv5KhqXUezod2pcYX4QrthCW/Lo0XnBuOCNgH/Al6 pUbqA658hjtsmeEFEzZEQw8d3CGDDlwbzfLDJh1w3cwDcu7dZIvxrXQ6aqCyCRLGdRcFd2E2z8WOmm bSselOPrt4FsONFb8r5W7BfWLIY5WsQTkfDnLIG+DBV3NvFA3+QOLvyXCND8eODA7gdWUEc4Ir6zP3 hA0TA9ZzAwLSBy8PQP0r1Yxe/zFFNawesdyFDOAnT5rJF8nGbs0/NuAkBflf8lkLS8pGnSAEGN8U+Y HI/rnLFDLXhmezNbdK6mXbNbrzcYT6x+PM48P2FaixjZOhgJGf5Aef22geEBomVmOy3vnLtCUvqXv4 J3hxP1y0t9QJL70J077umXvdQTOO1N3EZlQ96rnQnq+e9j0H/6cKh1+DX1eafOYvKJlngsmv4t43iH 7Yv6DQD0bS53NCtDuffsDRX5FcPefJsUOpIvckQq1UpQpSvmWpjh8rV+vRkg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753999080696624476?= X-GMAIL-MSGID: =?utf-8?q?1753999080696624476?= 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 Reviewed-by: Sergey Senozhatsky Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- 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 e4bcb5011360..f2abd9d0c717 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2991,6 +2991,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, + /* Acer EasyCamera */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x5986, + .idProduct = 0x1180, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* Intel RealSense D4M */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, From patchwork Tue Jan 3 11:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 38378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4552784wrt; Tue, 3 Jan 2023 03:05:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXsXoC5ofLVlsp/wh8M4+XC0FKNVOLsjIUl3byMUP8YbL1mqATtBWTeo3h0cd9kH0PPoaZcQ X-Received: by 2002:a17:90b:4d8c:b0:21d:ef10:d6ca with SMTP id oj12-20020a17090b4d8c00b0021def10d6camr45670776pjb.45.1672743903533; Tue, 03 Jan 2023 03:05:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672743903; cv=none; d=google.com; s=arc-20160816; b=QsQU3Odsq4sWH6D98WelLIjcWygNBeuGvkaIPqqUWbGcf7HWsW+BL7G+r93eKoMHzj rHVy+Uw8xNsirYLqrtZZ6xvoquXbUXGv420MXQt3ImmTv1hvg/WHiVPABSnK3fIWamfi M7KXNe0LJKaJCIIqMWYxg90pGaxtrAur6HUPvNz3pCr0FtZnG5GWCSQYk5jWJGRJ15wh EuiyUWYuNlsplg6xrluOiicjeNDq65Cw9Tv/TaUMcHdUhOCIjIjJpKAkplxSVEUUWKUm IZ4HNzzHEcNJkNKLP62Ag76imLHfXLE9MQ3g0kyfNzvdtwswZLMwg1sxcQjR+GU0zkpF FlYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=oLHiG2/HZCrES/DrgZpQvyLSgThQWWZsxAbqNPZVrVE=; b=bBXP4M+mKFnQjse2unD/vTPgKI09ZUjI/FQjInPyHEK/TFd1JINOdQpLgtrTat9P+F 19+I/Hvra4LUQ9Ewlc9XQKMY8SAYRVHlt9KsOFvm7wJ8f0twiDhD1GZKPIGi9p0JHNCO zM6GgATR/ePIS7LBS/2De5xKnNci59khvXRm4Fabcf1NPNu/gFto97HQPH7oF3cnlzqc jUPRqcbPxga7Fe27WB9H6qjrT1LVxtgN3olwKK8d59o03DKPbcgsfFZvjXj4jUfIUCtF J+fH8iJDLOes8qx3uOkXfAiDSxmkSWPSaIE6DIluOqHkOwVVvteOAVpuu3sgdTw6NpHp e3zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CEEm3P2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot1-20020a17090b3b4100b0021f249ab6acsi36405564pjb.139.2023.01.03.03.04.47; Tue, 03 Jan 2023 03:05:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CEEm3P2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237471AbjACLCT (ORCPT + 99 others); Tue, 3 Jan 2023 06:02:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237254AbjACLB5 (ORCPT ); Tue, 3 Jan 2023 06:01:57 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACD82B84 for ; Tue, 3 Jan 2023 03:01:56 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id ud5so72750612ejc.4 for ; Tue, 03 Jan 2023 03:01:56 -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=oLHiG2/HZCrES/DrgZpQvyLSgThQWWZsxAbqNPZVrVE=; b=CEEm3P2LtIOATwjZmOZkyiYIqCJW9YqXW6w03C8/UCOaxmvQi/pQj33Xnh+N4hlrqn /CmqjsTp0Bz5yU1v6t18xkZ4YbJJCY1+RBZZQViBmzylM0PoqLhvJo+MZM23Qf3jtMpW 1EJyg1fvu6xoRcm5SOXaQUTfbti0KNnIgh108= 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=oLHiG2/HZCrES/DrgZpQvyLSgThQWWZsxAbqNPZVrVE=; b=G1xL0Y4xqtkXtWtbOEThDxSx7HSo5dvdGe7OMX5/vVftWUrFlSQobnWs6nTFi/ZuhY p8GksL8pf1lFA/GLQkKlEWgX+9kd7x8L6eAb54hMSdLxzdTYuhvL5xSP2uUg32IY+YYD JhI4Ctkmo2Dlx+jr4SU7/S7YYJ41rAfwVEX4tSyNwSDskHZyegAIvZs2h/CGNgA3w8pc ozqohHTEM16kx3ursyOPrMhvYZlEzVksOoLAvAv2AeYwvNEH0hPjz3kBOaL0fN/LCL7W RqjvBuAjandrIUXfbf3619Xrbz8eTfmbrXIk1LNHG5YQh9iJZvvbj6cciOa4Sw4NpauS jrvA== X-Gm-Message-State: AFqh2kr2gMShXcRbz5A4Fgffo7myJfuniYW2ZvDm6Owcc+w70yXHwGQ5 48NLywUhITIMwo+wZ34mbG8+qXVM/pOp652Ixdw= X-Received: by 2002:a17:906:8a58:b0:7c1:6981:d062 with SMTP id gx24-20020a1709068a5800b007c16981d062mr38343338ejc.72.1672743715095; Tue, 03 Jan 2023 03:01:55 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:ef23:1430:9acc:b68]) by smtp.gmail.com with ESMTPSA id l12-20020a17090615cc00b007c0cd272a06sm13944331ejd.225.2023.01.03.03.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 03:01:54 -0800 (PST) From: Ricardo Ribalda Date: Tue, 03 Jan 2023 12:01:22 +0100 Subject: [PATCH v3 2/3] media: uvcvideo: Fix power line control for Lenovo Integrated Camera MIME-Version: 1.0 Message-Id: <20221101-easycam-v3-2-2c9881a7a4f7@chromium.org> References: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> In-Reply-To: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Ricardo Ribalda , linux-kernel@vger.kernel.org, Sergey Senozhatsky X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=4320; i=ribalda@chromium.org; h=from:subject:message-id; bh=aVaHYg3fgCdhxZASYM8cTLyzA416I2c/ZaUb71RRnqw=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjtAsbudZAvvY0e2cnZ4mS9Nw0UE7sLMQulDaoLqtH vwNuXSaJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY7QLGwAKCRDRN9E+zzrEiOQ5D/ 9/QtPLeDQ/64Xi0sCu9rrTnf0fQz4ST0OwuHblALX37OG1S8cbn4M44DyhmCDYgch5jEl9oqkWJ7cF cbiAK/M5P563+slzAcfWocrg20GAffefszR4AimaUOy5EEox1vElV4KkzGB62VZPBSUOsc5fSuQaMI 6HcUHGe86v0tQ1eVmGxA0o3XfjY0pddw/bbOYRAdf4301R3ORXQRY/s9Pd1fCcPYtsIF6BPEOPQt93 2vTxot/iAgTL5YxZZmjX9gI+6YZxpD1zmtnOuae89goXd60YZVDqJFwQ2gLtzxLqFskCZCJGYkvywj mDu+c6tcud6Ur+1A1I+YUZYrQ5TdXJa6SBR6HRNYIKgCIKXV9Q9uvGu4qWSPSRVwJ5lOaSMF9+qKna XDyaYvgZzWE1CXlg7AMK8eFCUxV2UsAVfa+CbLgo29pgg8xwABcF52LZJ8ncnE6v5IFMpPFlTR7fJY 7XmrANynp0a7j6t2X4hbrnNT76ioQE9XsPDUzY2fpSJnfjGNaL90cecSBO8lGu5l5SNWtnnpeh3/Ff /baD6GcGXSN8WCNPDbkkOG6JS9H0W8v7eK7YHnjmos3PpNxMP7bniFdPiQIg2Az7xknBjkksMlKfCL /fJB81iOUUEisXmnBELWgkFAY+qkQ3ZotKczH+yN5qMWV5Rh5Ma4lBKJKJ5A== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,SUBJECT_DRUG_GAP_L autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753999111287368494?= X-GMAIL-MSGID: =?utf-8?q?1753999111287368494?= The device does not implement the power line control correctly. It is a UVC 1.5 device, but implements the PLC control as a UVC 1.1 device. Add the 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 Reviewed-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_ctrl.c | 24 +++++++++++++----------- drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++ drivers/media/usb/uvc/uvcvideo.h | 1 + 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index c95a2229f4fa..d8283d71bc96 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -721,18 +721,20 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = { }, }; +const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11 = { + .id = V4L2_CID_POWER_LINE_FREQUENCY, + .entity = UVC_GUID_UVC_PROCESSING, + .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, + .size = 2, + .offset = 0, + .v4l2_type = V4L2_CTRL_TYPE_MENU, + .data_type = UVC_CTRL_DATA_TYPE_ENUM, + .menu_info = power_line_frequency_controls, + .menu_count = ARRAY_SIZE(power_line_frequency_controls) - 1, +}; + static const struct uvc_control_mapping uvc_ctrl_mappings_uvc11[] = { - { - .id = V4L2_CID_POWER_LINE_FREQUENCY, - .entity = UVC_GUID_UVC_PROCESSING, - .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, - .size = 2, - .offset = 0, - .v4l2_type = V4L2_CTRL_TYPE_MENU, - .data_type = UVC_CTRL_DATA_TYPE_ENUM, - .menu_info = power_line_frequency_controls, - .menu_count = ARRAY_SIZE(power_line_frequency_controls) - 1, - }, + uvc_ctrl_power_line_mapping_uvc11, }; static const struct uvc_control_mapping uvc_ctrl_mappings_uvc15[] = { diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index f2abd9d0c717..9c09bc988278 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2370,6 +2370,13 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout"); * Driver initialization and cleanup */ +static const struct uvc_device_info uvc_ctrl_power_line_uvc11 = { + .mappings = (const struct uvc_control_mapping *[]) { + &uvc_ctrl_power_line_mapping_uvc11, + NULL, /* Sentinel */ + }, +}; + static const struct uvc_menu_info power_line_frequency_controls_limited[] = { { 1, "50 Hz" }, { 2, "60 Hz" }, @@ -2973,6 +2980,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_FORCE_BPP) }, + /* Lenovo Integrated Camera */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x30c9, + .idProduct = 0x0093, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = UVC_PC_PROTOCOL_15, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 }, /* Sonix Technology USB 2.0 Camera */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index df93db259312..bcb0b0c101c8 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -728,6 +728,7 @@ int uvc_status_start(struct uvc_device *dev, gfp_t flags); void uvc_status_stop(struct uvc_device *dev); /* Controls */ +extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11; extern const struct v4l2_subscribed_event_ops uvc_ctrl_sub_ev_ops; int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, From patchwork Tue Jan 3 11:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 38380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4553046wrt; Tue, 3 Jan 2023 03:05:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXssunvHZtQYKoAcMLSYWXGRATdWbC29QQotryAqbcf0/tMMpOkputYY+QSoqVDpbIUhHbec X-Received: by 2002:a17:902:bd42:b0:192:4d3e:a573 with SMTP id b2-20020a170902bd4200b001924d3ea573mr41559147plx.24.1672743943334; Tue, 03 Jan 2023 03:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672743943; cv=none; d=google.com; s=arc-20160816; b=XxhJLNs8CFxC+rcY45CTPzaZ8dGdFBrWXRR4cBhLJITtRKdGqaGQnwkU6sU7ZOmNys 80RFZIF2q1m4QJqCh0I1cLwmFpM7bPJF7KJOKiPcxG4DmuCmOHaNwGMPcsFlO0i/teaS fc+dS2YT/matxV9MgVs2bPpwePBsNJx2H2ar4vuwtE6TozaXyz4QQmY4vdut1lOjBE/6 /h8tv90mDBRibmvOWBqNbT9yCbQms99p3FLE4k4BUsVTgZ2/1eGxxB5IwfatDYeyiI32 dQkPb3Kr311WUm/6rRrZD38i0AyFTfQMKn6K+JAoDHnHMQjoFIX8V0dipV77iE9JAn3r Cliw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=00bD41CpohMBMgWN2aRl98+MG1NWyw9aXdRxmbyLX7k=; b=H3uN8FsI213FqAp0Lp1ehDLP8oAOi9327hxidMEUjnKBZWe3JlJYmdQtMSrdqWO+nx GNXpaMSk3lxOMllBmLbWtah/bpqli7/P7307afGBLT9dNC6Du35jEPbCkfv+yX0G/XdU Zu0DzakG4i8/NJvTloXXoY5silUOIT4eUGjO3q3gm9WTy+KZdr17OLCzfdEGCupOHjA2 aCTCdtxqLjM7EPagZuYJT8HGPfxaRDVReC+X9cIOGCAt24fG5wxOTFxVj0+dFYuyO4Ig u49LPnnrnD/IP5YzwtwLXGQd43U0o6uAAe0VqCfiv1vXVObV+NfSc9k9Zj3CZrxvB8eK BVSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lkh5HCyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a170902b19700b001929aeb0d60si14469505plr.180.2023.01.03.03.05.29; Tue, 03 Jan 2023 03:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lkh5HCyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237465AbjACLCP (ORCPT + 99 others); Tue, 3 Jan 2023 06:02:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237285AbjACLB6 (ORCPT ); Tue, 3 Jan 2023 06:01:58 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF9110D9 for ; Tue, 3 Jan 2023 03:01:57 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id fy8so8771344ejc.13 for ; Tue, 03 Jan 2023 03:01:57 -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=00bD41CpohMBMgWN2aRl98+MG1NWyw9aXdRxmbyLX7k=; b=lkh5HCyhJ0VSthqIJhVg7LcOAC5++DcCafGeW+njz7gDkKybj2yDo9MQKVo5UXRT6G MILYofG4/Z6AMJSCIsZToHVaDBomPh1H6siahu7wUBPJpaihWnRtYYNnsM20RVRiDtUW n2CZfMi+KUMjSk8bwX2x5599R1zGl7KIARf58= 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=00bD41CpohMBMgWN2aRl98+MG1NWyw9aXdRxmbyLX7k=; b=NbLm5U2VH1E+4C/4yUnxXmr7bPBQtsOgKyYqGsAtP5/8ylvkV0IUOjQT5Qj0RDRpVW hQl2z//lnrnEziWeiOohiXuT4lecXIdL/qwT1smYvOhqg7oOPvOv0mbBowBQJrK/L5Bk KVzbejllbh+L3nkiXChccXERTW7LraJk2Hd5GyPRLrIgNPROhMX/rqsWi7x96PG/RMzH nqEzr8ezE1v2wFquUSFlfhy20TnnOifMVxLvgU20ApssnJQs1uul8A9bm3pGXsHKN3y0 ZcXjIcpq2s7MxBxbf8ROHRCmxRtbve0WsAOACe5OkiNRAteJOn789Lw4nKwJ1jNPSwRY ORug== X-Gm-Message-State: AFqh2kpTxWdtBZ4FlTiHoMSNxfHIReCK2DZdnnexVKpSg2ue5RxdYy5N D7B/cuEt2VT3onS+YinqsMJ4pNalgf8j8LBP9Vk= X-Received: by 2002:a17:907:8e93:b0:7ae:bfec:74c7 with SMTP id tx19-20020a1709078e9300b007aebfec74c7mr39110590ejc.72.1672743715986; Tue, 03 Jan 2023 03:01:55 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:ef23:1430:9acc:b68]) by smtp.gmail.com with ESMTPSA id l12-20020a17090615cc00b007c0cd272a06sm13944331ejd.225.2023.01.03.03.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 03:01:55 -0800 (PST) From: Ricardo Ribalda Date: Tue, 03 Jan 2023 12:01:23 +0100 Subject: [PATCH v3 3/3] media: uvcvideo: Refactor power_line_frequency_controls_limited MIME-Version: 1.0 Message-Id: <20221101-easycam-v3-3-2c9881a7a4f7@chromium.org> References: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> In-Reply-To: <20221101-easycam-v3-0-2c9881a7a4f7@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Ricardo Ribalda , linux-kernel@vger.kernel.org, Sergey Senozhatsky X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=3328; i=ribalda@chromium.org; h=from:subject:message-id; bh=U6+fv6Oz+oBYLUlCti95XpzN5zRXjjLpaYFVN2dc0HI=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjtAsep6BRBKmLrGo7Jh0JjciKXjPQr18hFu57TlyO Go95FN+JAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY7QLHgAKCRDRN9E+zzrEiDfTD/ sED2E32h08CttZhf7ECpbeysdAs4/o8+xOE0p0bCSKi5Tjk2X2z7qHE6CGs1mKFD6sXh4bArM/yatP 2eBzUH3JooZyZI0ZKYqrm8ZPsvYEDrLYYeErHU1D1McJsSoOUeKFLrLU+/VjfRthUB5Jd2mERmJkmv FONN68J9MWdIJO5P9rZk6qYWpxBBG+FULClMaf6xc3PkpM9CXMeBeInUC1uCveQ39M/rjjaA9zSrud gkhBFDxf8qBPZZ0v6u3l652X8k+++DLdW2Hu4J+i9iod7zaTHMesogtkzYXktqNEXE1oLM2Eb8aVxx n3KohB6dLJO4hVHryA/Ls3ML9zmQjBi/snepflN5/LTFbH0afItxxc4mEqMzGrr6C63Jfc9A7R9TAQ QJY5nSUiq/58UfWCbB6qdR9D2SKhxUAxK0ix4AUpvZgQw1BImKLtV/g4ix+O7i71hd0oJXVGa2dmXo OHGaHnTqnllCnUAT5FHVVeTB+KeF2UtdCUdlECRn7sqGTInQxqD785P17/IE3uquCIg4w1FWRxXmLO 63Ofnn8KevPELj3tOXP3H/a5gYXVR+Q9W91eIIh7P1GHnhHO9y9DcoSDgqVjDG06iINKWHARnY7+iw v8eoVUMyQ3sf4YqcAHBAW0xD0Rtldqn91Jm1pv3C6NLexP2bckaidYSwAXWQ== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753999153160288541?= X-GMAIL-MSGID: =?utf-8?q?1753999153160288541?= Move the control mapping to uvc_ctrl.c. This way we do not have references to uvc controls or v4l2 controls in uvc_driver.c Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 17 +++++++++++++++++ drivers/media/usb/uvc/uvc_driver.c | 17 ----------------- drivers/media/usb/uvc/uvcvideo.h | 1 + 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index d8283d71bc96..4ff0415d8bf4 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -370,6 +370,11 @@ static const struct uvc_menu_info power_line_frequency_controls[] = { { 3, "Auto" }, }; +static const struct uvc_menu_info power_line_frequency_controls_limited[] = { + { 1, "50 Hz" }, + { 2, "60 Hz" }, +}; + static const struct uvc_menu_info exposure_auto_controls[] = { { 2, "Auto Mode" }, { 1, "Manual Mode" }, @@ -751,6 +756,18 @@ static const struct uvc_control_mapping uvc_ctrl_mappings_uvc15[] = { }, }; +const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = { + .id = V4L2_CID_POWER_LINE_FREQUENCY, + .entity = UVC_GUID_UVC_PROCESSING, + .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, + .size = 2, + .offset = 0, + .v4l2_type = V4L2_CTRL_TYPE_MENU, + .data_type = UVC_CTRL_DATA_TYPE_ENUM, + .menu_info = power_line_frequency_controls_limited, + .menu_count = ARRAY_SIZE(power_line_frequency_controls_limited), +}; + /* ------------------------------------------------------------------------ * Utility functions */ diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 9c09bc988278..6531aed5d642 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2377,23 +2377,6 @@ static const struct uvc_device_info uvc_ctrl_power_line_uvc11 = { }, }; -static const struct uvc_menu_info power_line_frequency_controls_limited[] = { - { 1, "50 Hz" }, - { 2, "60 Hz" }, -}; - -static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = { - .id = V4L2_CID_POWER_LINE_FREQUENCY, - .entity = UVC_GUID_UVC_PROCESSING, - .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL, - .size = 2, - .offset = 0, - .v4l2_type = V4L2_CTRL_TYPE_MENU, - .data_type = UVC_CTRL_DATA_TYPE_ENUM, - .menu_info = power_line_frequency_controls_limited, - .menu_count = ARRAY_SIZE(power_line_frequency_controls_limited), -}; - static const struct uvc_device_info uvc_ctrl_power_line_limited = { .mappings = (const struct uvc_control_mapping *[]) { &uvc_ctrl_power_line_mapping_limited, diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index bcb0b0c101c8..818ae7a6f9b9 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -728,6 +728,7 @@ int uvc_status_start(struct uvc_device *dev, gfp_t flags); void uvc_status_stop(struct uvc_device *dev); /* Controls */ +extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited; extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11; extern const struct v4l2_subscribed_event_ops uvc_ctrl_sub_ev_ops;