{"id":18530,"url":"https://patchwork.libcamera.org/api/1.1/patches/18530/?format=json","web_url":"https://patchwork.libcamera.org/patch/18530/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230406-feature-controls-lens-v1-2-543189a680de@wolfvision.net>","date":"2023-04-06T14:31:11","name":"[libcamera-devel,RFC,2/4] media: v4l2-ctrls: add lens group speed controls for zoom and focus","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"fdf14d17e48c6fa5a49a17096d20be4558009e27","submitter":{"id":135,"url":"https://patchwork.libcamera.org/api/1.1/people/135/?format=json","name":"Michael Riesch","email":"michael.riesch@wolfvision.net"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18530/mbox/","series":[{"id":3837,"url":"https://patchwork.libcamera.org/api/1.1/series/3837/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3837","date":"2023-04-06T14:31:10","name":"media: v4l2-ctrls: add controls for complex lens controller devices","version":1,"mbox":"https://patchwork.libcamera.org/series/3837/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18530/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18530/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B8D01C32A5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Apr 2023 14:31:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3487627B2;\n\tThu,  6 Apr 2023 16:31:47 +0200 (CEST)","from dfw.source.kernel.org (dfw.source.kernel.org\n\t[IPv6:2604:1380:4641:c500::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48CD162720\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Apr 2023 16:31:42 +0200 (CEST)","from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby dfw.source.kernel.org (Postfix) with ESMTPS id 1569464888;\n\tThu,  6 Apr 2023 14:31:41 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPS id 9B624C433A0;\n\tThu,  6 Apr 2023 14:31:40 +0000 (UTC)","from aws-us-west-2-korg-lkml-1.web.codeaurora.org\n\t(localhost.localdomain [127.0.0.1])\n\tby smtp.lore.kernel.org (Postfix) with ESMTP id 793BAC77B7C;\n\tThu,  6 Apr 2023 14:31:40 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1680791507;\n\tbh=Chz1OqqLSVy8hSOfoQxWdgPg+hj1qsjj6Kdgplr7Wcw=;\n\th=Date:References:In-Reply-To:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=mhmhaCHAYfymB37sROQbMhV3jAg32Vdi/henZNWk1AePWGeXP2RTSn0kWn0OseL5n\n\teqrZMk0hrBcjJztc5CNg8BiyKijxKzPN4jPpDMQP0YFXhjmmrO9SZucXVo+SsvqVu3\n\tbAVOUetRqCQP8NRdsxqI16Ybw6+VPxz/Swrk3d1sNWTaMZfLJqMKD/sNhtWhnWuNYJ\n\tqZHMkLiFA8BEao2qXb9hlVpL/2GoQBYKxqdx6U2Lhaz1l2e2M7FZNUt14wB7t4uBJ3\n\tXSIzGa/k1+02QXjNvDgLW2gBHrCtu+FgCeqAEiVxwF9Nx3+A2iHnyTHd9eye0MuE++\n\tSRY7iEFM1oFQw==","v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1680791500;\n\tbh=Chz1OqqLSVy8hSOfoQxWdgPg+hj1qsjj6Kdgplr7Wcw=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;\n\tb=q6a/eLlk91wrlBS2Ho+y1ivSXltxc8nXogOh1aiPKxuGClK50sWFVrI6wd2xzwnX4\n\t0KAD50dHYLj/Rz7ytbcorigYbIlbZ4duBXDh4iP4embrKZq183Z983tNk/2sqmGwQf\n\t1HI0bH2v2CVbECbOAJUvvqfeeEMDoUxlzaDiG2mALwWCrEH9wP7ntqDqMbTMcoMgXI\n\tmMA7sWKcRK0OmcPu5SkY5xAr9Yxa9GT5hIJDQ9BgY5PehIxYBnMJQk9+QwfRVb3A5w\n\tfTMSlAG9/bxuo3eiZaTBnfFcPMcEC8B9pPuHBUSyBumzQp77VlhRKQkrSYaQoAZDt2\n\tHc+eb7mQKV6TQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=kernel.org\n\theader.i=@kernel.org header.b=\"q6a/eLlk\"; \n\tdkim-atps=neutral","Date":"Thu, 06 Apr 2023 16:31:11 +0200","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20230406-feature-controls-lens-v1-2-543189a680de@wolfvision.net>","References":"<20230406-feature-controls-lens-v1-0-543189a680de@wolfvision.net>","In-Reply-To":"<20230406-feature-controls-lens-v1-0-543189a680de@wolfvision.net>","To":"Mauro Carvalho Chehab <mchehab@kernel.org>","X-Mailer":"b4 0.12.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1680791498; l=3216;\n\ti=michael.riesch@wolfvision.net; s=20230406; h=from:subject:message-id;\n\tbh=b4YZSmV5OSkcANw6i4qtO28ABjbGRhtxIpQPQN9ckB4=;\n\tb=xFNDz6axwjBG+xovNgY7mhVeYp78O/FABWR7nJ0us5zRPKrzF8b16IMVDdHUF5xbRzkC44/IV\n\tPXcB7I0DjV+DTflx2oZTqzwinj34zhn4dpu8VV81rOlpmLYlymiYWFk","X-Developer-Key":"i=michael.riesch@wolfvision.net; a=ed25519;\n\tpk=G03kuYHL670EcdsWaNfVA7KnHWmkSpj98XziQm/hjbk=","X-Endpoint-Received":"by B4 Relay for michael.riesch@wolfvision.net/20230406\n\twith auth_id=38","X-Original-From":"Michael Riesch <michael.riesch@wolfvision.net>","Subject":"[libcamera-devel] [PATCH RFC 2/4] media: v4l2-ctrls: add lens group\n\tspeed controls for zoom and focus","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Michael Riesch via B4 Relay via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"michael.riesch@wolfvision.net","Cc":"Michael Riesch via B4 Relay\n\t<devnull+michael.riesch.wolfvision.net@kernel.org>,\n\tlinux-kernel@vger.kernel.org,\n\tMatthias Fend <Matthias.Fend@wolfvision.net>, \n\tlibcamera-devel@lists.libcamera.org,\n\tSakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Michael Riesch <michael.riesch@wolfvision.net>\n\nAdd the controls V4L2_CID_FOCUS_SPEED and V4L2_CID_ZOOM_SPEED that set\nthe speed of the zoom lens group and focus lens group, respectively.\n\nSigned-off-by: Michael Riesch <michael.riesch@wolfvision.net>\n---\n Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst | 10 ++++++++++\n drivers/media/v4l2-core/v4l2-ctrls-defs.c                  |  2 ++\n include/uapi/linux/v4l2-controls.h                         |  2 ++\n 3 files changed, 14 insertions(+)","diff":"diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst\nindex 3a270bc63f1a..5e34515024bd 100644\n--- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst\n+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst\n@@ -173,6 +173,11 @@ enum v4l2_exposure_metering -\n \twill not transition from this state until another action is performed\n \tby an application.\n \n+``V4L2_CID_FOCUS_SPEED (integer)``\n+    Set the speed with which the focus lens group of the camera is moved\n+    (V4L2_CID_FOCUS_ABSOLUTE and V4L2_CID_FOCUS_RELATIVE). The unit is\n+    driver-specific. The value should be a positive integer.\n+\n ``V4L2_CID_FOCUS_AUTO (boolean)``\n     Enables continuous automatic focus adjustments. The effect of manual\n     focus adjustments while this feature is enabled is undefined,\n@@ -287,6 +292,11 @@ enum v4l2_auto_focus_range -\n \tnot transition from this state until another action is performed by an\n \tapplication.\n \n+``V4L2_CID_ZOOM_SPEED (integer)``\n+    Set the speed with which the zoom lens group of the camera is moved\n+    (V4L2_CID_ZOOM_ABSOLUTE and V4L2_CID_ZOOM_RELATIVE). The unit is\n+    driver-specific. The value should be a positive integer.\n+\n ``V4L2_CID_IRIS_ABSOLUTE (integer)``\n     This control sets the camera's aperture to the specified value. The\n     unit is undefined. Larger values open the iris wider, smaller values\ndiff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c\nindex 9b26a3aa9e9c..2c21bcccc6ee 100644\n--- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c\n+++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c\n@@ -1046,6 +1046,8 @@ const char *v4l2_ctrl_get_name(u32 id)\n \tcase V4L2_CID_HDR_SENSOR_MODE:\t\treturn \"HDR Sensor Mode\";\n \tcase V4L2_CID_FOCUS_STATUS:\t\treturn \"Focus, Status\";\n \tcase V4L2_CID_ZOOM_STATUS:\t\treturn \"Zoom, Status\";\n+\tcase V4L2_CID_FOCUS_SPEED:\t\treturn \"Focus, Speed\";\n+\tcase V4L2_CID_ZOOM_SPEED:\t\treturn \"Zoom, Speed\";\n \n \t/* FM Radio Modulator controls */\n \t/* Keep the order of the 'case's the same as in v4l2-controls.h! */\ndiff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h\nindex 8b037467ba9a..fecce641d0d8 100644\n--- a/include/uapi/linux/v4l2-controls.h\n+++ b/include/uapi/linux/v4l2-controls.h\n@@ -1005,6 +1005,8 @@ struct v4l2_ctrl_lens_status {\n \n #define V4L2_CID_FOCUS_STATUS\t\t\t(V4L2_CID_CAMERA_CLASS_BASE + 37)\n #define V4L2_CID_ZOOM_STATUS\t\t\t(V4L2_CID_CAMERA_CLASS_BASE + 38)\n+#define V4L2_CID_FOCUS_SPEED\t\t\t(V4L2_CID_CAMERA_CLASS_BASE + 39)\n+#define V4L2_CID_ZOOM_SPEED\t\t\t(V4L2_CID_CAMERA_CLASS_BASE + 40)\n \n /* FM Modulator class control IDs */\n \n","prefixes":["libcamera-devel","RFC","2/4"]}