From patchwork Thu Aug 3 21:28:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 130875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1442895vqx; Thu, 3 Aug 2023 15:32:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHlEtb+51FBDIQWPuXflduxTwcOuL/W92XnwSIibLWDPMfeGYYXdW0w9zQEO6VSDsW+QKI X-Received: by 2002:a05:6402:430b:b0:51a:4d46:4026 with SMTP id m11-20020a056402430b00b0051a4d464026mr17000631edc.0.1691101978858; Thu, 03 Aug 2023 15:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691101978; cv=none; d=google.com; s=arc-20160816; b=G8kWQOtVdYRKd5QjZNDldfwEb6WVRs9qNXZ/1npxPolQrKSHwf+MJzGduXcJ0gdQCL VeTyBpu01784PNbJ3rNXFJ3qYG9Kf+XHbsjxC+beAFIVPUMLoGi+TsQF8xbihqnMEl2A 0KAG9YE8m9r2EDIYBwPK9uYMRAO/InMcDp80BM4kyokq7M1S3QdqWBFIFNMubjGCvA2z O/XfqYy40aXapzOcMDo/KGZqtH7G2Kv2yRbpGQM1ofII4kyxbMnuFIvYTeYEbHlSAa2J Kx2qmwperFpqkAnEBnet05aXL2oRBSDwZYqqR+2n6dJ2EOpLU1NL1jRnV2YmBKvVmIU4 tjuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=67UR+uTk2VKsQY0OCJLsTvkHNE1CFrNCSZeR2C/LRqU=; fh=mlxJew9CVZ4g+Al794h+irzadBlRfRbBPvTI+Z7h0G4=; b=QRBB3DC/tLMHOUKCDPCaLz/DrnPxZiOF6MNd0Nk37J1UZkTUjevs0wGRaxqhbAAXq6 ei/zqzviKD/OJ8LJORsN1DespAsZXOrXmdqkBgc5Tg+Kd1kukrxzQ8+APF1UUeWZ599c LeXcJHFSDO090IAMHFuWZg6B16IuwcFdGc0Rr8XpSx6rR8XRbncXtgVlelFXD1XDwl5G CtS+CPujE25k8dfkv9/T4L1HVKxn8dW0ndeIVb2EHUQ07MtoAlXKTT63WKjfyKLvusNH u7rpyv7PdjCpjWX/flzvutC91NydGIPD7mqrPsNT14xbPNTu8Pm6qlwGNIDSsy9/j/d+ 6BUQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a05640206c500b0051e0d77a0fasi551290edy.647.2023.08.03.15.32.32; Thu, 03 Aug 2023 15:32:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbjHCV45 (ORCPT + 99 others); Thu, 3 Aug 2023 17:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbjHCV4y (ORCPT ); Thu, 3 Aug 2023 17:56:54 -0400 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B95763ABE; Thu, 3 Aug 2023 14:56:51 -0700 (PDT) Received: from fedori.lan (51b69adf.dsl.pool.telekom.hu [::ffff:81.182.154.223]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000072E37.0000000064CC1C4D.0001D183; Thu, 03 Aug 2023 23:29:42 +0200 From: =?utf-8?b?R2VyZ8WRIEvDtnRlbGVz?= To: Mauro Carvalho Chehab , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?R2VyZ8WRIEvDtnRlbGVz?= Subject: [RFC PATCH 1/2] media: v4l2: ctrls: Add ROLL_ABSOLUTE control Date: Thu, 3 Aug 2023 23:28:57 +0200 Message-ID: <8eb0e251fb4f4ab4f3ed5472fbd26e94786b46ff.1691096157.git.soyer@irl.hu> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1773248948376532274 X-GMAIL-MSGID: 1773248948376532274 Add V4L2_CID_ROLL_ABSOLUTE as an integer control to retrieve and set the camera roll in degrees, and its documentation. Signed-off-by: Gergő Köteles --- Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst | 5 +++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + include/uapi/linux/v4l2-controls.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst index cdc515c60468..81bc31a4bf79 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst @@ -672,3 +672,8 @@ enum v4l2_scene_mode - As modes differ for each sensor, menu items are not standardized by this control and are left to the programmer. + +``V4L2_CID_ROLL_ABSOLUTE (integer)`` + This control describes the camera rotation along the image viewing axis in + degrees. Values range from -180 to +180, the default is zero. Positive + values rotate the camera clockwise, negative values counter-clockwise. diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 8696eb1cdd61..0e8af56cb2a2 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1086,6 +1086,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_CAMERA_ORIENTATION: return "Camera Orientation"; case V4L2_CID_CAMERA_SENSOR_ROTATION: return "Camera Sensor Rotation"; case V4L2_CID_HDR_SENSOR_MODE: return "HDR Sensor Mode"; + case V4L2_CID_ROLL_ABSOLUTE: return "Roll, Absolute"; /* 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 c3604a0a3e30..5131711ea873 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1075,6 +1075,8 @@ enum v4l2_auto_focus_range { #define V4L2_CID_HDR_SENSOR_MODE (V4L2_CID_CAMERA_CLASS_BASE+36) +#define V4L2_CID_ROLL_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+37) + /* FM Modulator class control IDs */ #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)