aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx25821/cx25821.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci/cx25821/cx25821.h')
-rw-r--r--drivers/media/pci/cx25821/cx25821.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/drivers/media/pci/cx25821/cx25821.h b/drivers/media/pci/cx25821/cx25821.h
index 90bdc196929f..d81a08a2df4f 100644
--- a/drivers/media/pci/cx25821/cx25821.h
+++ b/drivers/media/pci/cx25821/cx25821.h
@@ -34,9 +34,8 @@
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
-#include <media/videobuf-dma-sg.h>
+#include <media/videobuf2-dma-sg.h>
-#include "btcx-risc.h"
#include "cx25821-reg.h"
#include "cx25821-medusa-reg.h"
#include "cx25821-sram.h"
@@ -89,6 +88,13 @@
#define CX25821_BOARD_CONEXANT_ATHENA10 1
#define MAX_VID_CHANNEL_NUM 12
+
+/*
+ * Maximum capture-only channels. This can go away once video/audio output
+ * is fully supported in this driver.
+ */
+#define MAX_VID_CAP_CHANNEL_NUM 10
+
#define VID_CHANNEL_NUM 8
struct cx25821_fmt {
@@ -111,16 +117,23 @@ enum cx25821_src_sel_type {
CX25821_SRC_SEL_PARALLEL_MPEG_VIDEO
};
+struct cx25821_riscmem {
+ unsigned int size;
+ __le32 *cpu;
+ __le32 *jmp;
+ dma_addr_t dma;
+};
+
/* buffer for one video frame */
struct cx25821_buffer {
/* common v4l buffer stuff -- must be first */
- struct videobuf_buffer vb;
+ struct vb2_buffer vb;
+ struct list_head queue;
/* cx25821 specific */
unsigned int bpl;
- struct btcx_riscmem risc;
+ struct cx25821_riscmem risc;
const struct cx25821_fmt *fmt;
- u32 count;
};
enum port {
@@ -159,17 +172,9 @@ struct cx25821_i2c {
struct cx25821_dmaqueue {
struct list_head active;
- struct list_head queued;
- struct timer_list timeout;
- struct btcx_riscmem stopper;
u32 count;
};
-struct cx25821_data {
- struct cx25821_dev *dev;
- const struct sram_channel *channel;
-};
-
struct cx25821_dev;
struct cx25821_channel;
@@ -207,18 +212,17 @@ struct cx25821_video_out_data {
struct cx25821_channel {
unsigned id;
struct cx25821_dev *dev;
- struct v4l2_fh *streaming_fh;
struct v4l2_ctrl_handler hdl;
- struct cx25821_data timeout_data;
struct video_device vdev;
struct cx25821_dmaqueue dma_vidq;
- struct videobuf_queue vidq;
+ struct vb2_queue vidq;
const struct sram_channel *sram_channels;
const struct cx25821_fmt *fmt;
+ unsigned field;
unsigned int width, height;
int pixel_formats;
int use_cif_resolution;
@@ -244,6 +248,7 @@ struct cx25821_dev {
int hwrevision;
/* used by cx25821-alsa */
struct snd_card *card;
+ void *alloc_ctx;
u32 clk_freq;
@@ -405,21 +410,22 @@ extern int cx25821_sram_channel_setup(struct cx25821_dev *dev,
const struct sram_channel *ch, unsigned int bpl,
u32 risc);
-extern int cx25821_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc,
+extern int cx25821_riscmem_alloc(struct pci_dev *pci,
+ struct cx25821_riscmem *risc,
+ unsigned int size);
+extern int cx25821_risc_buffer(struct pci_dev *pci, struct cx25821_riscmem *risc,
struct scatterlist *sglist,
unsigned int top_offset,
unsigned int bottom_offset,
unsigned int bpl,
unsigned int padding, unsigned int lines);
extern int cx25821_risc_databuffer_audio(struct pci_dev *pci,
- struct btcx_riscmem *risc,
+ struct cx25821_riscmem *risc,
struct scatterlist *sglist,
unsigned int bpl,
unsigned int lines, unsigned int lpi);
-extern void cx25821_free_buffer(struct videobuf_queue *q,
+extern void cx25821_free_buffer(struct cx25821_dev *dev,
struct cx25821_buffer *buf);
-extern int cx25821_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
- u32 reg, u32 mask, u32 value);
extern void cx25821_sram_channel_dump(struct cx25821_dev *dev,
const struct sram_channel *ch);
extern void cx25821_sram_channel_dump_audio(struct cx25821_dev *dev,