forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/media/usb/uvc/uvcvideo.h
....@@ -157,12 +157,19 @@
157157 #define UVC_GUID_FORMAT_INVI \
158158 { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \
159159 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f}
160
+#define UVC_GUID_FORMAT_CNF4 \
161
+ { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \
162
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
160163
161164 #define UVC_GUID_FORMAT_D3DFMT_L8 \
162165 {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
163166 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
164167 #define UVC_GUID_FORMAT_KSMEDIA_L8_IR \
165168 {0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \
169
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
170
+
171
+#define UVC_GUID_FORMAT_HEVC \
172
+ { 'H', 'E', 'V', 'C', 0x00, 0x00, 0x10, 0x00, \
166173 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
167174
168175
....@@ -198,6 +205,8 @@
198205 #define UVC_QUIRK_RESTRICT_FRAME_RATE 0x00000200
199206 #define UVC_QUIRK_RESTORE_CTRLS_ON_INIT 0x00000400
200207 #define UVC_QUIRK_FORCE_Y8 0x00000800
208
+#define UVC_QUIRK_FORCE_BPP 0x00001000
209
+#define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000
201210
202211 /* Format flags */
203212 #define UVC_FMT_FLAG_COMPRESSED 0x00000001
....@@ -237,7 +246,7 @@
237246 enum v4l2_ctrl_type v4l2_type;
238247 u32 data_type;
239248
240
- struct uvc_menu_info *menu_info;
249
+ const struct uvc_menu_info *menu_info;
241250 u32 menu_count;
242251
243252 u32 master_id;
....@@ -369,7 +378,9 @@
369378 u8 type;
370379 u8 index;
371380 u8 bpp;
372
- u8 colorspace;
381
+ enum v4l2_colorspace colorspace;
382
+ enum v4l2_xfer_func xfer_func;
383
+ enum v4l2_ycbcr_encoding ycbcr_enc;
373384 u32 fcc;
374385 u32 flags;
375386
....@@ -491,7 +502,7 @@
491502 unsigned int max_sof; /* Maximum STC.SOF value */
492503 };
493504
494
-#define UVC_METATADA_BUF_SIZE 1024
505
+#define UVC_METADATA_BUF_SIZE 1024
495506
496507 /**
497508 * struct uvc_copy_op: Context structure to schedule asynchronous memcpy
....@@ -620,6 +631,11 @@
620631 (uvc_urb) < &(uvc_streaming)->uvc_urb[UVC_URBS]; \
621632 ++(uvc_urb))
622633
634
+static inline u32 uvc_urb_index(const struct uvc_urb *uvc_urb)
635
+{
636
+ return uvc_urb - &uvc_urb->stream->uvc_urb[0];
637
+}
638
+
623639 struct uvc_device_info {
624640 u32 quirks;
625641 u32 meta_format;
....@@ -657,6 +673,7 @@
657673 /* Status Interrupt Endpoint */
658674 struct usb_host_endpoint *int_ep;
659675 struct urb *int_urb;
676
+ bool flush_status;
660677 u8 *status;
661678 struct input_dev *input;
662679 char input_phys[64];
....@@ -748,6 +765,7 @@
748765 int uvc_create_buffers(struct uvc_video_queue *queue,
749766 struct v4l2_create_buffers *v4l2_cb);
750767 int uvc_queue_buffer(struct uvc_video_queue *queue,
768
+ struct media_device *mdev,
751769 struct v4l2_buffer *v4l2_buf);
752770 int uvc_export_buffer(struct uvc_video_queue *queue,
753771 struct v4l2_exportbuffer *exp);
....@@ -786,7 +804,8 @@
786804 int uvc_video_init(struct uvc_streaming *stream);
787805 int uvc_video_suspend(struct uvc_streaming *stream);
788806 int uvc_video_resume(struct uvc_streaming *stream, int reset);
789
-int uvc_video_enable(struct uvc_streaming *stream, int enable);
807
+int uvc_video_start_streaming(struct uvc_streaming *stream);
808
+void uvc_video_stop_streaming(struct uvc_streaming *stream);
790809 int uvc_probe_video(struct uvc_streaming *stream,
791810 struct uvc_streaming_control *probe);
792811 int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
....@@ -824,7 +843,9 @@
824843 int uvc_ctrl_init_device(struct uvc_device *dev);
825844 void uvc_ctrl_cleanup_device(struct uvc_device *dev);
826845 int uvc_ctrl_restore_values(struct uvc_device *dev);
827
-bool uvc_ctrl_status_event(struct urb *urb, struct uvc_video_chain *chain,
846
+bool uvc_ctrl_status_event_async(struct urb *urb, struct uvc_video_chain *chain,
847
+ struct uvc_control *ctrl, const u8 *data);
848
+void uvc_ctrl_status_event(struct uvc_video_chain *chain,
828849 struct uvc_control *ctrl, const u8 *data);
829850
830851 int uvc_ctrl_begin(struct uvc_video_chain *chain);