0001
0002
0003
0004
0005 #ifndef _VPBE_H
0006 #define _VPBE_H
0007
0008 #include <linux/videodev2.h>
0009 #include <linux/i2c.h>
0010
0011 #include <media/v4l2-dev.h>
0012 #include <media/v4l2-ioctl.h>
0013 #include <media/v4l2-device.h>
0014 #include <media/davinci/vpbe_osd.h>
0015 #include <media/davinci/vpbe_venc.h>
0016 #include <media/davinci/vpbe_types.h>
0017
0018
0019 struct osd_config_info {
0020 char module_name[32];
0021 };
0022
0023 struct vpbe_output {
0024 struct v4l2_output output;
0025
0026
0027
0028
0029 char *subdev_name;
0030
0031
0032
0033
0034 char *default_mode;
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 unsigned int num_modes;
0045 struct vpbe_enc_mode_info *modes;
0046
0047
0048
0049
0050
0051
0052
0053
0054 u32 if_params;
0055 };
0056
0057
0058 struct encoder_config_info {
0059 char module_name[32];
0060
0061 unsigned int is_i2c:1;
0062
0063 struct i2c_board_info board_info;
0064 };
0065
0066
0067 struct amp_config_info {
0068 char module_name[32];
0069
0070 unsigned int is_i2c:1;
0071
0072 struct i2c_board_info board_info;
0073 };
0074
0075
0076 struct vpbe_config {
0077 char module_name[32];
0078
0079 int i2c_adapter_id;
0080 struct osd_config_info osd;
0081 struct encoder_config_info venc;
0082
0083 int num_ext_encoders;
0084 struct encoder_config_info *ext_encoders;
0085
0086 struct amp_config_info *amp;
0087 unsigned int num_outputs;
0088
0089 struct vpbe_output *outputs;
0090 };
0091
0092 struct vpbe_device;
0093
0094 struct vpbe_device_ops {
0095
0096 int (*enum_outputs)(struct vpbe_device *vpbe_dev,
0097 struct v4l2_output *output);
0098
0099
0100 int (*set_output)(struct vpbe_device *vpbe_dev,
0101 int index);
0102
0103
0104 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
0105
0106
0107 int (*s_dv_timings)(struct vpbe_device *vpbe_dev,
0108 struct v4l2_dv_timings *dv_timings);
0109
0110
0111 int (*g_dv_timings)(struct vpbe_device *vpbe_dev,
0112 struct v4l2_dv_timings *dv_timings);
0113
0114
0115 int (*enum_dv_timings)(struct vpbe_device *vpbe_dev,
0116 struct v4l2_enum_dv_timings *timings_info);
0117
0118
0119 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id std_id);
0120
0121
0122 int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
0123
0124
0125 int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev);
0126
0127
0128 void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev);
0129
0130
0131 int (*get_mode_info)(struct vpbe_device *vpbe_dev,
0132 struct vpbe_enc_mode_info*);
0133
0134
0135
0136
0137
0138 int (*set_mode)(struct vpbe_device *vpbe_dev,
0139 struct vpbe_enc_mode_info*);
0140
0141 int (*suspend)(struct vpbe_device *vpbe_dev);
0142 int (*resume)(struct vpbe_device *vpbe_dev);
0143 };
0144
0145
0146 struct vpbe_device {
0147
0148 struct v4l2_device v4l2_dev;
0149
0150 struct vpbe_config *cfg;
0151
0152 struct device *pdev;
0153
0154 struct v4l2_subdev **encoders;
0155
0156 int current_sd_index;
0157
0158 struct v4l2_subdev *amp;
0159 struct mutex lock;
0160
0161 int initialized;
0162
0163 struct clk *dac_clk;
0164
0165 struct osd_state *osd_device;
0166
0167 struct venc_platform_data *venc_device;
0168
0169
0170
0171
0172
0173
0174 int current_out_index;
0175
0176
0177 struct vpbe_enc_mode_info current_timings;
0178
0179 struct v4l2_subdev *venc;
0180
0181 struct vpbe_device_ops ops;
0182 };
0183
0184 #endif