diff mbox series

[RFC,2/2] media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL

Message ID 550bf1a9adf175a166163d696e667165ce7db79f.1691096157.git.soyer@irl.hu
State Superseded
Headers show
Series media: v4l2: map UVC_CT_ROLL_ABSOLUTE_CONTROL | expand

Commit Message

Gergo Koteles Aug. 3, 2023, 9:28 p.m. UTC
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 mbox series

Patch

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 = {