Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Support UVC_CROSXU_CONTROL_IQ_PROFILE

The ChromeOS XU provides a control to change the IQ profile for a camera.
It can be switched from VIVID (a.k.a. standard) to NONE (a.k.a. natural).

Wire it up to the standard v4l2 control.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
0f99b8be 04ddfcdb

+39
+34
drivers/media/usb/uvc/uvc_ctrl.c
··· 376 376 | UVC_CTRL_FLAG_GET_DEF 377 377 | UVC_CTRL_FLAG_AUTO_UPDATE, 378 378 }, 379 + { 380 + .entity = UVC_GUID_CHROMEOS_XU, 381 + .selector = UVC_CROSXU_CONTROL_IQ_PROFILE, 382 + .index = 3, 383 + .size = 1, 384 + .flags = UVC_CTRL_FLAG_SET_CUR 385 + | UVC_CTRL_FLAG_GET_RANGE 386 + | UVC_CTRL_FLAG_RESTORE, 387 + }, 379 388 }; 380 389 381 390 static const u32 uvc_control_classes[] = { ··· 393 384 }; 394 385 395 386 static const int exposure_auto_mapping[] = { 2, 1, 4, 8 }; 387 + static const int cros_colorfx_mapping[] = { 388 + 1, /* V4L2_COLORFX_NONE */ 389 + -1, /* V4L2_COLORFX_BW */ 390 + -1, /* V4L2_COLORFX_SEPIA */ 391 + -1, /* V4L2_COLORFX_NEGATIVE */ 392 + -1, /* V4L2_COLORFX_EMBOSS */ 393 + -1, /* V4L2_COLORFX_SKETCH */ 394 + -1, /* V4L2_COLORFX_SKY_BLUE */ 395 + -1, /* V4L2_COLORFX_GRASS_GREEN */ 396 + -1, /* V4L2_COLORFX_SKIN_WHITEN */ 397 + 0, /* V4L2_COLORFX_VIVID */ 398 + }; 399 + 396 400 397 401 static bool uvc_ctrl_mapping_is_compound(struct uvc_control_mapping *mapping) 398 402 { ··· 996 974 .v4l2_type = V4L2_CTRL_TYPE_BITMASK, 997 975 .data_type = UVC_CTRL_DATA_TYPE_BITMASK, 998 976 .name = "Region of Interest Auto Ctrls", 977 + }, 978 + { 979 + .id = V4L2_CID_COLORFX, 980 + .entity = UVC_GUID_CHROMEOS_XU, 981 + .selector = UVC_CROSXU_CONTROL_IQ_PROFILE, 982 + .size = 8, 983 + .offset = 0, 984 + .v4l2_type = V4L2_CTRL_TYPE_MENU, 985 + .data_type = UVC_CTRL_DATA_TYPE_ENUM, 986 + .menu_mapping = cros_colorfx_mapping, 987 + .menu_mask = BIT(V4L2_COLORFX_VIVID) | 988 + BIT(V4L2_COLORFX_NONE), 999 989 }, 1000 990 }; 1001 991
+5
include/linux/usb/uvc.h
··· 29 29 #define UVC_GUID_EXT_GPIO_CONTROLLER \ 30 30 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 31 31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03} 32 + #define UVC_GUID_CHROMEOS_XU \ 33 + {0x24, 0xe9, 0xd7, 0x74, 0xc9, 0x49, 0x45, 0x4a, \ 34 + 0x98, 0xa3, 0xc8, 0x07, 0x7e, 0x05, 0x1c, 0xa3} 32 35 #define UVC_GUID_MSXU_1_5 \ 33 36 {0xdc, 0x95, 0x3f, 0x0f, 0x32, 0x26, 0x4e, 0x4c, \ 34 37 0x92, 0xc9, 0xa0, 0x47, 0x82, 0xf4, 0x3b, 0xc8} ··· 52 49 #define UVC_MSXU_CONTROL_FRAMERATE_THROTTLE 0x0e 53 50 #define UVC_MSXU_CONTROL_FIELDOFVIEW2_CONFIG 0x0f 54 51 #define UVC_MSXU_CONTROL_FIELDOFVIEW2 0x10 52 + 53 + #define UVC_CROSXU_CONTROL_IQ_PROFILE 0x04 55 54 56 55 #define UVC_GUID_FORMAT_MJPEG \ 57 56 { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \