.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | cx231xx.h - driver for Conexant Cx23100/101/102 USB video capture devices |
---|
3 | 4 | |
---|
4 | 5 | Copyright (C) 2008 <srinivasa.deevi at conexant dot com> |
---|
5 | 6 | Based on em28xx driver |
---|
6 | 7 | |
---|
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. |
---|
20 | 8 | */ |
---|
21 | 9 | |
---|
22 | 10 | #ifndef _CX231XX_H |
---|
.. | .. |
---|
32 | 20 | |
---|
33 | 21 | #include <media/drv-intf/cx2341x.h> |
---|
34 | 22 | |
---|
35 | | -#include <media/videobuf-vmalloc.h> |
---|
| 23 | +#include <media/videobuf2-vmalloc.h> |
---|
36 | 24 | #include <media/v4l2-device.h> |
---|
37 | 25 | #include <media/v4l2-ctrls.h> |
---|
38 | 26 | #include <media/v4l2-fh.h> |
---|
.. | .. |
---|
133 | 121 | #define CX23417_RESET 9 |
---|
134 | 122 | |
---|
135 | 123 | struct cx23417_fmt { |
---|
136 | | - char *name; |
---|
137 | 124 | u32 fourcc; /* v4l2 format id */ |
---|
138 | 125 | int depth; |
---|
139 | 126 | int flags; |
---|
.. | .. |
---|
236 | 223 | /* buffer for one video frame */ |
---|
237 | 224 | struct cx231xx_buffer { |
---|
238 | 225 | /* common v4l buffer stuff -- must be first */ |
---|
239 | | - struct videobuf_buffer vb; |
---|
240 | | - |
---|
| 226 | + struct vb2_v4l2_buffer vb; |
---|
| 227 | + struct list_head list; |
---|
241 | 228 | struct list_head frame; |
---|
242 | 229 | int top_field; |
---|
243 | 230 | int receiving; |
---|
.. | .. |
---|
250 | 237 | |
---|
251 | 238 | struct cx231xx_dmaqueue { |
---|
252 | 239 | struct list_head active; |
---|
253 | | - struct list_head queued; |
---|
254 | 240 | |
---|
255 | 241 | wait_queue_head_t wq; |
---|
256 | 242 | |
---|
.. | .. |
---|
264 | 250 | u32 lines_completed; |
---|
265 | 251 | u8 field1_done; |
---|
266 | 252 | u32 lines_per_field; |
---|
| 253 | + u32 sequence; |
---|
267 | 254 | |
---|
268 | 255 | /*Mpeg2 control buffer*/ |
---|
269 | 256 | u8 *p_left_data; |
---|
.. | .. |
---|
439 | 426 | }; |
---|
440 | 427 | |
---|
441 | 428 | 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 | | -}; |
---|
459 | 429 | |
---|
460 | 430 | /*****************************************************************/ |
---|
461 | 431 | /* set/get i2c */ |
---|
.. | .. |
---|
646 | 616 | /* frame properties */ |
---|
647 | 617 | int width; /* current frame width */ |
---|
648 | 618 | 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; |
---|
650 | 621 | |
---|
651 | 622 | struct cx231xx_audio adev; |
---|
652 | 623 | |
---|
.. | .. |
---|
669 | 640 | struct media_entity input_ent[MAX_CX231XX_INPUT]; |
---|
670 | 641 | struct media_pad input_pad[MAX_CX231XX_INPUT]; |
---|
671 | 642 | #endif |
---|
| 643 | + |
---|
| 644 | + struct vb2_queue vidq; |
---|
| 645 | + struct vb2_queue vbiq; |
---|
672 | 646 | |
---|
673 | 647 | unsigned char eedata[256]; |
---|
674 | 648 | |
---|
.. | .. |
---|
730 | 704 | u8 USE_ISO; |
---|
731 | 705 | struct cx231xx_tvnorm encodernorm; |
---|
732 | 706 | struct cx231xx_tsport ts1, ts2; |
---|
| 707 | + struct vb2_queue mpegq; |
---|
733 | 708 | struct video_device v4l_device; |
---|
734 | 709 | atomic_t v4l_reader_count; |
---|
735 | 710 | u32 freq; |
---|