Skip to contentSkip to conversation

v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO

RFC PATCH Superseded Kim, HeungJun 1 participant 1 message Feb 24, 2011 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 2/2 v4l2-ctrls: modify uvc driver to use new menu type of V4L2_CID_FOCUS_AUTO

As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu type, this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.

---

The place using V4L2_CID_FOCUS_AUTO is one, in only this uvc driver here. So, only this driver affects the changes of V4L2_CID_FOCUS_AUTO type changes.

---
 drivers/media/video/uvc/uvc_ctrl.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
drivers/media/video/uvc/uvc_ctrl.c +9 -3
index 59f8a9a..795fd3f 100644
@@ -333,6 +333,11 @@ static struct uvc_menu_info exposure_auto_controls[] = {
 	{ 8, "Aperture Priority Mode" },
 };
 
+static struct uvc_menu_info focus_auto_controls[] = {
+	{ 2, "Auto Mode" },
+	{ 1, "Manual Mode" },
+};
+
 static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
 	__u8 query, const __u8 *data)
 {
@@ -558,10 +563,12 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
 		.name		= "Focus, Auto",
 		.entity		= UVC_GUID_UVC_CAMERA,
 		.selector	= UVC_CT_FOCUS_AUTO_CONTROL,
-		.size		= 1,
+		.size		= 2,
 		.offset		= 0,
-		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
-		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
+		.v4l2_type	= V4L2_CTRL_TYPE_MENU,
+		.data_type	= UVC_CTRL_DATA_TYPE_BITMASK,
+		.menu_info	= focus_auto_