From patchwork Wed Jan 11 08:52:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunke Cao X-Patchwork-Id: 3853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3206064wrt; Wed, 11 Jan 2023 00:58:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3oThkduJrbVZznt/8PfBcmJrJSX22MFlo+JgjiQkVKrMizDPmTW0PVFuhmHJ/fcj5gfAR X-Received: by 2002:a17:906:d788:b0:7c0:e5c6:2a6d with SMTP id pj8-20020a170906d78800b007c0e5c62a6dmr62900561ejb.39.1673427518231; Wed, 11 Jan 2023 00:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673427518; cv=none; d=google.com; s=arc-20160816; b=s7Tf/M05GCO9/XZv1CtsBzxkTsxJ8P7ieRW0GstR3753x2Mm9trHnqkJj/aP7D8fxl L+mc9vbkKzqthl4i5brCwyFszP0oo7OIP1CaazX5jxFUyEJJ5GNvpklPDBw8sU24IaDR pQVFVNs/+GkL8/Tub3O1cV0Pjm5qImoyo3eBEzcpIZqbQ/+K0EKjE956wYUDrXm1YuDu HcwR950YdUbFFsmV3q1Nd7wslFt3pN3paZGh8TWL/jS21jL7iqKsJtGX1N2B6+gKNLjN OOKnqQSpHugVvT6h8lHdoY/GK+GyII6G0GudUSKRIxYHo4q9LRQoOSxOKMjFMh+0Q3mr iW5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:date:from :content-transfer-encoding:mime-version:subject:dkim-signature; bh=wqCK+F3NQ/WGaXLcIcOMDouMxXDEFoEvg+1KtOppxeY=; b=MbZQdAGMoV4I5/kVNepGWG2YqLmFMMiXYkD1VlhMydqdZfMNj3vIvLustWexSoqjHb 0dgR3uBQKuD1q5t/8wHyaQU2+i/OvaKz8mtF1Zm0vjfOHqH2QY6nI859uhtMn8+rrj4t /cjF2LXRqnHqctYGGMQUVQKSFpZ129b3kgCFkfTW/85Fcusb1SqscJJHN9PiQ8mDq5Tx rFm3v3ME1VROtLJteqXpTXoM8LtfbQ5k8roMAxrHVzGAnsIl7IPf1lyQhf6jNhsS/kBM mStjDxk8Gm2lqMYRb6KXrEysJXhj8g+oHanGriWXMZ7ohHTZrSIID1tAe4c8vd0PGP3i GixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DTcmeYWP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw11-20020a1709066a0b00b0082bed0f9405si2833866ejc.509.2023.01.11.00.58.14; Wed, 11 Jan 2023 00:58:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DTcmeYWP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235948AbjAKIwx (ORCPT + 99 others); Wed, 11 Jan 2023 03:52:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234942AbjAKIwn (ORCPT ); Wed, 11 Jan 2023 03:52:43 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9641A101D2 for ; Wed, 11 Jan 2023 00:52:42 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id bj3so11973287pjb.0 for ; Wed, 11 Jan 2023 00:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:from:to:cc:subject:date:message-id:reply-to; bh=wqCK+F3NQ/WGaXLcIcOMDouMxXDEFoEvg+1KtOppxeY=; b=DTcmeYWP40XvxuO4qpiqRHULNmiwo8+64irQJ7KINs7kMqbXY7UXrX2RP+lHjFwfuY IrrfYTghgFE/AvAVNXFpoBYXjbN52LGaYNTGAqg57PmydTAcbhGbRH/zsJnQJm+hMUcm Cz4ukJygPdmAJKtFSQri5BZi7CViCGCx0nwqY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:date:from:content-transfer-encoding:mime-version :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wqCK+F3NQ/WGaXLcIcOMDouMxXDEFoEvg+1KtOppxeY=; b=zBpfXGObSGXNzWcReVQYqsNSqRhE8uxERAQfkLP5te7fGL45MyytqAAHd6+Fi/gO55 ehbsGcPH/CTHGQZgXwAhERdfh55k8/0nriib7Jio6yXgy7KzoDnxZpWZivsoiHwlJALG p3aspo6F8RpCzFLdH4KQrknhnpCJCbBphaLgMbn8tac3AuHQnAlVsJuszqExRJwM+cWR TWe5yztxg14Aa6NMFna748dgBDRikoJs4c9pczPZy37NaJcK22mNvtbpfk9rW8Rx1FED TwYKpEQ/QrB5I8qnpo4mm+yCQBSbi36OjboZqLb7DJa4gC68ffKVqtCLOUI7gT9fOXpL hJcQ== X-Gm-Message-State: AFqh2krtKE6V7yvbm76jJcgB3CUBgWz31MwjCJxQicmW2iVGHAKSqwBN V49aeJQyVrmzZIkVqsGWcFAwLQ== X-Received: by 2002:a05:6a20:1384:b0:af:864d:e7bc with SMTP id w4-20020a056a20138400b000af864de7bcmr103740756pzh.25.1673427162145; Wed, 11 Jan 2023 00:52:42 -0800 (PST) Received: from yunkec1.tok.corp.google.com ([2401:fa00:8f:203:c84:581:fd3a:b32b]) by smtp.gmail.com with ESMTPSA id ik9-20020a170902ab0900b00183c67844aesm9566612plb.22.2023.01.11.00.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 00:52:41 -0800 (PST) Subject: [PATCH RFC 0/3] meida: uvcvideo: reimplement privacy gpio as a separate subdevice MIME-Version: 1.0 X-b4-tracking: H4sIANV4vmMC/w3LQQqAMAwEwK9IzhaMgoqfkbQuGpAqDS2I+Hd7nMO8ZEgKo6V5KaGo6RUruG0oHB J3ON2qqe/6oWNml0tY76RFwrNa9huKY0zC44R5hKcavRicTxLDUWvM5/l9PzD2TzRpAAAA From: Yunke Cao Date: Wed, 11 Jan 2023 17:52:37 +0900 Message-Id: <20230111-uvc_privacy_subdev-v1-0-f859ac9a01e3@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab , Ricardo Ribalda , Hans Verkuil Cc: Yunke Cao , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Sakari Ailus , Ricardo Ribalda X-Mailer: b4 0.11.0-dev-4d321 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754715933069791608?= X-GMAIL-MSGID: =?utf-8?q?1754715933069791608?= privacy_gpio in uvc were added as V4L2_CID_PRIVACY in uvc video node in https://lore.kernel.org/all/20201223133528.55014-1-ribalda@chromium.org/ Userspace applications often require to constantly poll privacy control. Currently, polling privacy control requires keeping the video node open, which prevents the camera from autosuspending. This patchset adds a separate v4l2 subdevice. Userspace access the gpio via V4L2_CID_PRIVACY in the new subdevice. Applications can poll the privacy control status without opening the video node and activate the camera. The non-gpio V4L2_CID_PRIVACY in uvc is not affected. Suggested-by: Ricardo Ribalda Signed-off-by: Yunke Cao --- Yunke Cao (3): media: v4l2-ctrls: Expose v4l2_ctrl_fill_event() media: uvcvideo: remove entity privacy control in the uvc video node media: uvcvideo: reimplement privacy GPIO as a separate subdevice drivers/media/usb/uvc/uvc_ctrl.c | 17 ------- drivers/media/usb/uvc/uvc_driver.c | 44 ++---------------- drivers/media/usb/uvc/uvc_entity.c | 76 +++++++++++++++++++++++++++++++ drivers/media/usb/uvc/uvcvideo.h | 19 +++++--- drivers/media/v4l2-core/v4l2-ctrls-core.c | 9 ++-- include/media/v4l2-ctrls.h | 12 +++++ 6 files changed, 111 insertions(+), 66 deletions(-) --- base-commit: 7dd4b804e08041ff56c88bdd8da742d14b17ed25 change-id: 20230111-uvc_privacy_subdev-1e7a167e86eb Best regards,