From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 A97E02D6E4D for ; Wed, 19 Nov 2025 19:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581037; cv=none; b=qTGmwl/n7zk1ovY17Ql8QYzu+cPCiVlK0NBPPeLhPNvvPn2tzhyuAw+tZOo+AsewyoikXee7rjjmp5AxtoKWwemEtK8Uis2/JWpvPPs6xwcKaxSL+FuMNC2Zpnj6GEmG0nq3ww5OhKRLL9WxItz+BCNhTnXXeppSxRbdis1E6B4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763581037; c=relaxed/simple; bh=lbXjJbO0uwFmG+NsSnDB6lEQZzznbgKBQhL/o6GtWpc=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=onCvFwHL/ba2QzwlAJkJi1MzXS3YezbPWcHKHxF7O+JeHcGtYMHiyuXBYf/Tq2LtdSsxfa0wjKal32udN/ThRi09B0HcZuy+Ahd3q9LwjfWRCLPAapRccen4Un+qAJpoDUevDqoqMqmtb7o9OXpLkX73u0Vm0dgyKQRr1xxSTxw= 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=faLb21o6; arc=none smtp.client-ip=209.85.208.180 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="faLb21o6" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-37ba781a6c3so567001fa.0 for ; Wed, 19 Nov 2025 11:37:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1763581033; x=1764185833; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=JVcrPY5lB8g6Yq3/nbhcAcjAFdjQxMWHkVEFIRUZNpk=; b=faLb21o6AjLXgcPIJtoj21yRnPxJYsy1UqygWNsKphZGyOQJdjT/oECCd/dDez4moV U2MDICiAKjjeXtrSDvyfZi1PUGhR+vF3Cz2Us6fsk2pj7Nwl6Z9IrBFJQ8M5mHOxJiqk dhi5zhxJS1RHaz/GOp/54G6mnsNhPMse+4ljE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763581033; x=1764185833; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JVcrPY5lB8g6Yq3/nbhcAcjAFdjQxMWHkVEFIRUZNpk=; b=upj6JZb32cLPXkFcY4LRCIOpp5C3wbjR/QykkOirLy1W8nZqZ5q1Al4hvbAhJUO2gH PbJEmp6kOafuOycVzDbNTBzr11o8pWE1gCqivnMPi7PnFlwoNPly/lTeHfgE6uS09EdI 8/aeBCFnr7waoAYpuSYUZOy11jgSKhMZXRJFvLJm4hIwA0uih3ys5v0czt6CzdYcOzbk q61In39L0KRWec4Ens15Hfcnh3w33p/2vT7Vdhdi1eiu9trrhq6BeJH4y23W1p66DzO6 TOeFf4T8F2NnI+QdVuEmcoP26P+w26+hmZq40UUDgB2dw5SogaJZRANjzAr2IBLregd9 8k1Q== X-Forwarded-Encrypted: i=1; AJvYcCXz3g02GcAbRVRVDZYBDXZoTVbiPjeWHl88PQcD7Vbm4v2YQfOO8G3V44oj8EjpBgBaKkpgRe+UwfyNZHE=@vger.kernel.org X-Gm-Message-State: AOJu0YyOzT7QvFl+G7jtKiahu6BRTcL3tTHhIDYqGXA+EAAcC+0Me4jv JdkFAqPpmnAZBH4WRJzuB3hiZevmZsyYc6x51/26UsMRFcYCYorXpKZllXss9rlBww== X-Gm-Gg: ASbGncsHD9k9DZNi3fIQeMqeuNZhb9MnqUqosv8+XYnUOQn4MjDT3C42Q2Pc7Z7hvVx 6ZChajvoZ08ycEt4Dxeo6glcAUMJQknKwRE42VrI8ZINoVRYNsFSWiQ+9pRcRzINicMVnb33gB6 FOnLvGYfrPhXeTKaVyEiJROIyuwKAJRUX59tU8lodcbjBpMnVrWTIzA+UjxiH8lwirNcejHKiD0 eqvmwlUFTtX4BPsMliLNEZ2pOih5BC32UH7AigV9YssRtOkEK2xVaVJkjY6YjlEMtcP4g7Wl7yY UzJQ/7a5gLsqMgIrDa1+L1bYy1RZU9Fqtgo3BoCjJrj9F++WiSFKvazQWd597FvNhpdIl+Ca2Y/ RFUVfgav79zrxOC0LiQgYlEmH3sWX7wzRrzsJKdt5GyxyRrGHfsmhKs34JCtegUqXAN2oQ8qTs8 nsimNPfyYe7Zl2od+favwvD4OIqC5iMfZs3yz9BnhrSiplh5Ipgp2MkxCvneJyj+z1jT/j5BxN9 vH/8wpTlQU= X-Google-Smtp-Source: AGHT+IE6fWXRDxmuimRIZXGfgyPy1g1a/RxvR7Jv24xHtWIzgc+Y0FKSwI6JSExKOqG/k0LVvYByiw== X-Received: by 2002:a05:6512:b8d:b0:594:2ff7:9d29 with SMTP id 2adb3069b0e04-5969e2da506mr22335e87.13.1763581032514; Wed, 19 Nov 2025 11:37:12 -0800 (PST) Received: from ribalda.c.googlers.com (80.38.88.34.bc.googleusercontent.com. [34.88.38.80]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5969dbd15a1sm65790e87.98.2025.11.19.11.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 11:37:11 -0800 (PST) From: Ricardo Ribalda Subject: [PATCH v2 0/6] media: uvcvideo: Map known XU controls Date: Wed, 19 Nov 2025 19:37:09 +0000 Message-Id: <20251119-uvcdynctrl-v2-0-0359ffb98c9e@chromium.org> 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: 7bit X-B4-Tracking: v=1; b=H4sIAGYcHmkC/23MQQ6DIBCF4auYWZcGbA2mq97DuBAYdJIqzaCkx nD3Utdd/i953wERmTDCozqAMVGksJSoLxXYaVhGFORKQy3rRimlxZas2xe78kto00rfGG/MXUE 5vBk9fU6s60tPFNfA+2kn9Vv/MkkJKQZ0WuLg/M21TztxmGmbr4FH6HPOX3rZ1WCnAAAA X-Change-ID: 20251117-uvcdynctrl-7b80f5bfbb41 To: Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Ricardo Ribalda , Manav Gautama , Martin Rubli X-Mailer: b4 0.14.2 The UVC driver uses a custom ioctl `UVCIOC_CTRL_MAP` to map XU controls into v4l2 controls. The most well know user of this feature is the uvcdynctrl app. This app has a set of XML files which contains the list of mappings. Some of these mappings are standard and other ones are custom. This series move the standard mappings to the kernel driver, so userspace do not need to depend on external apps to use them. While we are at it we realized that some of the mappings can be harmful for the privacy of the user. This series introduce a mechanism to block those mappings. While we are at it, we complete the deprecation of the nodrop parameter. Ideally, this patch should belong in a different series, but then we will have conflicts... and who wants to works twice? I have tried this series with a Logitech Webcam Pro 9000, that has been donated by Hans de Goede (Thanks Hans!!!). Without this patch and uvcdynctrl the device has 14 controls. (Ctrls A) With this patch the device has 15 controls (Ctrls B): Ctrls A + control 0x009a090a `Focus, Absolute' min 0 max 255 step 0 default 0 current 0 With uvcdynctrl and this patch the device has 17 controls (Ctrls C): Ctrls B + control 0x0a046d71 `Disable video processing' min 0 max 1 step 1 default 0 current 0 control 0x0a046d72 `Raw bits per pixel' min 0 max 1 step 1 default 0 current 0 With uvcdynctrl and without this patch the device has 19 controls: Ctrls C + control 0x0a046d05 `LED1 Mode' min 0 max 3 step 1 default 3 current 3 0: Off 1: On 2: Blinking 3: Auto (*) control 0x0a046d06 `LED1 Frequency' min 0 max 255 step 1 default 0 current 0 BTW, Driver tested with virtme-ng. First time that I use it for uvc development, and it works like a charm :). virtme-run --kimg arch/x86/boot/bzImage --mods auto --show-command \ --show-boot-console --verbose --qemu-opts -usb -device qemu-xhci \ -device usb-host,hostbus=1,hostport=4 Signed-off-by: Ricardo Ribalda --- Changes in v2: - Document how to get GUIDs - Show clear deprecation intentions to the user. - Add new patch for the Kconfig approach (Thanks Mauro). - Remove duplicated control in commit message, provide background and add documentation. (Thanks Laurent) - Block also uvc_query_ctrl for privacy controls (Thanks Gergo Koteles) - Link to v1: https://lore.kernel.org/r/20251117-uvcdynctrl-v1-0-aed70eadf3d8@chromium.org --- Ricardo Ribalda (6): media: uvcvideo: Remove nodrop parameter media: uvcvideo: Import standard controls from uvcdynctrl media: uvcvideo: Announce deprecation intentions for UVCIOC_CTRL_MAP media: uvcvideo: Document how to format GUIDs media: uvcvideo: Introduce allow_privacy_override param media: uvcvideo: RFC: Convert allow_privacy_override into Kconfig .../userspace-api/media/drivers/uvcvideo.rst | 2 + drivers/media/usb/uvc/Kconfig | 11 ++ drivers/media/usb/uvc/uvc_ctrl.c | 212 +++++++++++++++++++++ drivers/media/usb/uvc/uvc_driver.c | 19 -- drivers/media/usb/uvc/uvc_queue.c | 25 --- drivers/media/usb/uvc/uvc_v4l2.c | 11 ++ drivers/media/usb/uvc/uvcvideo.h | 2 +- include/linux/usb/uvc.h | 18 ++ 8 files changed, 255 insertions(+), 45 deletions(-) --- base-commit: 1f2353f5a1af995efbf7bea44341aa0d03460b28 change-id: 20251117-uvcdynctrl-7b80f5bfbb41 Best regards, -- Ricardo Ribalda