From nobody Fri Dec 19 20:32:44 2025 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F0F7153580 for ; Mon, 10 Jun 2024 23:10:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718061002; cv=none; b=InWmF3wBxnxdDlY7Zi21jVg8fk6+LotR3DN4Jh3ObCaSYQ7nWiEOsH0sZ1bqn2XL6yVE9armZ7V8noNAyrJulzRxRPr6a35OjYsw09+9ciuXqdRtD2WEabOwmp3LAe/1p4aGpx2A9tqTMrmQewQNbMz7E8whtf9NIpt2MTjgl/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718061002; c=relaxed/simple; bh=OUIAEYxW2pt7xlzXmaotUnfEstFIYjmqTiX5MYoVVRg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SrGp2RITtPphdg93t876CTP68nuDMzZ+5YU2sPos48Vf/QnnkoQhzL/ecsM3qzYZgUNnX7pejvLSJLHDfN9RqkTv8NeeRk9ebC/PM5jGThi3vVOqLyYuEZ+Oc7wqOKu9RNv5kaFK2HY8RnhTG58y0Fqqlcx/bUPyjWdqXHCTmvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lcxFhA/Q; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lcxFhA/Q" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5bacd59e562so1629613eaf.2 for ; Mon, 10 Jun 2024 16:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718061000; x=1718665800; darn=vger.kernel.org; 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=hm98dOi0/zRzUBfFNpcElUy3e9wDhIJ4KCCov/nGFTQ=; b=lcxFhA/QvMiB5odiKSNsODLs2xDUqc8EUHOGLPGoQyfuWTyCCBMuNMwdptmeaugV5j KX+yec+tggkrBjmbHtWZjMpu9xUItgo2VTgg2Nw3viO/Tsv4+fXfyNCxjclVdoIDD4xU X1jwxWszNmhW4eSIp6rn71OOf3gqpXfvna6x8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718061000; x=1718665800; 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=hm98dOi0/zRzUBfFNpcElUy3e9wDhIJ4KCCov/nGFTQ=; b=lYIJRvGYd7vAdPuP5FKUi0FgFAVvrghyExEovRMILxHl8Tl1Whqa8NlJDUZg9dAESI ubMix4A5nK+KRawV+7pjA3fXZ5SXHlkjtJ2j7ZTeoshWSlDZuDdAx+voDZjgxi6YmgNX +VTebhVwlIhAmf8UlaT0TaPgzbAyWOyFZwKw5QbnCB1u41z8nsc2AP5E2khv1UtWobpO vkoVtsxvhkn6LJpiTblr28QKK6zgdz/O/8HD6ccjDNz6IA74F4wc+e1A8oAxjGu4DssV MTBKW29IVTdsrYlFjbarW8jm3PF/TE/0lpF7ctVY46fEgygk+EnNyN7jsFCveImihcQr 5ECw== X-Forwarded-Encrypted: i=1; AJvYcCXZ8QbD9gklrAY1GR4ndjc4rvt2q3aXpsYKUmx8Ma4kyj0oUHToFQjEPe9bUjr1M6fmaOBlKOkFVjkkQR8OuKybcyp9HnNST6b+fM4K X-Gm-Message-State: AOJu0YzdItBqFUlENZL2OiYzx3NtKf2qaHQ+ssYA9Eb2uakyxQSPHN/2 ErFg8Rfb2BdQOpILI3LszMQDShvPF3ToKDbzDN+/XY9vjbi7Z/W3AqIjQ5+zUA== X-Google-Smtp-Source: AGHT+IEceemHixBzieP2KZfovugvjCMFKfE0k8sKaMP22e3NHBGqtiLQaG5XPws0aTira0s0kS/A3g== X-Received: by 2002:a05:6358:840b:b0:19f:5b1f:91b1 with SMTP id e5c5f4694b2df-19f5b1f9254mr115528755d.14.1718061000049; Mon, 10 Jun 2024 16:10:00 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b06519d521sm35256946d6.65.2024.06.10.16.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 16:09:58 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 10 Jun 2024 23:09:56 +0000 Subject: [PATCH v2 5/7] media: uvcvideo: Remove PLF device quirking Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240610-billion-v2-5-38e861475f85@chromium.org> References: <20240610-billion-v2-0-38e861475f85@chromium.org> In-Reply-To: <20240610-billion-v2-0-38e861475f85@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab Cc: Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 We can use heuristics to figure out the proper range of the control instead of quirking every single device. Reviewed-by: Sergey Senozhatsky Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_ctrl.c | 4 +- drivers/media/usb/uvc/uvc_driver.c | 122 ---------------------------------= ---- drivers/media/usb/uvc/uvcvideo.h | 2 - 3 files changed, 2 insertions(+), 126 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_c= trl.c index efc46f53ac81..d74019cb27fe 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -459,7 +459,7 @@ static void uvc_ctrl_set_rel_speed(struct uvc_control_m= apping *mapping, data[first+1] =3D min_t(int, abs(value), 0xff); } =20 -const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited =3D { +static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limite= d =3D { .id =3D V4L2_CID_POWER_LINE_FREQUENCY, .entity =3D UVC_GUID_UVC_PROCESSING, .selector =3D UVC_PU_POWER_LINE_FREQUENCY_CONTROL, @@ -471,7 +471,7 @@ const struct uvc_control_mapping uvc_ctrl_power_line_ma= pping_limited =3D { V4L2_CID_POWER_LINE_FREQUENCY_50HZ), }; =20 -const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11 =3D { +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, diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc= _driver.c index bbd90123a4e7..5f689fee60a9 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2383,20 +2383,6 @@ MODULE_PARM_DESC(timeout, "Streaming control request= s timeout"); * Driver initialization and cleanup */ =20 -static const struct uvc_device_info uvc_ctrl_power_line_limited =3D { - .mappings =3D (const struct uvc_control_mapping *[]) { - &uvc_ctrl_power_line_mapping_limited, - NULL, /* Sentinel */ - }, -}; - -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_device_info uvc_quirk_probe_minmax =3D { .quirks =3D UVC_QUIRK_PROBE_MINMAX, }; @@ -2427,33 +2413,6 @@ static const struct uvc_device_info uvc_quirk_force_= y8 =3D { * though they are compliant. */ static const struct usb_device_id uvc_ids[] =3D { - /* Quanta USB2.0 HD UVC Webcam */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x0408, - .idProduct =3D 0x3090, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D 0, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, - /* Quanta USB2.0 HD UVC Webcam */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x0408, - .idProduct =3D 0x4030, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D 0, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, - /* Quanta USB2.0 HD UVC Webcam */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x0408, - .idProduct =3D 0x4034, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D UVC_PC_PROTOCOL_15, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* LogiLink Wireless Webcam */ { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, @@ -2583,42 +2542,6 @@ static const struct usb_device_id uvc_ids[] =3D { .bInterfaceSubClass =3D 1, .bInterfaceProtocol =3D 0, .driver_info =3D UVC_INFO_QUIRK(UVC_QUIRK_RESTRICT_FRAME_RATE) }, - /* Chicony EasyCamera */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x04f2, - .idProduct =3D 0xb5eb, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D 0, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, - /* Chicony Electronics Co., Ltd Integrated Camera */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x04f2, - .idProduct =3D 0xb67c, - .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 }, - /* Chicony EasyCamera */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x04f2, - .idProduct =3D 0xb6ba, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D 0, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, - /* Chicony EasyCamera */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x04f2, - .idProduct =3D 0xb746, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .bInterfaceSubClass =3D 1, - .bInterfaceProtocol =3D 0, - .driver_info =3D (kernel_ulong_t)&uvc_ctrl_power_line_limited }, /* Alcor Micro AU3820 (Future Boy PC USB Webcam) */ { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, @@ -3003,51 +2926,6 @@ 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) }, - /* SunplusIT Inc HD Camera */ - { .match_flags =3D USB_DEVICE_ID_MATCH_DEVICE - | USB_DEVICE_ID_MATCH_INT_INFO, - .idVendor =3D 0x2b7e, - .idProduct =3D 0xb752, - .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 }, - /* 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, - .idVendor =3D 0x3277, - .idProduct =3D 0x0072, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .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 0x1172, - .bInterfaceClass =3D USB_CLASS_VIDEO, - .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 D410/ASR depth camera */ { .match_flags =3D 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/uvcvi= deo.h index fa0396dd5b35..4df02a40c74f 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -753,8 +753,6 @@ int uvc_status_start(struct uvc_device *dev, gfp_t flag= s); void uvc_status_stop(struct uvc_device *dev); =20 /* Controls */ -extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limite= d; -extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11; extern const struct v4l2_subscribed_event_ops uvc_ctrl_sub_ev_ops; =20 int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, --=20 2.45.2.505.gda0bf45e8d-goog