From patchwork Tue Apr 25 09:45:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 13223136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20147C77B7F for ; Tue, 25 Apr 2023 09:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbjDYJpk (ORCPT ); Tue, 25 Apr 2023 05:45:40 -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 ); 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 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 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 Cc: libcamera-devel@lists.libcamera.org, Laurent Pinchart , Sakari Ailus , Hans Verkuil , Matthias Fend , Dave Stevenson , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Riesch 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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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. + ``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 */