forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/media/usb/cx231xx/cx231xx.h
....@@ -1,22 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 cx231xx.h - driver for Conexant Cx23100/101/102 USB video capture devices
34
45 Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
56 Based on em28xx driver
67
7
- This program is free software; you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation; either version 2 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program; if not, write to the Free Software
19
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
208 */
219
2210 #ifndef _CX231XX_H
....@@ -32,7 +20,7 @@
3220
3321 #include <media/drv-intf/cx2341x.h>
3422
35
-#include <media/videobuf-vmalloc.h>
23
+#include <media/videobuf2-vmalloc.h>
3624 #include <media/v4l2-device.h>
3725 #include <media/v4l2-ctrls.h>
3826 #include <media/v4l2-fh.h>
....@@ -133,7 +121,6 @@
133121 #define CX23417_RESET 9
134122
135123 struct cx23417_fmt {
136
- char *name;
137124 u32 fourcc; /* v4l2 format id */
138125 int depth;
139126 int flags;
....@@ -236,8 +223,8 @@
236223 /* buffer for one video frame */
237224 struct cx231xx_buffer {
238225 /* common v4l buffer stuff -- must be first */
239
- struct videobuf_buffer vb;
240
-
226
+ struct vb2_v4l2_buffer vb;
227
+ struct list_head list;
241228 struct list_head frame;
242229 int top_field;
243230 int receiving;
....@@ -250,7 +237,6 @@
250237
251238 struct cx231xx_dmaqueue {
252239 struct list_head active;
253
- struct list_head queued;
254240
255241 wait_queue_head_t wq;
256242
....@@ -264,6 +250,7 @@
264250 u32 lines_completed;
265251 u8 field1_done;
266252 u32 lines_per_field;
253
+ u32 sequence;
267254
268255 /*Mpeg2 control buffer*/
269256 u8 *p_left_data;
....@@ -439,23 +426,6 @@
439426 };
440427
441428 struct cx231xx;
442
-
443
-struct cx231xx_fh {
444
- struct v4l2_fh fh;
445
- struct cx231xx *dev;
446
- unsigned int stream_on:1; /* Locks streams */
447
- enum v4l2_buf_type type;
448
-
449
- struct videobuf_queue vb_vidq;
450
-
451
- /* vbi capture */
452
- struct videobuf_queue vidq;
453
- struct videobuf_queue vbiq;
454
-
455
- /* MPEG Encoder specifics ONLY */
456
-
457
- atomic_t v4l_reading;
458
-};
459429
460430 /*****************************************************************/
461431 /* set/get i2c */
....@@ -646,7 +616,8 @@
646616 /* frame properties */
647617 int width; /* current frame width */
648618 int height; /* current frame height */
649
- int interlaced; /* 1=interlace fileds, 0=just top fileds */
619
+ int interlaced; /* 1=interlace fields, 0=just top fields */
620
+ unsigned int size;
650621
651622 struct cx231xx_audio adev;
652623
....@@ -669,6 +640,9 @@
669640 struct media_entity input_ent[MAX_CX231XX_INPUT];
670641 struct media_pad input_pad[MAX_CX231XX_INPUT];
671642 #endif
643
+
644
+ struct vb2_queue vidq;
645
+ struct vb2_queue vbiq;
672646
673647 unsigned char eedata[256];
674648
....@@ -730,6 +704,7 @@
730704 u8 USE_ISO;
731705 struct cx231xx_tvnorm encodernorm;
732706 struct cx231xx_tsport ts1, ts2;
707
+ struct vb2_queue mpegq;
733708 struct video_device v4l_device;
734709 atomic_t v4l_reader_count;
735710 u32 freq;