From 15f8f2dddbf81923aec60284435961a1343c4917 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 9 Jun 2018 14:52:10 +0300 Subject: Import the g_uvc.h header from the kernel sources In order to avoid depending on an external kernel source tree recent enough to provide the g_uvc.h header, import in the the project. Signed-off-by: Laurent Pinchart --- include/linux/usb/g_uvc.h | 40 ++++++++++++++++++++++++++++++++++++++++ lib/CMakeLists.txt | 5 ++--- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 include/linux/usb/g_uvc.h diff --git a/include/linux/usb/g_uvc.h b/include/linux/usb/g_uvc.h new file mode 100644 index 0000000..491b8ab --- /dev/null +++ b/include/linux/usb/g_uvc.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* This file is imported from the Linux kernel, don't modify it manually. */ +/* + * g_uvc.h -- USB Video Class Gadget driver API + * + * Copyright (C) 2009-2010 Laurent Pinchart + */ + +#ifndef __LINUX_USB_G_UVC_H +#define __LINUX_USB_G_UVC_H + +#include +#include +#include + +#define UVC_EVENT_FIRST (V4L2_EVENT_PRIVATE_START + 0) +#define UVC_EVENT_CONNECT (V4L2_EVENT_PRIVATE_START + 0) +#define UVC_EVENT_DISCONNECT (V4L2_EVENT_PRIVATE_START + 1) +#define UVC_EVENT_STREAMON (V4L2_EVENT_PRIVATE_START + 2) +#define UVC_EVENT_STREAMOFF (V4L2_EVENT_PRIVATE_START + 3) +#define UVC_EVENT_SETUP (V4L2_EVENT_PRIVATE_START + 4) +#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5) +#define UVC_EVENT_LAST (V4L2_EVENT_PRIVATE_START + 5) + +struct uvc_request_data { + __s32 length; + __u8 data[60]; +}; + +struct uvc_event { + union { + enum usb_device_speed speed; + struct usb_ctrlrequest req; + struct uvc_request_data data; + }; +}; + +#define UVCIOC_SEND_RESPONSE _IOW('U', 1, struct uvc_request_data) + +#endif /* __LINUX_USB_G_UVC_H */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c798d3b..ca08fd7 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -6,10 +6,9 @@ add_library(uvcgadget ${SOURCES}) set_target_properties(uvcgadget PROPERTIES PUBLIC_HEADER "${HEADERS}") target_include_directories(uvcgadget PUBLIC + $ $ - $ - PRIVATE - ${KERNEL_INCLUDE_DIR}) + $) install(TARGETS uvcgadget LIBRARY DESTINATION lib -- cgit v1.2.3