linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gergő Köteles" <soyer@irl.hu>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Gergő Köteles" <soyer@irl.hu>
Subject: [RFC PATCH 2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL
Date: Thu,  3 Aug 2023 23:28:58 +0200	[thread overview]
Message-ID: <550bf1a9adf175a166163d696e667165ce7db79f.1691096157.git.soyer@irl.hu> (raw)
In-Reply-To: <cover.1691096157.git.soyer@irl.hu>

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 <soyer@irl.hu>
---
 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 = {
-- 
2.41.0


  parent reply	other threads:[~2023-08-03 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 21:28 [RFC PATCH 0/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Gergő Köteles
2023-08-03 21:28 ` [RFC PATCH 1/2] media: v4l2: ctrls: Add ROLL_ABSOLUTE control Gergő Köteles
2023-08-03 21:28 ` Gergő Köteles [this message]
2023-08-04 18:45 ` [RFC PATCH 0/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL Michael Riesch
2023-08-04 21:33   ` Gergő Köteles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550bf1a9adf175a166163d696e667165ce7db79f.1691096157.git.soyer@irl.hu \
    --to=soyer@irl.hu \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).