From f61d7696159ec8af8ac7318f41c8bb9745f48584 Mon Sep 17 00:00:00 2001 From: William Wu Date: Tue, 27 Nov 2018 16:52:08 +0800 Subject: [PATCH] media: v4l: increase the data length of v4l2_event The rockchip IQ tool sends data via usb uvc. The data buf of v4l2_event is used for IQ tool userspace on uvc device side to receive vendor specific data from host, the max length of data maybe 4096 bytes, so increase the data length of v4l2_event to 4100. I have already tested the usb host uvc function, it works well with this patch. Note: The userspace need to update the data length of v4l2_event to 4100 synchronously. Change-Id: I1a4673d50137760e190a17c6981740952fac2ca7 Signed-off-by: William Wu --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 ++++ include/uapi/linux/videodev2.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 017ad89ceff5..bb3e1e96b6df 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -913,7 +913,11 @@ struct v4l2_event32 { __u32 type; union { compat_s64 value64; +#ifdef CONFIG_USB_CONFIGFS_F_UVC_ROCKCHIP + __u8 data[4100]; +#else __u8 data[64]; +#endif } u; __u32 pending; __u32 sequence; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index e21c709f18ef..049b20b9ab15 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -2153,7 +2153,11 @@ struct v4l2_event { struct v4l2_event_frame_sync frame_sync; struct v4l2_event_src_change src_change; struct v4l2_event_motion_det motion_det; +#ifdef CONFIG_USB_CONFIGFS_F_UVC_ROCKCHIP + __u8 data[4100]; +#else __u8 data[64]; +#endif } u; __u32 pending; __u32 sequence;