Message ID | 20230406-feature-controls-lens-v2-4-faa8ad2bc404@wolfvision.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3285121vqo; Tue, 25 Apr 2023 02:48:11 -0700 (PDT) X-Google-Smtp-Source: AKy350ZtsDqnOzRcsTFe0RV3AWEqVPoH6vl09ZQYt6ivxuH2MzkdlJiYjarcSy2dZ5JJ6XsLEarE X-Received: by 2002:a17:90b:1b4a:b0:24b:5eb7:f404 with SMTP id nv10-20020a17090b1b4a00b0024b5eb7f404mr14664601pjb.41.1682416090974; Tue, 25 Apr 2023 02:48:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682416090; cv=pass; d=google.com; s=arc-20160816; b=W25I9SEU1ebJYqea2jpw1DoxehGxXROSPpS9X6uYkt+OUy+1jvsc9XiQYBpXTzawmf 4zcySDJYAgam+xS6q67NoUEq5LP6x0aDmq1eNNLBCLQTYvWIbm2kWiNiyFutVqtpjIfZ anBzeBs7qZOM/Tdeo0HJ+PIjtbYxA3ALkeOyj5jk9hi/GAtX/5wnPGp+fTVGWeShfnnS JAjmO+o36GWGP9u7tq+hvAcF+FoCz4HQHjJnuQC6n1rN7ZPfs/nKpTX9yD5GijUSLE9l /9G1mIfF+iHQl0FpIPsKPGfYxa7sKjDckFsR0FvlkSDibh4Eeuyzb0Lxz0p7fSwU5xCy EiDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:in-reply-to:references :message-id:content-transfer-encoding:subject:date:from :dkim-signature; bh=TQrDJvOM/69KPMgS9CzR0tv6l6Kk/FgdIf0NDXzqS9o=; b=eKHESX5ph/ekQ7jRUc+wQxG1v0WMKeTELX6BDn7I9taA0aLgAJAzzA5z1tEXcZdA60 80ljVmYJXs1DgC2F7aOSfkRLKl4veo4TqLIeDodkKXlX/oB2UjagnX7Jqy/PzDxarua6 gXdQB3nAZqmbaHrWTzeBloLTgsDYhIX8Ygz1PfzBxUd2IhOTa/CdphvkF43yV/Txy2Gd G68c//DBJ9a9mFktk88BoXyDplUPAc+F3TkBeM2xR0AEtnNnpZfKUISkrvb58inr1M4w PwZjlMcnj3dqmawbx+mkR8GGwHmsEMJdDtUfgjDz79ZW4QAZV4ssBcbDLPu+6O6TLqmD IcIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=kmt1j1fb; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr17-20020a17090b4b9100b0023b481b8dcesi17337318pjb.102.2023.04.25.02.47.56; Tue, 25 Apr 2023 02:48:10 -0700 (PDT) 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=@wolfvision.net header.s=selector2 header.b=kmt1j1fb; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232203AbjDYJpn (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Tue, 25 Apr 2023 05:45:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233713AbjDYJpg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Apr 2023 05:45:36 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F65C15E; Tue, 25 Apr 2023 02:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdJfWUJamBHEzqqzWnYt4XpKtzL5MDYgF+9ydAA5N4bf4eSqvJpL62JmWWKYjNml+FDmsDP7/KH0B6wIghCO5+gflNEuOekYjWvKaGBJ4P969/q9kwNgqNo5NzPZolrzF5q6KA8yloHVydUyMzHW+ammKImtT9haAZOqruL3cuBLXxfIkIVr3R6rCbWtpS+gIQJqVPN+QJwPyv8pE/LHcUg5ZsUmqqtDyLa8lX+m9/1of3pJfZrOIiT5gzKW6vUMtnx3z2uhyLCwTEHJfiRxQu4Mk8Nq5hcsMRiyNBw1mpNHYTaQf84iuIRCI5vdmg/8bEl5nDMQN3C1Se8GjB5csw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TQrDJvOM/69KPMgS9CzR0tv6l6Kk/FgdIf0NDXzqS9o=; b=nmWs6dPydYgDFO7jmKiUUuT9zZZRGz3k9DOEJ+jdNLft5UHqj/EpHrwP9zpean0DvxU1R+bPWTTaARHmgIlNamloprvghLZCn4B2BsehMN8GoPY7khFtdkDQmhrbzhRWoIPOxBlGnQfFfYQjztXCVRUeeyyg9vCWVnXW4+dKIpEOTOTvncDiAiNV6X01fC6J265BZf/GExkdW50r1pU8x9yA7RSnt60ktO9M85px3xGA233DY16FVuYgwTzzncCgh+8CffS63+M8RZEtI8pDwQbhT1BNTl4lVtSj96LK1TCswH0gm5P20HJiJBY8V0Jr37njhZ/WblUp6akvBidZ3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TQrDJvOM/69KPMgS9CzR0tv6l6Kk/FgdIf0NDXzqS9o=; b=kmt1j1fbhlj+T8jn1r+/bbqM/g6CpYDcnOsKTQjCEDfEdMRdtmND7LOsktXd8ei2BuirNzSEe2pu57+jlzP7+iYx32OzFtbQFmDCrG00/HjZTiVTQFPw/P+WXboPNsHksWgMRc9UdfO2fPDmEefc7WuCvvFYZoJjnrznfzJW2sI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from GV1SPRMB0046.eurprd08.prod.outlook.com (2603:10a6:150:84::17) by DU0PR08MB7995.eurprd08.prod.outlook.com (2603:10a6:10:3e2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 09:45:26 +0000 Received: from GV1SPRMB0046.eurprd08.prod.outlook.com ([fe80::3734:409a:8031:4f54]) by GV1SPRMB0046.eurprd08.prod.outlook.com ([fe80::3734:409a:8031:4f54%3]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 09:45:26 +0000 From: Michael Riesch <michael.riesch@wolfvision.net> Date: Tue, 25 Apr 2023 11:45:14 +0200 Subject: [PATCH RFC v2 4/6] media: v4l2-ctrls: add lens group speed controls for zoom and focus Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230406-feature-controls-lens-v2-4-faa8ad2bc404@wolfvision.net> References: <20230406-feature-controls-lens-v2-0-faa8ad2bc404@wolfvision.net> In-Reply-To: <20230406-feature-controls-lens-v2-0-faa8ad2bc404@wolfvision.net> To: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: libcamera-devel@lists.libcamera.org, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Matthias Fend <Matthias.Fend@wolfvision.net>, Dave Stevenson <dave.stevenson@raspberrypi.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Riesch <michael.riesch@wolfvision.net> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1682415922; l=3264; i=michael.riesch@wolfvision.net; s=20230425; h=from:subject:message-id; bh=B6OiJRa47o14LtJJ73V2E+VFtxvPLWW9YHiaI+U9DCE=; b=JtypR8MO8CEbYK0b+q55Wzuz0OY62YDr3AARmuBx0AF9uIg5IbZwZ8S57w/DXaxkykw2d5KJI VLue5UZQOq0DHIWfSvqtvLD+7Zrn6KwjslShkZGLCNLDlRFVQdYK5dR X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=1QQdXA2QbwdxaQn/VQK0hz04C8IBYhDowbK0hlNU4Ng= X-ClientProxiedBy: VI1PR0802CA0032.eurprd08.prod.outlook.com (2603:10a6:800:a9::18) To GV1SPRMB0046.eurprd08.prod.outlook.com (2603:10a6:150:84::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1SPRMB0046:EE_|DU0PR08MB7995:EE_ X-MS-Office365-Filtering-Correlation-Id: 977200d2-c61d-427b-c89f-08db4571cc3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hv1M7+ibVKiYX3nC/eM2IrwaIgG6SvaTOfVyvAdlq3E3aSI4euUwYkVFeyT6xCWrOCFLDd/vQO37CSdjPg7rBMKFskDHc+/BhS/o0loIaFVHZWxkRLnWWrAUdYlZsqgrCEWB4LdjQXUwH6mOLKHpdFQTl7IFyE5A9xMEP7OxFY3opYoOngCTGrbu7GPCsQQXptjBQNFqGWcEk5YlOsvCF60dK4K3YLeMcpIqYFe1JH4UOV2OnBk6LJei/aYA2hE9Ygd9psM+n2jXew7CWTgQZT8nRq+qCEIseuh1QJ3ez0J7LeJ07mFbCLbivn8wMU33UTo2/pj6NxUqJ6pr1fPhVSame0z4v2r8qyLYK41/2bTii61WwhllxKN/kYOQLabVu2dHpt+80w9yKntm3qzis01B6RVSNfkd0OIFXRt8RZymNBqNq2z6y/V1zyHWlNKG9N7Bob2olGjnG4biuvqRvzd0gHxihIh59dae8ZyIUfCR545X3n9e8ue9EGYkAu8E6CBM/XE+Oilyjet08SISe5ewH7CciuLc7infsOC1zisJQMzgDS2DigLo2TQMRadwkcqic1wq/Gx6a57POqKI5QIG8CVYwbWxbxdp8xFEYfL5Q0LJsMdJSF8WPYaLfGy4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1SPRMB0046.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(366004)(39850400004)(346002)(451199021)(38350700002)(38100700002)(6506007)(6512007)(26005)(186003)(8936002)(2616005)(83380400001)(107886003)(44832011)(2906002)(8676002)(5660300002)(36756003)(478600001)(54906003)(6486002)(52116002)(316002)(6666004)(4326008)(6916009)(66556008)(41300700001)(66946007)(86362001)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LRIcO+LehSPKQVkKrx9KqzlYhaP7?= =?utf-8?q?sDbu1pxIWBi4DCE/RLAtNFoo4AItBe0dXawZ0rgKdWmgCiCaLr7KshswrthoYuWvZ?= =?utf-8?q?ijY0z22B5rnWBI+qZhA+s2jIa55oPbASiJgzByV8Ng6GRBG1QijCDBI7n3QfW3t6u?= =?utf-8?q?wbUojDNOALUhwjIi5DhwY8A9rooIZYSXsWOXqWGVzVb6A8wyk2atRYUcM7pKPf1Ib?= =?utf-8?q?YWTeDPSkebVnZ3AAT0SWfK8sHu2AQe+aFgvkeg+5yBhp18Fy0+qKCRxi5ng3h70pq?= =?utf-8?q?Ed4cr/cIPVeRPmlr84Mv+iyfoeUSKRCtkIkcwIUtz8uPMNqfWBeHvUTuqJAi2C0TE?= =?utf-8?q?Pk0Rs1Q9L7wAYBEKQSsW3QVft4guvhn0C1otaxpTeSob5UF+o9//Nu8ixfqTSRC2m?= =?utf-8?q?Ffqyx+VCu27rz2YAv+YoPrx1J9gV8yXjix6HPr0jorIQUlSte5ghTOoUC8SyEsM/p?= =?utf-8?q?QTbu9xOD3HoYrD3kdcXted25RbEvROH3+Nr0MQIaS6IlEzYDWtadU5kJ8kAqM4FGq?= =?utf-8?q?jWqAjSTShMBUcTlpRb1g63aP0cza2pUvtyWLaEpDXIXHoKN3kmNiMQwaC0UJosPxR?= =?utf-8?q?5TcPChpmkTDvN9CzcDl51yrVJGQog0L5JzOQ6q+ATZivbJheN8s3wi7KK/NQZvO51?= =?utf-8?q?ajrE6UlahtQv7+rrQlAtsfBFrkRE3R4fivBFPslOBIsluWEZ/4TYQJz0MwE+0PhEa?= =?utf-8?q?iIwl8GnPF7Rw6yS47Fu86UMtI2F6tM88LV6Nsl/rg22olLzXN4QSmI122/G0zKnqC?= =?utf-8?q?WeKcXAIS4005FEbpnWluT7jykVWYTb106FixY8G8NuZQ1bKFf2h3+SS/2ttiJvtFv?= =?utf-8?q?SIFpF0resyXGrAkz8ufmIthm1L54REZGUDFG76p0Knq5Ay01rCLUghyvZabsfjX4F?= =?utf-8?q?GteV5q44A0ssPpVXkr/AY0Slnw2bY9i/i/b2Wbfs2WhtVObRYhR0mtbdnmTiXdSEC?= =?utf-8?q?d9L+NXOs8evRKMLMq6WqH2uxSt2OPT51vPPig+2Hhnjk8Fu2uM4baHVNCdn347DNi?= =?utf-8?q?rUmd0H1LQO67PHe3jPUmyPDJZBDIvY0MiSwWfEeGaZkjTAXhrbfwLGnJCVIuani5o?= =?utf-8?q?x1RYGRmIkgXDH5AMPenzmKrpACtAEWZGNVj7LSABWzMqTv5OrNWCS9NHwmHqMuX+X?= =?utf-8?q?4CRrQzQFCkm+yEHiRLKqBC8wmgX/1kQhu1Ttx493HRw2ewStjCvwCxDjd9KKZDTZe?= =?utf-8?q?DnPb8JDhLLeubN1lIL4Yq9x5v95e0hS73tIqF/21UG4PAUu8sVrtW92yitoKJdqX7?= =?utf-8?q?BwoHWExU5IlGN7zPq/7Br2K7iPLCz/hXVz0+xxMdrf3SXrByeCLwaDEsT1B6VRyYx?= =?utf-8?q?xwuuCDaL/wza3PYRJ1PQgXDhBOVsw7TecNEgMRndwQ/GF3173f0l4spWsBxt5/bAO?= =?utf-8?q?ptsx+dY2DtzxVcUQ2NnyD3Zp+DLRdHg7r0s82sEfdpZwSSP/Q2X5Ls0EgCZkD7xre?= =?utf-8?q?1nvbWLhrqmeaGgU9dtciNwf1SYzi+OHh1Y7i6bBM3vumLVPJ5fW4A1C/Ppcolc/Jq?= =?utf-8?q?DdvA1M5Q70V1YaGdq+vbxyVjajyeZjt6uw=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 977200d2-c61d-427b-c89f-08db4571cc3b X-MS-Exchange-CrossTenant-AuthSource: GV1SPRMB0046.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 09:45:26.4582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ic03Ri6QJsvjZMGyqp9jYpF2ZNO+BSdAVsqESARqVlQfY/J3uSdVBezToOgCBjDcm7NPxZUD2ByBa+8mgT713uaszDJmybSoHseu8lmJeQk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7995 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764141134782410488?= X-GMAIL-MSGID: =?utf-8?q?1764141134782410488?= |
Series |
media: v4l2-ctrls: add controls for complex lens controller devices
|
|
Commit Message
Michael Riesch
April 25, 2023, 9:45 a.m. UTC
Add the controls V4L2_CID_FOCUS_SPEED and V4L2_CID_ZOOM_SPEED that set
the speed of the zoom lens group and focus lens group, respectively.
Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst | 10 ++++++++++
drivers/media/v4l2-core/v4l2-ctrls-defs.c | 2 ++
include/uapi/linux/v4l2-controls.h | 2 ++
3 files changed, 14 insertions(+)
Comments
Hi Michael, Thank you for the patch. On Tue, Apr 25, 2023 at 11:45:14AM +0200, Michael Riesch wrote: > Add the controls V4L2_CID_FOCUS_SPEED and V4L2_CID_ZOOM_SPEED that set > the speed of the zoom lens group and focus lens group, respectively. Ah, now the UVC relative focus and zoom controls could be implemented ;-) They still don't match the definition of the corresponding V4L2 controls, so I'm still tempted to deprecate both. > Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> > --- > Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst | 10 ++++++++++ > drivers/media/v4l2-core/v4l2-ctrls-defs.c | 2 ++ > include/uapi/linux/v4l2-controls.h | 2 ++ > 3 files changed, 14 insertions(+) > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst > index 3ea4175f9619..a17620ab03b9 100644 > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst > @@ -174,6 +174,11 @@ enum v4l2_exposure_metering - > will not transition from this state until another action is performed > by an application. > > +``V4L2_CID_FOCUS_SPEED (integer)`` > + Set the speed with which the focus lens group of the camera is moved > + (V4L2_CID_FOCUS_ABSOLUTE and V4L2_CID_FOCUS_RELATIVE). The unit is > + driver-specific. The value should be a positive integer. > + Could you explain your expected use cases for focus and zoom speed ? > ``V4L2_CID_FOCUS_AUTO (boolean)`` > Enables continuous automatic focus adjustments. The effect of manual > focus adjustments while this feature is enabled is undefined, > @@ -287,6 +292,11 @@ enum v4l2_auto_focus_range - > not transition from this state until another action is performed by an > application. > > +``V4L2_CID_ZOOM_SPEED (integer)`` > + Set the speed with which the zoom lens group of the camera is moved > + (V4L2_CID_ZOOM_ABSOLUTE and V4L2_CID_ZOOM_RELATIVE). The unit is > + driver-specific. The value should be a positive integer. > + > ``V4L2_CID_IRIS_ABSOLUTE (integer)`` > This control sets the camera's aperture to the specified value. The > unit is undefined. Larger values open the iris wider, smaller values > diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c > index 794ef3ab0c02..3ef465ba73bd 100644 > --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c > +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c > @@ -1048,6 +1048,8 @@ const char *v4l2_ctrl_get_name(u32 id) > case V4L2_CID_FOCUS_STATUS: return "Focus, Status"; > case V4L2_CID_ZOOM_CURRENT: return "Zoom, Current"; > case V4L2_CID_ZOOM_STATUS: return "Zoom, Status"; > + case V4L2_CID_FOCUS_SPEED: return "Focus, Speed"; > + case V4L2_CID_ZOOM_SPEED: return "Zoom, Speed"; > > /* FM Radio Modulator controls */ > /* Keep the order of the 'case's the same as in v4l2-controls.h! */ > diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h > index 793ee8c65e87..8d84508d4db8 100644 > --- a/include/uapi/linux/v4l2-controls.h > +++ b/include/uapi/linux/v4l2-controls.h > @@ -1001,6 +1001,8 @@ enum v4l2_auto_focus_range { > #define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+38) > #define V4L2_CID_ZOOM_CURRENT (V4L2_CID_CAMERA_CLASS_BASE+39) > #define V4L2_CID_ZOOM_STATUS (V4L2_CID_CAMERA_CLASS_BASE+40) > +#define V4L2_CID_FOCUS_SPEED (V4L2_CID_CAMERA_CLASS_BASE+41) > +#define V4L2_CID_ZOOM_SPEED (V4L2_CID_CAMERA_CLASS_BASE+42) > > /* FM Modulator class control IDs */ >
Hi Laurent, On 6/7/23 09:07, Laurent Pinchart wrote: > Hi Michael, > > Thank you for the patch. > > On Tue, Apr 25, 2023 at 11:45:14AM +0200, Michael Riesch wrote: >> Add the controls V4L2_CID_FOCUS_SPEED and V4L2_CID_ZOOM_SPEED that set >> the speed of the zoom lens group and focus lens group, respectively. > > Ah, now the UVC relative focus and zoom controls could be implemented > ;-) They still don't match the definition of the corresponding V4L2 > controls, so I'm still tempted to deprecate both. There is also V4L2_CID_ZOOM_CONTINUOUS that could be mapped to the UVC relative zoom, if I am not mistaken. I had a similar V4L2_CID_FOCUS_CONTINUOUS control in mind briefly, but for our use case this would not be general enough. >> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> >> --- >> Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst | 10 ++++++++++ >> drivers/media/v4l2-core/v4l2-ctrls-defs.c | 2 ++ >> include/uapi/linux/v4l2-controls.h | 2 ++ >> 3 files changed, 14 insertions(+) >> >> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst >> index 3ea4175f9619..a17620ab03b9 100644 >> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst >> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst >> @@ -174,6 +174,11 @@ enum v4l2_exposure_metering - >> will not transition from this state until another action is performed >> by an application. >> >> +``V4L2_CID_FOCUS_SPEED (integer)`` >> + Set the speed with which the focus lens group of the camera is moved >> + (V4L2_CID_FOCUS_ABSOLUTE and V4L2_CID_FOCUS_RELATIVE). The unit is >> + driver-specific. The value should be a positive integer. >> + > > Could you explain your expected use cases for focus and zoom speed ? As I outlined in the cover letter, the speed of the lenses can be adjusted. This can be used e.g., in the autofocus algorithm, where a coarse scan and a fine grained scan can be implemented using different speeds. The adjustable zoom speed control is simply there to give the user the choice to zoom in/out fast or slow. Should this go into the documentation? Best regards, Michael > >> ``V4L2_CID_FOCUS_AUTO (boolean)`` >> Enables continuous automatic focus adjustments. The effect of manual >> focus adjustments while this feature is enabled is undefined, >> @@ -287,6 +292,11 @@ enum v4l2_auto_focus_range - >> not transition from this state until another action is performed by an >> application. >> >> +``V4L2_CID_ZOOM_SPEED (integer)`` >> + Set the speed with which the zoom lens group of the camera is moved >> + (V4L2_CID_ZOOM_ABSOLUTE and V4L2_CID_ZOOM_RELATIVE). The unit is >> + driver-specific. The value should be a positive integer. >> + >> ``V4L2_CID_IRIS_ABSOLUTE (integer)`` >> This control sets the camera's aperture to the specified value. The >> unit is undefined. Larger values open the iris wider, smaller values >> diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c >> index 794ef3ab0c02..3ef465ba73bd 100644 >> --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c >> +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c >> @@ -1048,6 +1048,8 @@ const char *v4l2_ctrl_get_name(u32 id) >> case V4L2_CID_FOCUS_STATUS: return "Focus, Status"; >> case V4L2_CID_ZOOM_CURRENT: return "Zoom, Current"; >> case V4L2_CID_ZOOM_STATUS: return "Zoom, Status"; >> + case V4L2_CID_FOCUS_SPEED: return "Focus, Speed"; >> + case V4L2_CID_ZOOM_SPEED: return "Zoom, Speed"; >> >> /* FM Radio Modulator controls */ >> /* Keep the order of the 'case's the same as in v4l2-controls.h! */ >> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h >> index 793ee8c65e87..8d84508d4db8 100644 >> --- a/include/uapi/linux/v4l2-controls.h >> +++ b/include/uapi/linux/v4l2-controls.h >> @@ -1001,6 +1001,8 @@ enum v4l2_auto_focus_range { >> #define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+38) >> #define V4L2_CID_ZOOM_CURRENT (V4L2_CID_CAMERA_CLASS_BASE+39) >> #define V4L2_CID_ZOOM_STATUS (V4L2_CID_CAMERA_CLASS_BASE+40) >> +#define V4L2_CID_FOCUS_SPEED (V4L2_CID_CAMERA_CLASS_BASE+41) >> +#define V4L2_CID_ZOOM_SPEED (V4L2_CID_CAMERA_CLASS_BASE+42) >> >> /* FM Modulator class control IDs */ >> >
diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst index 3ea4175f9619..a17620ab03b9 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst @@ -174,6 +174,11 @@ enum v4l2_exposure_metering - will not transition from this state until another action is performed by an application. +``V4L2_CID_FOCUS_SPEED (integer)`` + Set the speed with which the focus lens group of the camera is moved + (V4L2_CID_FOCUS_ABSOLUTE and V4L2_CID_FOCUS_RELATIVE). The unit is + driver-specific. The value should be a positive integer. + ``V4L2_CID_FOCUS_AUTO (boolean)`` Enables continuous automatic focus adjustments. The effect of manual focus adjustments while this feature is enabled is undefined, @@ -287,6 +292,11 @@ enum v4l2_auto_focus_range - not transition from this state until another action is performed by an application. +``V4L2_CID_ZOOM_SPEED (integer)`` + Set the speed with which the zoom lens group of the camera is moved + (V4L2_CID_ZOOM_ABSOLUTE and V4L2_CID_ZOOM_RELATIVE). The unit is + driver-specific. The value should be a positive integer. + ``V4L2_CID_IRIS_ABSOLUTE (integer)`` This control sets the camera's aperture to the specified value. The unit is undefined. Larger values open the iris wider, smaller values diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 794ef3ab0c02..3ef465ba73bd 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1048,6 +1048,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_FOCUS_STATUS: return "Focus, Status"; case V4L2_CID_ZOOM_CURRENT: return "Zoom, Current"; case V4L2_CID_ZOOM_STATUS: return "Zoom, Status"; + case V4L2_CID_FOCUS_SPEED: return "Focus, Speed"; + case V4L2_CID_ZOOM_SPEED: return "Zoom, Speed"; /* FM Radio Modulator controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 793ee8c65e87..8d84508d4db8 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1001,6 +1001,8 @@ enum v4l2_auto_focus_range { #define V4L2_CID_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+38) #define V4L2_CID_ZOOM_CURRENT (V4L2_CID_CAMERA_CLASS_BASE+39) #define V4L2_CID_ZOOM_STATUS (V4L2_CID_CAMERA_CLASS_BASE+40) +#define V4L2_CID_FOCUS_SPEED (V4L2_CID_CAMERA_CLASS_BASE+41) +#define V4L2_CID_ZOOM_SPEED (V4L2_CID_CAMERA_CLASS_BASE+42) /* FM Modulator class control IDs */