1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _VPBE_H
14#define _VPBE_H
15
16#include <linux/videodev2.h>
17#include <linux/i2c.h>
18
19#include <media/v4l2-dev.h>
20#include <media/v4l2-ioctl.h>
21#include <media/v4l2-device.h>
22#include <media/davinci/vpbe_osd.h>
23#include <media/davinci/vpbe_venc.h>
24#include <media/davinci/vpbe_types.h>
25
26
27struct osd_config_info {
28 char module_name[32];
29};
30
31struct vpbe_output {
32 struct v4l2_output output;
33
34
35
36
37 char *subdev_name;
38
39
40
41
42 char *default_mode;
43
44
45
46
47
48
49
50
51
52 unsigned int num_modes;
53 struct vpbe_enc_mode_info *modes;
54
55
56
57
58
59
60
61
62 u32 if_params;
63};
64
65
66struct encoder_config_info {
67 char module_name[32];
68
69 unsigned int is_i2c:1;
70
71 struct i2c_board_info board_info;
72};
73
74
75struct amp_config_info {
76 char module_name[32];
77
78 unsigned int is_i2c:1;
79
80 struct i2c_board_info board_info;
81};
82
83
84struct vpbe_config {
85 char module_name[32];
86
87 int i2c_adapter_id;
88 struct osd_config_info osd;
89 struct encoder_config_info venc;
90
91 int num_ext_encoders;
92 struct encoder_config_info *ext_encoders;
93
94 struct amp_config_info *amp;
95 int num_outputs;
96
97 struct vpbe_output *outputs;
98};
99
100struct vpbe_device;
101
102struct vpbe_device_ops {
103
104 int (*g_cropcap)(struct vpbe_device *vpbe_dev,
105 struct v4l2_cropcap *cropcap);
106
107
108 int (*enum_outputs)(struct vpbe_device *vpbe_dev,
109 struct v4l2_output *output);
110
111
112 int (*set_output)(struct vpbe_device *vpbe_dev,
113 int index);
114
115
116 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
117
118
119 int (*s_dv_timings)(struct vpbe_device *vpbe_dev,
120 struct v4l2_dv_timings *dv_timings);
121
122
123 int (*g_dv_timings)(struct vpbe_device *vpbe_dev,
124 struct v4l2_dv_timings *dv_timings);
125
126
127 int (*enum_dv_timings)(struct vpbe_device *vpbe_dev,
128 struct v4l2_enum_dv_timings *timings_info);
129
130
131 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id std_id);
132
133
134 int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
135
136
137 int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev);
138
139
140 void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev);
141
142
143 int (*get_mode_info)(struct vpbe_device *vpbe_dev,
144 struct vpbe_enc_mode_info*);
145
146
147
148
149
150 int (*set_mode)(struct vpbe_device *vpbe_dev,
151 struct vpbe_enc_mode_info*);
152
153 int (*suspend)(struct vpbe_device *vpbe_dev);
154 int (*resume)(struct vpbe_device *vpbe_dev);
155};
156
157
158struct vpbe_device {
159
160 struct v4l2_device v4l2_dev;
161
162 struct vpbe_config *cfg;
163
164 struct device *pdev;
165
166 struct v4l2_subdev **encoders;
167
168 int current_sd_index;
169
170 struct v4l2_subdev *amp;
171 struct mutex lock;
172
173 int initialized;
174
175 struct clk *dac_clk;
176
177 struct osd_state *osd_device;
178
179 struct venc_platform_data *venc_device;
180
181
182
183
184
185
186 int current_out_index;
187
188
189 struct vpbe_enc_mode_info current_timings;
190
191 struct v4l2_subdev *venc;
192
193 struct vpbe_device_ops ops;
194};
195
196#endif
197