@@ -355,6 +355,20 @@ static const struct uvc_control_info uvc_ctrls[] = {
.flags = UVC_CTRL_FLAG_GET_CUR
| UVC_CTRL_FLAG_AUTO_UPDATE,
},
+ {
+ .entity = UVC_GUID_CTRL_CLASS,
+ .selector = UVC_CC_CAMERA_CLASS,
+ .index = 0,
+ .size = 1,
+ .flags = 0,
+ },
+ {
+ .entity = UVC_GUID_CTRL_CLASS,
+ .selector = UVC_CC_USER_CLASS,
+ .index = 1,
+ .size = 1,
+ .flags = 0,
+ },
};
static const struct uvc_menu_info power_line_frequency_controls[] = {
@@ -753,6 +767,26 @@ 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_CAMERA_CLASS,
+ .name = "Camera Controls",
+ .entity = UVC_GUID_CTRL_CLASS,
+ .selector = UVC_CC_CAMERA_CLASS,
+ .size = 1,
+ .offset = 0,
+ .v4l2_type = V4L2_CTRL_TYPE_CTRL_CLASS,
+ .data_type = UVC_CTRL_DATA_TYPE_BOOLEAN,
+ },
+ {
+ .id = V4L2_CID_USER_CLASS,
+ .name = "User Controls",
+ .entity = UVC_GUID_CTRL_CLASS,
+ .selector = UVC_CC_USER_CLASS,
+ .size = 1,
+ .offset = 0,
+ .v4l2_type = V4L2_CTRL_TYPE_CTRL_CLASS,
+ .data_type = UVC_CTRL_DATA_TYPE_BOOLEAN,
+ },
};
/* ------------------------------------------------------------------------
@@ -62,6 +62,9 @@
#define UVC_GUID_EXT_GPIO_CONTROLLER \
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03}
+#define UVC_GUID_CTRL_CLASS \
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04}
#define UVC_GUID_FORMAT_MJPEG \
{ 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \
@@ -175,6 +178,11 @@
{ 'H', 'E', 'V', 'C', 0x00, 0x00, 0x10, 0x00, \
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+/* ------------------------------------------------------------------------
+ * Control Class Constants
+ */
+#define UVC_CC_CAMERA_CLASS 0
+#define UVC_CC_USER_CLASS 1
/* ------------------------------------------------------------------------
* Driver specific constants.
Add new bindings for class controls. This controls will be implemented by a virtual entity. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- drivers/media/usb/uvc/uvc_ctrl.c | 34 ++++++++++++++++++++++++++++++++ drivers/media/usb/uvc/uvcvideo.h | 8 ++++++++ 2 files changed, 42 insertions(+)