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 (*enum_outputs)(struct vpbe_device *vpbe_dev,
105 struct v4l2_output *output);
106
107
108 int (*set_output)(struct vpbe_device *vpbe_dev,
109 int index);
110
111
112 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
113
114
115 int (*s_dv_timings)(struct vpbe_device *vpbe_dev,
116 struct v4l2_dv_timings *dv_timings);
117
118
119 int (*g_dv_timings)(struct vpbe_device *vpbe_dev,
120 struct v4l2_dv_timings *dv_timings);
121
122
123 int (*enum_dv_timings)(struct vpbe_device *vpbe_dev,
124 struct v4l2_enum_dv_timings *timings_info);
125
126
127 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id std_id);
128
129
130 int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
131
132
133 int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev);
134
135
136 void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev);
137
138
139 int (*get_mode_info)(struct vpbe_device *vpbe_dev,
140 struct vpbe_enc_mode_info*);
141
142
143
144
145
146 int (*set_mode)(struct vpbe_device *vpbe_dev,
147 struct vpbe_enc_mode_info*);
148
149 int (*suspend)(struct vpbe_device *vpbe_dev);
150 int (*resume)(struct vpbe_device *vpbe_dev);
151};
152
153
154struct vpbe_device {
155
156 struct v4l2_device v4l2_dev;
157
158 struct vpbe_config *cfg;
159
160 struct device *pdev;
161
162 struct v4l2_subdev **encoders;
163
164 int current_sd_index;
165
166 struct v4l2_subdev *amp;
167 struct mutex lock;
168
169 int initialized;
170
171 struct clk *dac_clk;
172
173 struct osd_state *osd_device;
174
175 struct venc_platform_data *venc_device;
176
177
178
179
180
181
182 int current_out_index;
183
184
185 struct vpbe_enc_mode_info current_timings;
186
187 struct v4l2_subdev *venc;
188
189 struct vpbe_device_ops ops;
190};
191
192#endif
193