From patchwork Tue Sep 5 15:29:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 720294 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 2F088C83F2C for ; Tue, 5 Sep 2023 16:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233358AbjIEQCI (ORCPT ); Tue, 5 Sep 2023 12:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354882AbjIEPaI (ORCPT ); Tue, 5 Sep 2023 11:30:08 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2290128 for ; Tue, 5 Sep 2023 08:30:03 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-411f5dd7912so17897811cf.3 for ; Tue, 05 Sep 2023 08:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693927803; x=1694532603; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=6W+TfrXmtjK34RUfVd7nGUPmJuAkk0DxWpwHLygpJ3U=; b=OZudrJW53VISzHcSQ22P4UL4IoATzRwCV561vMFCBB0S1O1pfKWlzc1lN1DpSlvwbr o111Po6X2gKWlwbvoV4ronrrz0TqveBv64wqI5j9AtjSPauvGI9CJwPTiHMbyVSa1WL1 HvEF9HGicQOdha8PrsSrkI9ceGJzqhXyRhNX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693927803; x=1694532603; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6W+TfrXmtjK34RUfVd7nGUPmJuAkk0DxWpwHLygpJ3U=; b=kdYfwOSYgrjNh2z2cxBsaXC4hh6Y9dmL7Ft5V60PYNY7W6ZpulQxmRfT7ztmVKgotW mggZb1rFdCEfAL9fE5W2dENCqHVG0MSA5EouVAEQ0+8SmSsBQi7Eo6sM8S08k25zqEmM ssx+Iq5ownWZG6/8mypU4xldWpeBTuLKTbvD6ZA3scZZmdS8gC7RhwN+PAx0xvwiwCgM HipVvcoAMifXEzXtXK8TkqjtmmVJsIK0jTUC80VCrllLfh1gDx87712W7riZjyHmpnXX pmjx5qp0PPPLt3mYvSgfowONQgHfMXMPueZFHaa8J5KmEIdW8lklEDOWJqAVBy96WWA7 VlUg== X-Gm-Message-State: AOJu0Yyl5Uds7waeOPUhDYy9AV4cXBHqMIHBSkdgEyNZ98CNnl8H2omp wOTX06AcQvoBWOcqAzHw2h4s1Q== X-Google-Smtp-Source: AGHT+IEQFo3g2YFqBxE2kIB03JTfw9xkEk6xbsE4/FEYCt0KvdZMdDVV1Yv6YqMq8bu3dlKWF0b62A== X-Received: by 2002:a05:622a:110:b0:412:6db3:eda9 with SMTP id u16-20020a05622a011000b004126db3eda9mr18573275qtw.58.1693927802873; Tue, 05 Sep 2023 08:30:02 -0700 (PDT) Received: from denia.c.googlers.com (122.213.145.34.bc.googleusercontent.com. [34.145.213.122]) by smtp.gmail.com with ESMTPSA id d4-20020ac84e24000000b0040ff1b4b400sm2642301qtw.73.2023.09.05.08.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 08:30:02 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 05 Sep 2023 15:29:52 +0000 Subject: [PATCH v2] media: uvcvideo: Fix power line control for a Chicony camera MIME-Version: 1.0 Message-Id: <20230817-chicony-v2-1-88335519989d@chromium.org> X-B4-Tracking: v=1; b=H4sIAHBJ92QC/2WNQQ6DIBREr2JYl0bQYttV79G4APzITyqYT0tqj Hcvuu3yzbzMrCwBISR2r1ZGkDFhDAXkqWLW6zACx6Ewk7Vs6qvouPVoY1j4zTYXJ+tWWeVYsY1 OwA3pYP3uzy/HSWcIezcTOPweL8++sMf0jrQcp1ns6f9+FlzwTpkB2kE5p8zDeooTfqZzpJH12 7b9AKWuN8G9AAAA To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The device does not implement the control properly. Fixes v4l2-compliance error: info: checking control 'Power Line Frequency' (0x00980918) fail: v4l2-test-controls.cpp(552): could not set valid menu item 3 Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- This camera, like other Chicony devices, do not implement properly the Power Line Frequency control. This time, I do not have direct access to the device, just to the report, but since other devices from the same family are showing the same error, it is safe to assume that the same fix will work here. --- Changes in v2: - Fix IntefaceProtocol, the camera is uvc1.5 - I managed to write 0 to the control, so the proper quirk is uvc11 not limited - Changes by Laurent: - Rename device - s/v4l/v4l2 - Link to v1: https://lore.kernel.org/r/20230817-chicony-v1-1-76bde4d6ff6b@chromium.org --- drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- base-commit: 4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6 change-id: 20230817-chicony-9c35f2046c6f Best regards, diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 08fcd2ffa727..4b5ea3501753 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2592,6 +2592,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, + /* Chicony Electronics Co., Ltd Integrated Camera */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x04f2, + .idProduct = 0xb67c, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = UVC_PC_PROTOCOL_15, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 }, /* Chicony EasyCamera */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,