{"id":18529,"url":"https://patchwork.libcamera.org/api/covers/18529/?format=json","web_url":"https://patchwork.libcamera.org/cover/18529/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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-0-543189a680de@wolfvision.net>","date":"2023-04-06T14:31:09","name":"[libcamera-devel,RFC,0/4] media: v4l2-ctrls: add controls for complex lens controller devices","submitter":{"id":135,"url":"https://patchwork.libcamera.org/api/people/135/?format=json","name":"Michael Riesch","email":"michael.riesch@wolfvision.net"},"mbox":"https://patchwork.libcamera.org/cover/18529/mbox/","series":[{"id":3837,"url":"https://patchwork.libcamera.org/api/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/covers/18529/comments/","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 8D855C32A4\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 4BEAF627AF;\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 4C26B6277E\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 DBB17647B0;\n\tThu,  6 Apr 2023 14:31:40 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPS id 4E99EC433EF;\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 EFCA6C77B6F;\n\tThu,  6 Apr 2023 14:31:39 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1680791507;\n\tbh=OJh4zaYpUGmBGJnTjRe4Hscxo/UtXSa7youeXVGyH7A=;\n\th=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=cH0MZrnjiK29RlME68L6gdHV/3A2wZeHsRYe5U8pormdHq7ueVgnk6lHoCr5/dyYA\n\tVX9THXYQST3ZoIeNI4eS4Jn/mvdAB2FKiI+QpOWdYCASDszDJnBYt5H6LsoZWCXtIx\n\t9ZsJi8Mq13ULKnrRVBHTLquFli10C2QAAIi4cNU1DLT4+wMy1AwCg5rShP2TwGkIsq\n\tUHA9ILWjWe+wi1NwkmVzEOhlz32zwVxfQu2dIH2xf/GVCbbVFweCKIaLBsBN5SU1A2\n\tsWDv1dR9kx7gQglFWAeDkIKHsKeEZ3keP0+2PyamUXjBRUFEp4R+tHnwVt/C7frjrQ\n\tI7mujx4vru1Cg==","v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1680791500;\n\tbh=OJh4zaYpUGmBGJnTjRe4Hscxo/UtXSa7youeXVGyH7A=;\n\th=From:Subject:Date:To:Cc:Reply-To:From;\n\tb=G7/UhM9cEX9Za3QvbGgTPXOvOjIGcfMCjLue5/uYMJ+G5P90iTGM0dVm/J5P8g518\n\tchLyN+8N3CvTfp7898/skBl048pW06ruR+9MNHp8feRxZX8t7MEmg6jETIgQLULPLa\n\twHMHA62pDNMH5bGsPWVzyY5rNXflfwC2m6aW/OLM01cKX8lAA61BhtuefUJGcr0uyv\n\tXo7uvBgQCrWJM2Nn2SF95X9iWtyQTpIpUTcbWtezTJq+PGMWBQzZrou0pfiTAozpsq\n\tvmdolafEqNZNH4gQ/c/kvHyLx24v0SYqC9akMzL1blGYPa/x/WJNoKbHaio65LvpPx\n\tF1lIXnHYpTyJg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=kernel.org\n\theader.i=@kernel.org header.b=\"G7/UhM9c\"; \n\tdkim-atps=neutral","Date":"Thu, 06 Apr 2023 16:31:09 +0200","Message-Id":"<20230406-feature-controls-lens-v1-0-543189a680de@wolfvision.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","X-B4-Tracking":"v=1; b=H4sIAK3XLmQC/1XNQQrCMBCF4auUWTsYm0TFreAB3IqLJJ3aQEnKT\n\tC2F0rubihuXP7yPt4AQRxK4VAswTVFiTiUOuwpC59KLMDaloVa1VkYdsSU3vpkw5DRy7gV7SoL\n\t+bO3JNtoY7aBY74TQs0uh2/QP7f/QthuY2jh//x9wv13hua4fXIphSJQAAAA=","To":"Mauro Carvalho Chehab <mchehab@kernel.org>","X-Mailer":"b4 0.12.2","X-Developer-Signature":"v=1; a=ed25519-sha256; t=1680791498; l=3101;\n\ti=michael.riesch@wolfvision.net; s=20230406; h=from:subject:message-id;\n\tbh=OJh4zaYpUGmBGJnTjRe4Hscxo/UtXSa7youeXVGyH7A=;\n\tb=6fXSMiSHAibecfHaIrXad2RhBLfWutwmqZTdnbta4uPO56oUCRTsDHvu1zXs4G8HVvItbgfTB\n\trR/pb1r9qehDeEVBAjQrMlQ8BFuiowDdBdmHHo7YYKhWXdXYOiA9T/n","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 0/4] media: v4l2-ctrls: add controls\n\tfor complex lens controller devices","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":"Hi all,\n\nThis patch series aims to add support for complex lens controllers in V4L2.\nComplex lens controllers usually feature one focus lens and one (or more)\nzoom lens(es), which are driven by stepper motors. As a consequence, a few\ncrucial differences to simple lens controllers (such as voice coil motor\n(VCM) drivers, which are already well supported in V4L2) arise:\n\n - Focus and zoom are slow.\n\nCompared to a simple VCM driver, which reacts almost instantaneously, the\nstepper motors that control the lens groups may require some time to reach\ntheir target position. Therefore, the control process in user space needs\nto receive feedback on the current status of each lens group, such as the\ncurrent position and whether or not the lens group is moving. Patch 1/4\nadds volatile and read-only status controls for each lens group.\n\n - The velocity of focus and zoom can be selected.\n\nIn contrast to a simple VCM driver, the stepper motors can move at\ndifferent velocities. Since the produced noise depends on the velocity, the\ncontrol process may want to optimize the chosen velocity. Also, some auto\nfocus algorithms use different velocities in different phases (e.g., a\ncoarse and fast scan vs. a slow and precise scan). Patch 2/4 adds speed\ncontrols for the focus lens group and the zoom lens group.\n\n - Calibration may be required.\n\nSince moving mechanical parts are involved, calibration is most likely\nnecessary. Patch 3/4 introduces controls to control calibration procedures.\n\nIn the scope of calibration, the relation between the lens positions may be\nfine-tuned. This requires the ability to control the individual lenses and\ngather feedback on their current status. Patch 4/4 introduces a pair of\ncontrols for five zoom lenses. (Five is a placeholder here. The most\ncomplex objective we had at hand happened to feature five zoom lenses.)\n\nOn the user space side, it is envisaged that libcamera operates the newly\nintroduced controls. Please note that no tests with libcamera have been\ncarried out yet, the integration will be discussed after the first round of\nfeedback to this RFC.\n\nLooking forward to your comments!\n\n---\nMichael Riesch (4):\n      media: v4l2-ctrls: add lens group status controls for zoom and focus\n      media: v4l2-ctrls: add lens group speed controls for zoom and focus\n      media: v4l2-ctrls: add lens calibration controls\n      media: v4l2-ctrls: add controls for individual zoom lenses\n\n .../userspace-api/media/v4l/ext-ctrls-camera.rst   | 105 +++++++++++++++++++++\n drivers/media/v4l2-core/v4l2-ctrls-core.c          |   9 ++\n drivers/media/v4l2-core/v4l2-ctrls-defs.c          |  30 ++++++\n include/media/v4l2-ctrls.h                         |   2 +\n include/uapi/linux/v4l2-controls.h                 |  39 ++++++++\n include/uapi/linux/videodev2.h                     |   2 +\n 6 files changed, 187 insertions(+)\n---\nbase-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6\nchange-id: 20230406-feature-controls-lens-b85575d3443a\n\nBest regards,"}