1
2
3
4
5
6 #ifndef _VPFE_CAPTURE_H
7 #define _VPFE_CAPTURE_H
8
9 #ifdef __KERNEL__
10
11
12 #include <media/v4l2-dev.h>
13 #include <linux/videodev2.h>
14 #include <linux/clk.h>
15 #include <linux/i2c.h>
16 #include <media/v4l2-fh.h>
17 #include <media/v4l2-ioctl.h>
18 #include <media/v4l2-device.h>
19 #include <media/videobuf-dma-contig.h>
20 #include <media/davinci/vpfe_types.h>
21
22 #define VPFE_CAPTURE_NUM_DECODERS 5
23
24
25 #define VPFE_MAJOR_RELEASE 0
26 #define VPFE_MINOR_RELEASE 0
27 #define VPFE_BUILD 1
28 #define VPFE_CAPTURE_VERSION_CODE ((VPFE_MAJOR_RELEASE << 16) | \
29 (VPFE_MINOR_RELEASE << 8) | \
30 VPFE_BUILD)
31
32 #define CAPTURE_DRV_NAME "vpfe-capture"
33
34 struct vpfe_pixel_format {
35 u32 pixelformat;
36
37 int bpp;
38 };
39
40 struct vpfe_std_info {
41 int active_pixels;
42 int active_lines;
43
44 int frame_format;
45 };
46
47 struct vpfe_route {
48 u32 input;
49 u32 output;
50 };
51
52 struct vpfe_subdev_info {
53
54 char name[32];
55
56 int grp_id;
57
58 int num_inputs;
59
60 struct v4l2_input *inputs;
61
62 struct vpfe_route *routes;
63
64 int can_route;
65
66 struct vpfe_hw_if_param ccdc_if_params;
67
68 struct i2c_board_info board_info;
69 };
70
71 struct vpfe_config {
72
73 int num_subdevs;
74
75 int i2c_adapter_id;
76
77 struct vpfe_subdev_info *sub_devs;
78
79 char *card_name;
80
81 char *ccdc;
82
83 struct clk *vpssclk;
84 struct clk *slaveclk;
85
86 void (*clr_intr)(int vdint);
87 };
88
89 struct vpfe_device {
90
91
92 struct video_device video_dev;
93
94 struct v4l2_subdev **sd;
95
96 struct vpfe_config *cfg;
97
98 struct v4l2_device v4l2_dev;
99
100 struct device *pdev;
101
102 u32 usrs;
103
104 u32 field_id;
105
106 u8 initialized;
107
108 struct vpfe_hw_if_param vpfe_if_params;
109
110 struct vpfe_subdev_info *current_subdev;
111
112 int current_input;
113
114 struct vpfe_std_info std_info;
115
116 int std_index;
117
118 unsigned int ccdc_irq0;
119 unsigned int ccdc_irq1;
120
121 u32 numbuffers;
122
123 u8 *fbuffers[VIDEO_MAX_FRAME];
124
125 struct videobuf_buffer *cur_frm;
126
127 struct videobuf_buffer *next_frm;
128
129
130
131
132 enum v4l2_memory memory;
133
134 struct v4l2_format fmt;
135
136
137
138
139 struct v4l2_rect crop;
140
141 struct videobuf_queue buffer_queue;
142
143 struct list_head dma_queue;
144
145 spinlock_t irqlock;
146
147 spinlock_t dma_queue_lock;
148
149 struct mutex lock;
150
151 u32 io_usrs;
152
153 u8 started;
154
155
156
157
158 u32 field_off;
159 };
160
161
162 struct vpfe_fh {
163 struct v4l2_fh fh;
164 struct vpfe_device *vpfe_dev;
165
166 u8 io_allowed;
167 };
168
169 struct vpfe_config_params {
170 u8 min_numbuffers;
171 u8 numbuffers;
172 u32 min_bufsize;
173 u32 device_bufsize;
174 };
175
176 #endif
177 #endif