From patchwork Thu Aug 3 21:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 711443 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 1FAD4C001DF for ; Thu, 3 Aug 2023 21:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230234AbjHCVo5 (ORCPT ); Thu, 3 Aug 2023 17:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjHCVo4 (ORCPT ); Thu, 3 Aug 2023 17:44:56 -0400 X-Greylist: delayed 603 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 03 Aug 2023 14:44:56 PDT Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB97D30F8; Thu, 3 Aug 2023 14:44:55 -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 0000000000072E3A.0000000064CC1C4F.0001D18F; Thu, 03 Aug 2023 23:29:50 +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 2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Date: Thu, 3 Aug 2023 23:28:58 +0200 Message-ID: <550bf1a9adf175a166163d696e667165ce7db79f.1691096157.git.soyer@irl.hu> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Logitech Streamcam can be mounted in 'portrait mode' as well. It reports the current roll (-90, 0, 90, 180) with UVC_CT_ROLL_ABSOLUTE_CONTROL. Map UVC_CT_ROLL_ABSOLUTE_CONTROL to V4L2_CID_ROLL_ABSOLUTE to make it available to userspace. Signed-off-by: Gergő Köteles --- drivers/media/usb/uvc/uvc_ctrl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 5e9d3da862dd..2801a1ee04a2 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -748,6 +748,15 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = { .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, .data_type = UVC_CTRL_DATA_TYPE_BOOLEAN, }, + { + .id = V4L2_CID_ROLL_ABSOLUTE, + .entity = UVC_GUID_UVC_CAMERA, + .selector = UVC_CT_ROLL_ABSOLUTE_CONTROL, + .size = 16, + .offset = 0, + .v4l2_type = V4L2_CTRL_TYPE_INTEGER, + .data_type = UVC_CTRL_DATA_TYPE_SIGNED, + }, }; const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = {