summaryrefslogtreecommitdiff
path: root/include/uapi/linux/usb
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2022-10-11 10:53:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-22 14:22:40 +0300
commitd182bf156c4cb8b08ce4a75e82b3357b14a4382d (patch)
treeaf1a50ae21bbe3aa75742933cc841726406a3a78 /include/uapi/linux/usb
parent9b6447e04bc2a4d06f2ef74a583848c573a25dbc (diff)
downloadlinux-d182bf156c4cb8b08ce4a75e82b3357b14a4382d.tar.xz
usb: gadget: uvc: default the ctrl request interface offsets
For the userspace it is needed to distinguish between requests for the control or streaming interface. The userspace would have to parse the configfs to know which interface index it has to compare the ctrl requests against. Since the interface numbers are not fixed, e.g. for composite gadgets, the interface offset depends on the setup. The kernel has this information when handing over the ctrl request to the userspace. This patch removes the offset from the interface numbers and expose the default interface defines in the uapi g_uvc.h. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Link: https://lore.kernel.org/r/20221011075348.1786897-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/usb')
-rw-r--r--include/uapi/linux/usb/g_uvc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/usb/g_uvc.h b/include/uapi/linux/usb/g_uvc.h
index 652f169a019e..8d7824dde1b2 100644
--- a/include/uapi/linux/usb/g_uvc.h
+++ b/include/uapi/linux/usb/g_uvc.h
@@ -21,6 +21,9 @@
#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5)
#define UVC_EVENT_LAST (V4L2_EVENT_PRIVATE_START + 5)
+#define UVC_STRING_CONTROL_IDX 0
+#define UVC_STRING_STREAMING_IDX 1
+
struct uvc_request_data {
__s32 length;
__u8 data[60];