From patchwork Wed Jun 15 15:12:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 582127 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 26FEBCCA47E for ; Wed, 15 Jun 2022 15:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343626AbiFOPNP (ORCPT ); Wed, 15 Jun 2022 11:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242520AbiFOPNI (ORCPT ); Wed, 15 Jun 2022 11:13:08 -0400 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 F40A1DEC7 for ; Wed, 15 Jun 2022 08:13:03 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id v1so23814857ejg.13 for ; Wed, 15 Jun 2022 08:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OWXOrfm/9NlVmpLfpsXcZqYVwwJxQb+7BpdjaEQ5k6g=; b=ILBT80z1mB8y3KmFDHu42InPyMxTsikDuFOoymGYG4+NI6AT9uYgeYqeMiDZwatAn+ PI6lswksIKinPKFuB8pZ1+l/17POaRw4DP3g+x4ikG+iJKRiofwtME4fB1g5/+Xgqm6J EDofovu/rfj3dRCnrKMCL5QlyvEgBDV95n64I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OWXOrfm/9NlVmpLfpsXcZqYVwwJxQb+7BpdjaEQ5k6g=; b=tq5bSRNLHqxDIdZOmgC/n+rzDSPE5/oig1vsoPJSWy6XNlI1Z7hPCl5wFnfaAw50P1 f61ddx7OXJBXAMkb9oRl0Iyti9VFFrgovryL2PbC9e3ZpsaY4CotoEzFsvjkMfbAZh25 tklB8Jy0zcXTVJ4Gavz9wvwbxMmDqj1hNNQhpggObI9kUcaoYflMU0Sc3hr46cr+rCRK Stv5T1byLabibSY4FTCxbb3f6b4u+x3hP5MURF1NfgzaMUQcr/uVfcpo+8fm5cbniN1f 9snOO0SPT78TNl76JJiPwjJEGXk1j31wXqKa8yhNAXApzuadN1NrKPCOj3SGAuOI2xJR ieQw== X-Gm-Message-State: AJIora+GCxsUELfIikBmscMblXqa5qmgXv1aUHnCe+JTjDhaFRMLXylP WlQZjKHCC/zX+F8OunZsgQNlcA== X-Google-Smtp-Source: AGRyM1vqLSOsRPEcy844ki1yzvDOJaFpB5hdo9SNFjWteElJ8mjE8VRODEQvn9hJSdFfrU56w0Qimw== X-Received: by 2002:a17:907:6e13:b0:711:c722:4fc with SMTP id sd19-20020a1709076e1300b00711c72204fcmr251107ejc.253.1655305982591; Wed, 15 Jun 2022 08:13:02 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b25-20020aa7cd19000000b0042bd2012196sm9610264edw.85.2022.06.15.08.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:13:02 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: Ricardo Ribalda Subject: [PATCH v6 1/8] media: uvcvideo: Add missing value for power_line_frequency Date: Wed, 15 Jun 2022 17:12:52 +0200 Message-Id: <20220615151259.77825-2-ribalda@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615151259.77825-1-ribalda@chromium.org> References: <20220615151259.77825-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org UVC 1.5 class defines 4 values for this control on: 4.2.2.3.6 Power Line Frequency Control Add the missing value when the UVC version is 1.5. Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_ctrl.c | 56 +++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 0e78233fc8a0..a709ebbb4d69 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -366,6 +366,7 @@ static const struct uvc_menu_info power_line_frequency_controls[] = { { 0, "Disabled" }, { 1, "50 Hz" }, { 2, "60 Hz" }, + { 3, "Auto" }, }; static const struct uvc_menu_info exposure_auto_controls[] = { @@ -504,17 +505,6 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = { .v4l2_type = V4L2_CTRL_TYPE_INTEGER, .data_type = UVC_CTRL_DATA_TYPE_UNSIGNED, }, - { - .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), - }, { .id = V4L2_CID_HUE_AUTO, .entity = UVC_GUID_UVC_PROCESSING, @@ -730,6 +720,34 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = { }, }; +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, + }, +}; + +static const struct uvc_control_mapping uvc_ctrl_mappings_uvc15[] = { + { + .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), + }, +}; + /* ------------------------------------------------------------------------ * Utility functions */ @@ -2415,6 +2433,22 @@ static void uvc_ctrl_init_ctrl(struct uvc_video_chain *chain, if (!ctrl->initialized) return; + /* Process common mappings first. */ + for (; mapping < mend; ++mapping) { + if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && + ctrl->info.selector == mapping->selector) + __uvc_ctrl_add_mapping(chain, ctrl, mapping); + } + + /* And then version-specific mappings. */ + if (chain->dev->uvc_version < 0x0150) { + mapping = uvc_ctrl_mappings_uvc11; + mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc11); + } else { + mapping = uvc_ctrl_mappings_uvc15; + mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc15); + } + for (; mapping < mend; ++mapping) { if (uvc_entity_match_guid(ctrl->entity, mapping->entity) && ctrl->info.selector == mapping->selector) From patchwork Wed Jun 15 15:12:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 582128 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 91A92C43334 for ; Wed, 15 Jun 2022 15:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244348AbiFOPNM (ORCPT ); Wed, 15 Jun 2022 11:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242506AbiFOPNI (ORCPT ); Wed, 15 Jun 2022 11:13:08 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE177101FB for ; Wed, 15 Jun 2022 08:13:05 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id g7so16636067eda.3 for ; Wed, 15 Jun 2022 08:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ba/er2SVgt15hBIKXCuOmTfszYwx0bh+mH6faV5HgMs=; b=JQp8uyCTM//DUgQt4nw52g0tqFaEinTgubLJ4S2k9TJ38p0QFNd9Dn5y64TjVrLpCv RzxXG/VvC8CrHUAb93Y4UyrlzUw/Qqcs3F0IhGL016/+9hGwHlXSI4NSn/0G9UqpLxRh NzwN218m+NNMxYKRdJV+PRCksrpXoV7O5m60g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ba/er2SVgt15hBIKXCuOmTfszYwx0bh+mH6faV5HgMs=; b=7RePQD9Pf8FOWM0olUlZkHQlrEqsFkX14WeZSeOsXmw3dPGls5l37Y/n/pibjo2xaO oSQhjGcZaevdKk6ESUq4yJ+3OFHjnGTskIMA7/EWG8RWpBp83WVHufptCuaz/D0ysohB leFeuhgxj53azww85QY9+So8iwfo3FaNwrJmWM5zXh/5MPXKczLRBIuQUQEBi2LKkSl9 wRg7wZRb2XqMrIHJunGYxN0aokZBu71oSw/ATGX/Y0xePHz+zTOVwWzZMHm73x1lPmvF XcPejSRAej6E0YX1kx4XqQZGMiib8as74ErITHwNnlX6xeM7dl+ZNmkQJbzUf9be9t0c djUw== X-Gm-Message-State: AJIora+13GigwbV/fY15p/KSAzhHe9Rc/Lqw+VRkRuA9ehCOz/sCGmKQ QOTaK/PukqIe1yCSfIe1725RE0cU4ONKxELH X-Google-Smtp-Source: AGRyM1trWxCTpFGEvEnB4NgcT2N6vlpdgmjrpw2eSZpS0nT7jA4jRANaywPGo1Z/Uqct75ri8U8K1A== X-Received: by 2002:a05:6402:2752:b0:433:3a08:27b1 with SMTP id z18-20020a056402275200b004333a0827b1mr220066edd.235.1655305984296; Wed, 15 Jun 2022 08:13:04 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b25-20020aa7cd19000000b0042bd2012196sm9610264edw.85.2022.06.15.08.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:13:03 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: Ricardo Ribalda Subject: [PATCH v6 3/8] media: uvcvideo: Support minimum for V4L2_CTRL_TYPE_MENU Date: Wed, 15 Jun 2022 17:12:54 +0200 Message-Id: <20220615151259.77825-4-ribalda@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615151259.77825-1-ribalda@chromium.org> References: <20220615151259.77825-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently all mappings of type V4L2_CTRL_TYPE_MENU, have a minimum of 0, but there are some controls (limited powerline), that start with a value different than 0. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_ctrl.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 092decfdaa62..0d89d239e881 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -1144,7 +1144,7 @@ static int __uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, switch (mapping->v4l2_type) { case V4L2_CTRL_TYPE_MENU: - v4l2_ctrl->minimum = 0; + v4l2_ctrl->minimum = mapping->menu_min; v4l2_ctrl->maximum = mapping->menu_count - 1; v4l2_ctrl->step = 1; diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index fff5c5c99a3d..6ceb7f7b964d 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -254,6 +254,7 @@ struct uvc_control_mapping { u32 data_type; const struct uvc_menu_info *menu_info; + u32 menu_min; u32 menu_count; u32 master_id; From patchwork Wed Jun 15 15:12:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 582126 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 F14DBC433EF for ; Wed, 15 Jun 2022 15:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344363AbiFOPNS (ORCPT ); Wed, 15 Jun 2022 11:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243995AbiFOPNK (ORCPT ); Wed, 15 Jun 2022 11:13:10 -0400 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 9011F1403B for ; Wed, 15 Jun 2022 08:13:08 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id v19so16654692edd.4 for ; Wed, 15 Jun 2022 08:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JhLoBlqgRdL7zGQaDBkJEiUo6xrYYgqrgV6p3n7v4gE=; b=VHsDUL+8G+l9h6VR2ECsRIAsjXxhP+/yUMKyjhDtQk2Sw/qGLfN25P6aJQeB3Ta3wS aRWHnuUAgcO/xYMaasg7Q4M+AM7P8JSwx2bqTHCXwWxzNbTqa3dNBqSx91gvtJcAIrIi WMUbhHBliDvh0SgLIjCbSwgbaPPrXTrMi48aQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JhLoBlqgRdL7zGQaDBkJEiUo6xrYYgqrgV6p3n7v4gE=; b=gzTLzRjWr19aOi8PuGRZV6K+tPzgRMdGjgMoL32DWSVqTlFkB6/0URFp9LxM5rNFEF kOg5U59XVEv9XtRa7YXxcsG+FSGH19IEuEtFhUJdpkSGwhPzDi2R+lIq2IazlkdGzt69 jkdMcIeLNs4DimbyeOisltxVvb4GVJZRiAXVaJ0MVRPXKeJrwLD+tdNdGpyl3tksYO8s vAl/hXlRWKWiLpAP+W+mfn/mxW3GmY/YUfwB8IUc1X1CSvl4f03WNPWZRnniSUAiY7qE uMFXwiPCjPQUU+YnG3epPgSdtHbP6mT7tLwNpScng3sCrb2jGvip9bf/VJGUydOchbB5 FkYw== X-Gm-Message-State: AJIora8BlXD5gj9hn14OHlc3K7c4zNKB8Rgjbj8qEtmHSpfyPd6/0Ao5 4XF5xXOsqJrxFixDW0OmVs1JEw== X-Google-Smtp-Source: AGRyM1tRkSTTg+6N8fUozmyqvF4O5etX5jvtgyGmyHMsEPxaOr3JOmT6UfDylpDQJq4g1QOkj9TUpw== X-Received: by 2002:a50:ec12:0:b0:42d:cbcf:a629 with SMTP id g18-20020a50ec12000000b0042dcbcfa629mr275214edr.224.1655305987113; Wed, 15 Jun 2022 08:13:07 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b25-20020aa7cd19000000b0042bd2012196sm9610264edw.85.2022.06.15.08.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:13:06 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: Ricardo Ribalda Subject: [PATCH v6 7/8] media: uvcvideo: Limit power line control for Quanta cameras Date: Wed, 15 Jun 2022 17:12:58 +0200 Message-Id: <20220615151259.77825-8-ribalda@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615151259.77825-1-ribalda@chromium.org> References: <20220615151259.77825-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Two more cameras do not implement the power line control correctly. Add a corresponding control mapping override. Bus 001 Device 003: ID 0408:4034 Quanta Computer, Inc. ACER HD User Facing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x0408 Quanta Computer, Inc. idProduct 0x4034 bcdDevice 0.01 iManufacturer 1 Quanta iProduct 2 ACER HD User Facing iSerial 3 01.00.00 bNumConfigurations 1 Bus 001 Device 003: ID 0408:4030 Quanta Computer, Inc. HD User Facing Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x0408 Quanta Computer, Inc. idProduct 0x4030 bcdDevice 0.02 iManufacturer 1 Quanta iProduct 2 HD User Facing iSerial 3 01.00.00 bNumConfigurations 1 Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_driver.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index d21de83021f5..a862a9d6a2fd 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2708,6 +2708,24 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, + /* Quanta USB2.0 HD UVC Webcam */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x0408, + .idProduct = 0x4030, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 1, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, + /* Quanta USB2.0 HD UVC Webcam */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x0408, + .idProduct = 0x4034, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* LogiLink Wireless Webcam */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, From patchwork Wed Jun 15 15:12:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 582125 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 65D4BCCA473 for ; Wed, 15 Jun 2022 15:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344902AbiFOPNV (ORCPT ); Wed, 15 Jun 2022 11:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239055AbiFOPNJ (ORCPT ); Wed, 15 Jun 2022 11:13:09 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36DDF13D30 for ; Wed, 15 Jun 2022 08:13:08 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id n28so16630945edb.9 for ; Wed, 15 Jun 2022 08:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7CbeHNxpi9+s0qv2gIQi33L5PMDbofgWDLYkT2RlfqU=; b=Auij9wGydoXVcXtnVt7f5SscEe86yhsuqwH1KBIeBgvJIamUxyE+Vb4zImjfbs/8Gg vUnQ2F90PpL4Fg5ZySoT9EghYv3hokn3+el6rjZ0/FMwTRdgNl7aD54X5zsd/qxIhrff 5qFW6e0Ief8Zv+CCF4k39oNBYsX3RwDmztce8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7CbeHNxpi9+s0qv2gIQi33L5PMDbofgWDLYkT2RlfqU=; b=R6FJwIL5u1d5mL5fO8iU0Z/20mSHm4jMtJ1laU7etefVOnsGWdWkR455wJtgO+RPDn B82DFSDNhNqF9yriEBdNZJxiRJku48tytCuhBwC4ApCT9vSFHr0B0TUq5QIfyYZqgcpo hDdRmBOfqTiTjYZdoALehmYPrN2E5eIo/7g/PCfVuPs8+vvYNs4As+rqaN+coh1hK098 cB3TJ5/0Q0Yn3n7qRaudP6V6LU1wNYmTGiCkqqcX9lVr7VSpqbTkwga53p/QIdYXSOTq AYr9ZGQH9mSbDisZvcE2CcnYRsb/n4Q4A7/4UGZ0exq1N9/PsGxuTzsJcxSwDJj+ZU80 n5hw== X-Gm-Message-State: AJIora9rWUbx7fQAOzNJia5WHEG5uj4EJAfsmhRXFV0Ty6Fs5En2znFE +XFC/y5P2gjMdartgl5Tlu1qHw== X-Google-Smtp-Source: AGRyM1uCatZFuN2m8N1LXga0uQ6Mh4GENNAyAybfRA+eNgeNGD+PO4HiS0jfW/G6qoArI/+erOyYPA== X-Received: by 2002:a05:6402:3322:b0:42d:f984:92fa with SMTP id e34-20020a056402332200b0042df98492famr291175eda.106.1655305987825; Wed, 15 Jun 2022 08:13:07 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b25-20020aa7cd19000000b0042bd2012196sm9610264edw.85.2022.06.15.08.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 08:13:07 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, senozhatsky@chromium.org, yunkec@google.com Cc: Ricardo Ribalda Subject: [PATCH v6 8/8] media: uvcvideo: Limit power line control for Acer EasyCamera Date: Wed, 15 Jun 2022 17:12:59 +0200 Message-Id: <20220615151259.77825-9-ribalda@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220615151259.77825-1-ribalda@chromium.org> References: <20220615151259.77825-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The device does not implement the power line control correctly. Add a corresponding control mapping override. Bus 001 Device 003: ID 5986:1172 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 0x1172 bcdDevice 56.04 iManufacturer 3 Bison iProduct 1 EasyCamera iSerial 2 bNumConfigurations 1 Signed-off-by: Ricardo Ribalda Signed-off-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 a862a9d6a2fd..6d34992032e6 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -3248,6 +3248,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_FORCE_BPP) }, + /* Acer EasyCamera */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x5986, + .idProduct = 0x1172, + .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,