Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5787202pxu; Wed, 23 Dec 2020 05:37:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFbe4FmzyxaA2ExxicOAjR5ODpr/npfHSLA3aH18hv+06AWIoV+h2zZsDsGQSRObVeRE+Q X-Received: by 2002:a17:906:d0c2:: with SMTP id bq2mr23932274ejb.1.1608730645397; Wed, 23 Dec 2020 05:37:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608730645; cv=none; d=google.com; s=arc-20160816; b=HVdQevMS0VXGJD8zJsMXwATUC5HGJXjESKnJbEqVyfyn2ZoIn7wqhnjzjkWtR+1PbW +2TCyJ6/25MB8W9SELAIln4cOsM9vGcINRIb0B1uMO0uuGHCvBNa7MvfIBrkQlirow6j D+SxGQy0dDIbfNiSN4KTtBE/UvsLtrmhpLfdQ5GB6HA/f/H/L9D6dClzJ1eftADHT3bC YiRUroHOO7uNtEaC9xtChkrlEN6SK4XF7JIuMZQO+C+cyXaIBstyRNoiG+9H+7oJyV2f iYCtDrVaVbLCLSN1qpSyr/+YWLSQNNvLTW/hcibXWN/KSxu9L56HAT4wkIF/24+oAGP6 6Nsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xj6OmJsCRi+/nSFF99ojwxyR8UdFFK7nIZiW36FGx6w=; b=htJSimPWaFpCrxXXtk7g+JEmlNQuUvCQBjgnx7FS6N5LMAe9Iwp+7EirP8hKGpImhr ei4vqrZwadWSsNAEqYkiRHbo3c0IMSLk/R5+ZprwX8iqoUOsxNbDWEAji41Y6LkCWDrv CZvEhyF+99as8oJHh0COrc0WlR81DdlaoUvtw+BKE7hjTkYvqqCi2uYI+ZRtViBI0+BZ J+/djcyGHCeN7qDqpAHzpQ0nRnylj4UopnWkRwblfcU9G+BemW2onvtKN2rRiFYmFV28 2j8bQMBmpS3BibfVoV4z8ffe3kv8d6IAjztjuxQ74Oydcm/w9xQSHsdCavvaFWrAV4m3 PvEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwd53kQg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 97si13959074edr.112.2020.12.23.05.37.03; Wed, 23 Dec 2020 05:37:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dwd53kQg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728608AbgLWNgM (ORCPT + 99 others); Wed, 23 Dec 2020 08:36:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbgLWNgM (ORCPT ); Wed, 23 Dec 2020 08:36:12 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BCECC0613D3 for ; Wed, 23 Dec 2020 05:35:32 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id q75so6177909wme.2 for ; Wed, 23 Dec 2020 05:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xj6OmJsCRi+/nSFF99ojwxyR8UdFFK7nIZiW36FGx6w=; b=dwd53kQgekz8cwTSW1TheZUxeuVMqDtKXDhzEYQTsvNtYMWJhHD1qVlLP/HTJdj+6k dn3Y48l/FkzU+lf9zUBW+F4hQ1j8Br0ts9FJC8WKCPc90XomClM+kGUcvRHYsayMm6EB F3ZP0cnA0owtr13/7WVkmX66u9fB0qkMTBqz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xj6OmJsCRi+/nSFF99ojwxyR8UdFFK7nIZiW36FGx6w=; b=cPmWGzJ7kSRkzfn4pWQpGEU69Kb/a3hMAmpA5jY429oSOmAp/md+8UjOYRbJiIi0z2 AGdL3enosQryOIwk3LZUIrxdUz9v2r1lZV0gM7q2v9Vq5qvUfzZiNZwtS/MVYjQ/lScV h9JQKCzY+tXtyCEDoF0BiQgaL6z2IQp7voCbgwTFQSTJVVwrU0I18HBmfBmkS8/0ZCdA gEcvP/AeKo+EmdkpaEk0c0VrO3onEo7v4+fplOOFyISorLQfGAhSp7vPRmmrqfR3QWBg cGQ1R0XgXGFAD01CMPSIavgzWOXm2MUimldyy5Y9zZP2vAXY1KzCC0G5DkJslpKjOnpc Artw== X-Gm-Message-State: AOAM532RLkCPvF6s4YjoWfhLhG6mDCDfGWSKjpuh80/ca3k6b4MZqPXI nxx5nzFOo+/di9TVoHOZAC0peQ== X-Received: by 2002:a1c:4954:: with SMTP id w81mr26533986wma.60.1608730530684; Wed, 23 Dec 2020 05:35:30 -0800 (PST) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id q143sm31572247wme.28.2020.12.23.05.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 05:35:30 -0800 (PST) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Subject: [PATCH v7 00/12] Show privacy_gpio as a v4l2_ctrl Date: Wed, 23 Dec 2020 14:35:16 +0100 Message-Id: <20201223133528.55014-1-ribalda@chromium.org> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some devices can implement a physical switch to disable the input of the camera on demand. Think of it like an elegant privacy sticker. The system can read the status of the privacy switch via a GPIO. The ACPI table maps this GPIO to the USB device via _CRS and _DSD descriptors, so the kernel can find it. The userspace applications need to know if the privacy pin is enabled or not. The obvious way to show it to userspace is via the V4L2_CID_PRIVACY control. This patchset implement this functionality. v7: Thanks to all the comments from Laurent, Sakari and Joe - New patch from Joe: Rename debug functions - Rename direct handler to sync/async handler - Only launch events with IRQ - Use mutex on the stream_quirk - CodeStyle, spaces are my friends v6: Thanks to all the comments from Laurent! - Remove multiple async_ctrls from v5, it is not needed - Split event handling in two parts, so it can be triggered without wq - Save pointer to the privacy entity in the main structure - Handle the quirk in a different location to avoid races - CodeStyle v5: Thanks to all the comments from Laurent! - Allow multiple async_ctrls - Use dev_dbg() for uvc_trace - Major redesing of "Implement UVC_EXT_GPIO_UNIT" - Major redesing of "Implement UVC_QUIRK_PRIVACY_DURING_STREAM" v4: Implement UVC_QUIRK_PRIVACY_DURING_STREAM v3: Thanks to all the comments from Joe Perches - Rework of printk macros v2: Thanks to all the comments from Laurent! - move guid to unit - support entities with no pads - CodeStyle - Irq handling - pr_cont - new ids Joe Perches (1): media: uvcvideo: Rename debug functions Ricardo Ribalda (11): media: uvcvideo: Move guid to entity media: uvcvideo: Allow extra entities media: uvcvideo: Allow entities with no pads media: uvcvideo: Provide sync and async uvc_ctrl_status_event media: uvcvideo: Allow entity-defined get_info and get_cur media: uvcvideo: Implement UVC_EXT_GPIO_UNIT media: uvcvideo: Add Privacy control based on EXT_GPIO media: uvcvideo: Use dev_ printk aliases media: uvcvideo: New macro uvc_trace_cont media: uvcvideo: use dev_printk() for uvc_trace() media: uvcvideo: Implement UVC_QUIRK_PRIVACY_DURING_STREAM drivers/media/usb/uvc/uvc_ctrl.c | 179 +++++---- drivers/media/usb/uvc/uvc_driver.c | 580 +++++++++++++++++++---------- drivers/media/usb/uvc/uvc_entity.c | 11 +- drivers/media/usb/uvc/uvc_isight.c | 17 +- drivers/media/usb/uvc/uvc_queue.c | 9 +- drivers/media/usb/uvc/uvc_status.c | 44 +-- drivers/media/usb/uvc/uvc_v4l2.c | 48 +-- drivers/media/usb/uvc/uvc_video.c | 189 ++++++---- drivers/media/usb/uvc/uvcvideo.h | 105 ++++-- 9 files changed, 736 insertions(+), 446 deletions(-) -- 2.29.2.729.g45daf8777d-goog