Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5355940pxu; Tue, 22 Dec 2020 15:07:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1Lpw+5FLCA5oKKhMpFiWA+hfb2tqpKBtW6JngGeuukXUonGikke2NfWL9hlhgssFOLwwz X-Received: by 2002:aa7:cf8f:: with SMTP id z15mr22377446edx.17.1608678455582; Tue, 22 Dec 2020 15:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608678455; cv=none; d=google.com; s=arc-20160816; b=esATr6qIDYJUIG09S8rDLwz1uiU49yZjg+5QlccMZIQ9Me3ZDj0xukW0C9ElYMv0ND atjwPIpvM7aZd/3W5q8AdwbfXVl14VPE1bgTcU873BtHrvsHDZQNvdUA/0SEROjaYy7b hriv89eOzFx3o9+zIOQbAwBpu0VWwfJlRZ2zMHCTcPfGgnrt4rej803GoP4HVRModqXM m5FcT0UnicBOvn0V6kq7Fk8x9/ry1RbHwljjDYUVAdnJrozx0ZVVaqjngZLzmj1kBpQ4 coLbFRhSmJZYoVbyeVV6wNUn0bZhuSs3z55X+C/I+oXBCsAZhjVxvGZNrbjAoMM/kJcY nxFw== 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=bxxupScKkQylTgnzT1jQfJoerVH6s89+gfUZG72kVPM=; b=cpZctX9JX9OUW98NWaxUUgcjJhzedUh6f50aCocTZhlDaFM7CFzqmWFlLz9LdxW41n abk8oEThXL1Rh6YHAjPlp5EU82jn+RU6jIv0J8wMt9Bs+ksMuy07yddeDZgAwTWVvDxw 72cCznaD5y2EF51nDbJIggElhelzB725uDFgE9Xsp1cFkNihrRM6bt6p1GMnpJVdYFIK Uz9AecJZ+pftw5uU8dISaGykL/CoSdBwo57cUL7giYu8BPfa2KYNJLJxVnyfN3bhGyIs JxABNc6G8wd4Wf/X0JBCpyOwWBHL1r+/PWLsg4bcUGuuAZpjaWcPg26rZyJkjgIwZ99t jm1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MVCR6f45; 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 j11si10998167eja.691.2020.12.22.15.07.12; Tue, 22 Dec 2020 15:07:35 -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=MVCR6f45; 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 S1727965AbgLVXFb (ORCPT + 99 others); Tue, 22 Dec 2020 18:05:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727905AbgLVXFa (ORCPT ); Tue, 22 Dec 2020 18:05:30 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20DB1C0613D6 for ; Tue, 22 Dec 2020 15:04:50 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id m5so16619540wrx.9 for ; Tue, 22 Dec 2020 15:04:50 -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=bxxupScKkQylTgnzT1jQfJoerVH6s89+gfUZG72kVPM=; b=MVCR6f45O68amRjy6JOuaNJmfDEGVnpIF2mDSapSMTbXpdqXspqepYxxp7vu4y+Smp jmQ5nKLR+4nIehdk7+SrYe5ugoypMzJI8rkzjR6zmVjSz4t4VBnNgoAuP6eNKVJOOsnc HU8aEtiHyHjERvWzODBiPYWn7h/TzVP9+ux/Y= 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=bxxupScKkQylTgnzT1jQfJoerVH6s89+gfUZG72kVPM=; b=GCLRCmF3yrn0C9UCtJSwVW0oNsqG/L1xVDzqwY7szLkxD8sBvhXgZeaH1uAZKyekGT +r7injNRTP5crhehsUHUBQeYF7dN0Py6z1/LkBpgzXS6w//yxkq+nYJzXMq2DLs+g2LF HTo9Vd+g5ldXo2qkPA+qDDQI/BSR80wXchkpXf/GCzlxFxubjORpgJAfxNjx1yVYJtGX r81PxK+IXIMxyWhepmNEoJNgfZ7cZXoGrwiJ/ZmL/uOuhVgw9oyVMV+Btq6CG9Qv3ejh KtEFmLCe0saR6QmGXinwzNCa2yt14k+ieqDcbolH+aQykGyvufHdYoH2El5ZHCgUuumU cPOw== X-Gm-Message-State: AOAM530dgl68PGKT61dV/CdtgrEJgA50X6TenJ8I4AfkFvBn2udyhnH/ lwcIOkt38e3ky0hmKWWRm2K2IQ== X-Received: by 2002:adf:f10f:: with SMTP id r15mr26982951wro.302.1608678288761; Tue, 22 Dec 2020 15:04:48 -0800 (PST) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id r16sm34463401wrx.36.2020.12.22.15.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 15:04:48 -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 v6 00/11] Show privacy_gpio as a v4l2_ctrl Date: Wed, 23 Dec 2020 00:04:35 +0100 Message-Id: <20201222230446.1027916-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. 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 Ricardo Ribalda (11): media: uvcvideo: Move guid to entity media: uvcvideo: Allow extra entities media: uvcvideo: Allow entities with no pads media: uvcvideo: Add uvc_ctrl_status_event_direct 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: Implement UVC_QUIRK_PRIVACY_DURING_STREAM media: uvcvideo: Use dev_ printk aliases media: uvcvideo: New macro uvc_trace_cont media: uvcvideo: use dev_printk() for uvc_trace() drivers/media/usb/uvc/uvc_ctrl.c | 184 +++++---- drivers/media/usb/uvc/uvc_driver.c | 603 +++++++++++++++++++---------- drivers/media/usb/uvc/uvc_entity.c | 11 +- drivers/media/usb/uvc/uvc_isight.c | 16 +- drivers/media/usb/uvc/uvc_queue.c | 9 +- drivers/media/usb/uvc/uvc_status.c | 32 +- drivers/media/usb/uvc/uvc_v4l2.c | 53 ++- drivers/media/usb/uvc/uvc_video.c | 147 ++++--- drivers/media/usb/uvc/uvcvideo.h | 76 +++- 9 files changed, 727 insertions(+), 404 deletions(-) -- 2.29.2.729.g45daf8777d-goog