uvcvideo.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef __LINUX_UVCVIDEO_H_
  2. #define __LINUX_UVCVIDEO_H_
  3. #include <linux/ioctl.h>
  4. #include <linux/types.h>
  5. /*
  6. * Dynamic controls
  7. */
  8. /* Data types for UVC control data */
  9. #define UVC_CTRL_DATA_TYPE_RAW 0
  10. #define UVC_CTRL_DATA_TYPE_SIGNED 1
  11. #define UVC_CTRL_DATA_TYPE_UNSIGNED 2
  12. #define UVC_CTRL_DATA_TYPE_BOOLEAN 3
  13. #define UVC_CTRL_DATA_TYPE_ENUM 4
  14. #define UVC_CTRL_DATA_TYPE_BITMASK 5
  15. /* Control flags */
  16. #define UVC_CTRL_FLAG_SET_CUR (1 << 0)
  17. #define UVC_CTRL_FLAG_GET_CUR (1 << 1)
  18. #define UVC_CTRL_FLAG_GET_MIN (1 << 2)
  19. #define UVC_CTRL_FLAG_GET_MAX (1 << 3)
  20. #define UVC_CTRL_FLAG_GET_RES (1 << 4)
  21. #define UVC_CTRL_FLAG_GET_DEF (1 << 5)
  22. /* Control should be saved at suspend and restored at resume. */
  23. #define UVC_CTRL_FLAG_RESTORE (1 << 6)
  24. /* Control can be updated by the camera. */
  25. #define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
  26. #define UVC_CTRL_FLAG_GET_RANGE \
  27. (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \
  28. UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
  29. UVC_CTRL_FLAG_GET_DEF)
  30. struct uvc_menu_info {
  31. __u32 value;
  32. __u8 name[32];
  33. };
  34. struct uvc_xu_control_mapping {
  35. __u32 id;
  36. __u8 name[32];
  37. __u8 entity[16];
  38. __u8 selector;
  39. __u8 size;
  40. __u8 offset;
  41. __u32 v4l2_type;
  42. __u32 data_type;
  43. struct uvc_menu_info __user *menu_info;
  44. __u32 menu_count;
  45. __u32 reserved[4];
  46. };
  47. struct uvc_xu_control_query {
  48. __u8 unit;
  49. __u8 selector;
  50. __u8 query; /* Video Class-Specific Request Code, */
  51. /* defined in linux/usb/video.h A.8. */
  52. __u16 size;
  53. __u8 __user *data;
  54. };
  55. #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping)
  56. #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query)
  57. #endif