diff options
Diffstat (limited to 'drivers/media/video/marvell-ccic/mcam-core.h')
-rw-r--r-- | drivers/media/video/marvell-ccic/mcam-core.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/media/video/marvell-ccic/mcam-core.h b/drivers/media/video/marvell-ccic/mcam-core.h index f40450cf72a..2e667a05620 100644 --- a/drivers/media/video/marvell-ccic/mcam-core.h +++ b/drivers/media/video/marvell-ccic/mcam-core.h | |||
@@ -27,11 +27,21 @@ enum mcam_state { | |||
27 | S_NOTREADY, /* Not yet initialized */ | 27 | S_NOTREADY, /* Not yet initialized */ |
28 | S_IDLE, /* Just hanging around */ | 28 | S_IDLE, /* Just hanging around */ |
29 | S_FLAKED, /* Some sort of problem */ | 29 | S_FLAKED, /* Some sort of problem */ |
30 | S_STREAMING /* Streaming data */ | 30 | S_STREAMING, /* Streaming data */ |
31 | S_BUFWAIT /* streaming requested but no buffers yet */ | ||
31 | }; | 32 | }; |
32 | #define MAX_DMA_BUFS 3 | 33 | #define MAX_DMA_BUFS 3 |
33 | 34 | ||
34 | /* | 35 | /* |
36 | * Different platforms work best with different buffer modes, so we | ||
37 | * let the platform pick. | ||
38 | */ | ||
39 | enum mcam_buffer_mode { | ||
40 | B_vmalloc = 0, | ||
41 | B_DMA_contig | ||
42 | }; | ||
43 | |||
44 | /* | ||
35 | * A description of one of our devices. | 45 | * A description of one of our devices. |
36 | * Locking: controlled by s_mutex. Certain fields, however, require | 46 | * Locking: controlled by s_mutex. Certain fields, however, require |
37 | * the dev_lock spinlock; they are marked as such by comments. | 47 | * the dev_lock spinlock; they are marked as such by comments. |
@@ -49,7 +59,7 @@ struct mcam_camera { | |||
49 | unsigned int chip_id; | 59 | unsigned int chip_id; |
50 | short int clock_speed; /* Sensor clock speed, default 30 */ | 60 | short int clock_speed; /* Sensor clock speed, default 30 */ |
51 | short int use_smbus; /* SMBUS or straight I2c? */ | 61 | short int use_smbus; /* SMBUS or straight I2c? */ |
52 | 62 | enum mcam_buffer_mode buffer_mode; | |
53 | /* | 63 | /* |
54 | * Callbacks from the core to the platform code. | 64 | * Callbacks from the core to the platform code. |
55 | */ | 65 | */ |
@@ -79,7 +89,7 @@ struct mcam_camera { | |||
79 | struct vb2_queue vb_queue; | 89 | struct vb2_queue vb_queue; |
80 | struct list_head buffers; /* Available frames */ | 90 | struct list_head buffers; /* Available frames */ |
81 | 91 | ||
82 | /* DMA buffers */ | 92 | /* DMA buffers - vmalloc mode */ |
83 | unsigned int nbufs; /* How many are alloc'd */ | 93 | unsigned int nbufs; /* How many are alloc'd */ |
84 | int next_buf; /* Next to consume (dev_lock) */ | 94 | int next_buf; /* Next to consume (dev_lock) */ |
85 | unsigned int dma_buf_size; /* allocated size */ | 95 | unsigned int dma_buf_size; /* allocated size */ |
@@ -88,6 +98,11 @@ struct mcam_camera { | |||
88 | unsigned int sequence; /* Frame sequence number */ | 98 | unsigned int sequence; /* Frame sequence number */ |
89 | unsigned int buf_seq[MAX_DMA_BUFS]; /* Sequence for individual bufs */ | 99 | unsigned int buf_seq[MAX_DMA_BUFS]; /* Sequence for individual bufs */ |
90 | 100 | ||
101 | /* DMA buffers - contiguous DMA mode */ | ||
102 | struct mcam_vb_buffer *vb_bufs[MAX_DMA_BUFS]; | ||
103 | struct vb2_alloc_ctx *vb_alloc_ctx; | ||
104 | unsigned short last_delivered; | ||
105 | |||
91 | struct tasklet_struct s_tasklet; | 106 | struct tasklet_struct s_tasklet; |
92 | 107 | ||
93 | /* Current operating parameters */ | 108 | /* Current operating parameters */ |