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