aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/davinci
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/media/davinci
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/media/davinci')
-rw-r--r--include/media/davinci/vpbe.h30
-rw-r--r--include/media/davinci/vpbe_display.h15
-rw-r--r--include/media/davinci/vpbe_osd.h2
-rw-r--r--include/media/davinci/vpbe_types.h8
-rw-r--r--include/media/davinci/vpbe_venc.h6
-rw-r--r--include/media/davinci/vpif_types.h85
6 files changed, 19 insertions, 127 deletions
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
index a7ca4884c46..8b11fb03798 100644
--- a/include/media/davinci/vpbe.h
+++ b/include/media/davinci/vpbe.h
@@ -35,7 +35,7 @@ struct osd_config_info {
35struct vpbe_output { 35struct vpbe_output {
36 struct v4l2_output output; 36 struct v4l2_output output;
37 /* 37 /*
38 * If output capabilities include dv_timings, list supported timings 38 * If output capabilities include dv_preset, list supported presets
39 * below 39 * below
40 */ 40 */
41 char *subdev_name; 41 char *subdev_name;
@@ -63,7 +63,6 @@ struct vpbe_output {
63 * output basis. If per mode is needed, we may have to move this to 63 * output basis. If per mode is needed, we may have to move this to
64 * mode_info structure 64 * mode_info structure
65 */ 65 */
66 enum v4l2_mbus_pixelcode if_params;
67}; 66};
68 67
69/* encoder configuration info */ 68/* encoder configuration info */
@@ -75,15 +74,6 @@ struct encoder_config_info {
75 struct i2c_board_info board_info; 74 struct i2c_board_info board_info;
76}; 75};
77 76
78/*amplifier configuration info */
79struct amp_config_info {
80 char module_name[32];
81 /* Is this an i2c device ? */
82 unsigned int is_i2c:1;
83 /* i2c subdevice board info */
84 struct i2c_board_info board_info;
85};
86
87/* structure for defining vpbe display subsystem components */ 77/* structure for defining vpbe display subsystem components */
88struct vpbe_config { 78struct vpbe_config {
89 char module_name[32]; 79 char module_name[32];
@@ -94,8 +84,6 @@ struct vpbe_config {
94 /* external encoder information goes here */ 84 /* external encoder information goes here */
95 int num_ext_encoders; 85 int num_ext_encoders;
96 struct encoder_config_info *ext_encoders; 86 struct encoder_config_info *ext_encoders;
97 /* amplifier information goes here */
98 struct amp_config_info *amp;
99 int num_outputs; 87 int num_outputs;
100 /* Order is venc outputs followed by LCD and then external encoders */ 88 /* Order is venc outputs followed by LCD and then external encoders */
101 struct vpbe_output *outputs; 89 struct vpbe_output *outputs;
@@ -120,16 +108,16 @@ struct vpbe_device_ops {
120 unsigned int (*get_output)(struct vpbe_device *vpbe_dev); 108 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
121 109
122 /* Set DV preset at current output */ 110 /* Set DV preset at current output */
123 int (*s_dv_timings)(struct vpbe_device *vpbe_dev, 111 int (*s_dv_preset)(struct vpbe_device *vpbe_dev,
124 struct v4l2_dv_timings *dv_timings); 112 struct v4l2_dv_preset *dv_preset);
125 113
126 /* Get DV presets supported at the output */ 114 /* Get DV presets supported at the output */
127 int (*g_dv_timings)(struct vpbe_device *vpbe_dev, 115 int (*g_dv_preset)(struct vpbe_device *vpbe_dev,
128 struct v4l2_dv_timings *dv_timings); 116 struct v4l2_dv_preset *dv_preset);
129 117
130 /* Enumerate the DV Presets supported at the output */ 118 /* Enumerate the DV Presets supported at the output */
131 int (*enum_dv_timings)(struct vpbe_device *vpbe_dev, 119 int (*enum_dv_presets)(struct vpbe_device *vpbe_dev,
132 struct v4l2_enum_dv_timings *timings_info); 120 struct v4l2_dv_enum_preset *preset_info);
133 121
134 /* Set std at the output */ 122 /* Set std at the output */
135 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); 123 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
@@ -170,8 +158,6 @@ struct vpbe_device {
170 struct v4l2_subdev **encoders; 158 struct v4l2_subdev **encoders;
171 /* current encoder index */ 159 /* current encoder index */
172 int current_sd_index; 160 int current_sd_index;
173 /* external amplifier v4l2 subdevice */
174 struct v4l2_subdev *amp;
175 struct mutex lock; 161 struct mutex lock;
176 /* device initialized */ 162 /* device initialized */
177 int initialized; 163 int initialized;
@@ -179,8 +165,6 @@ struct vpbe_device {
179 struct clk *dac_clk; 165 struct clk *dac_clk;
180 /* osd_device pointer */ 166 /* osd_device pointer */
181 struct osd_state *osd_device; 167 struct osd_state *osd_device;
182 /* venc device pointer */
183 struct venc_platform_data *venc_device;
184 /* 168 /*
185 * fields below are accessed by users of vpbe_device. Not the 169 * fields below are accessed by users of vpbe_device. Not the
186 * ones above 170 * ones above
diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h
index 8dffffedbb5..dbf6b37682c 100644
--- a/include/media/davinci/vpbe_display.h
+++ b/include/media/davinci/vpbe_display.h
@@ -16,7 +16,7 @@
16/* Header files */ 16/* Header files */
17#include <linux/videodev2.h> 17#include <linux/videodev2.h>
18#include <media/v4l2-common.h> 18#include <media/v4l2-common.h>
19#include <media/videobuf2-dma-contig.h> 19#include <media/videobuf-dma-contig.h>
20#include <media/davinci/vpbe_types.h> 20#include <media/davinci/vpbe_types.h>
21#include <media/davinci/vpbe_osd.h> 21#include <media/davinci/vpbe_osd.h>
22#include <media/davinci/vpbe.h> 22#include <media/davinci/vpbe.h>
@@ -62,11 +62,6 @@ struct display_layer_info {
62 enum osd_v_exp_ratio v_exp; 62 enum osd_v_exp_ratio v_exp;
63}; 63};
64 64
65struct vpbe_disp_buffer {
66 struct vb2_buffer vb;
67 struct list_head list;
68};
69
70/* vpbe display object structure */ 65/* vpbe display object structure */
71struct vpbe_layer { 66struct vpbe_layer {
72 /* number of buffers in fbuffers */ 67 /* number of buffers in fbuffers */
@@ -74,15 +69,13 @@ struct vpbe_layer {
74 /* Pointer to the vpbe_display */ 69 /* Pointer to the vpbe_display */
75 struct vpbe_display *disp_dev; 70 struct vpbe_display *disp_dev;
76 /* Pointer pointing to current v4l2_buffer */ 71 /* Pointer pointing to current v4l2_buffer */
77 struct vpbe_disp_buffer *cur_frm; 72 struct videobuf_buffer *cur_frm;
78 /* Pointer pointing to next v4l2_buffer */ 73 /* Pointer pointing to next v4l2_buffer */
79 struct vpbe_disp_buffer *next_frm; 74 struct videobuf_buffer *next_frm;
80 /* videobuf specific parameters 75 /* videobuf specific parameters
81 * Buffer queue used in video-buf 76 * Buffer queue used in video-buf
82 */ 77 */
83 struct vb2_queue buffer_queue; 78 struct videobuf_queue buffer_queue;
84 /* allocator-specific contexts for each plane */
85 struct vb2_alloc_ctx *alloc_ctx;
86 /* Queue of filled frames */ 79 /* Queue of filled frames */
87 struct list_head dma_queue; 80 struct list_head dma_queue;
88 /* Used in video-buf */ 81 /* Used in video-buf */
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h
index 5ab0d8d41f6..d7e397a444e 100644
--- a/include/media/davinci/vpbe_osd.h
+++ b/include/media/davinci/vpbe_osd.h
@@ -357,7 +357,7 @@ struct osd_state {
357 spinlock_t lock; 357 spinlock_t lock;
358 struct device *dev; 358 struct device *dev;
359 dma_addr_t osd_base_phys; 359 dma_addr_t osd_base_phys;
360 void __iomem *osd_base; 360 unsigned long osd_base;
361 unsigned long osd_size; 361 unsigned long osd_size;
362 /* 1-->the isr will toggle the VID0 ping-pong buffer */ 362 /* 1-->the isr will toggle the VID0 ping-pong buffer */
363 int pingpong; 363 int pingpong;
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h
index 9b85396514b..727f55170e4 100644
--- a/include/media/davinci/vpbe_types.h
+++ b/include/media/davinci/vpbe_types.h
@@ -32,6 +32,11 @@ enum vpbe_enc_timings_type {
32 VPBE_ENC_TIMINGS_INVALID = 0x8, 32 VPBE_ENC_TIMINGS_INVALID = 0x8,
33}; 33};
34 34
35union vpbe_timings {
36 v4l2_std_id std_id;
37 unsigned int dv_preset;
38};
39
35/* 40/*
36 * struct vpbe_enc_mode_info 41 * struct vpbe_enc_mode_info
37 * @name: ptr to name string of the standard, "NTSC", "PAL" etc 42 * @name: ptr to name string of the standard, "NTSC", "PAL" etc
@@ -68,8 +73,7 @@ enum vpbe_enc_timings_type {
68struct vpbe_enc_mode_info { 73struct vpbe_enc_mode_info {
69 unsigned char *name; 74 unsigned char *name;
70 enum vpbe_enc_timings_type timings_type; 75 enum vpbe_enc_timings_type timings_type;
71 v4l2_std_id std_id; 76 union vpbe_timings timings;
72 struct v4l2_dv_timings dv_timings;
73 unsigned int interlaced; 77 unsigned int interlaced;
74 unsigned int xres; 78 unsigned int xres;
75 unsigned int yres; 79 unsigned int yres;
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
index cc78c2eb16d..426c205831a 100644
--- a/include/media/davinci/vpbe_venc.h
+++ b/include/media/davinci/vpbe_venc.h
@@ -29,14 +29,10 @@
29 29
30struct venc_platform_data { 30struct venc_platform_data {
31 enum vpbe_version venc_type; 31 enum vpbe_version venc_type;
32 int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type,
33 int field);
34 int (*setup_clock)(enum vpbe_enc_timings_type type, 32 int (*setup_clock)(enum vpbe_enc_timings_type type,
35 unsigned int pixclock); 33 unsigned int mode);
36 int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode);
37 /* Number of LCD outputs supported */ 34 /* Number of LCD outputs supported */
38 int num_lcd_outputs; 35 int num_lcd_outputs;
39 struct vpbe_if_params *lcd_if_params;
40}; 36};
41 37
42enum venc_ioctls { 38enum venc_ioctls {
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
deleted file mode 100644
index 3882e0675cc..00000000000
--- a/include/media/davinci/vpif_types.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2011 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPIF_TYPES_H
18#define _VPIF_TYPES_H
19
20#include <linux/i2c.h>
21
22#define VPIF_CAPTURE_MAX_CHANNELS 2
23#define VPIF_DISPLAY_MAX_CHANNELS 2
24
25enum vpif_if_type {
26 VPIF_IF_BT656,
27 VPIF_IF_BT1120,
28 VPIF_IF_RAW_BAYER
29};
30
31struct vpif_interface {
32 enum vpif_if_type if_type;
33 unsigned hd_pol:1;
34 unsigned vd_pol:1;
35 unsigned fid_pol:1;
36};
37
38struct vpif_subdev_info {
39 const char *name;
40 struct i2c_board_info board_info;
41};
42
43struct vpif_output {
44 struct v4l2_output output;
45 const char *subdev_name;
46 u32 input_route;
47 u32 output_route;
48};
49
50struct vpif_display_chan_config {
51 const struct vpif_output *outputs;
52 int output_count;
53 bool clip_en;
54};
55
56struct vpif_display_config {
57 int (*set_clock)(int, int);
58 struct vpif_subdev_info *subdevinfo;
59 int subdev_count;
60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
61 const char *card_name;
62};
63
64struct vpif_input {
65 struct v4l2_input input;
66 const char *subdev_name;
67 u32 input_route;
68 u32 output_route;
69};
70
71struct vpif_capture_chan_config {
72 struct vpif_interface vpif_if;
73 const struct vpif_input *inputs;
74 int input_count;
75};
76
77struct vpif_capture_config {
78 int (*setup_input_channel_mode)(int);
79 int (*setup_input_path)(int, const char *);
80 struct vpif_capture_chan_config chan_config[VPIF_CAPTURE_MAX_CHANNELS];
81 struct vpif_subdev_info *subdev_info;
82 int subdev_count;
83 const char *card_name;
84};
85#endif /* _VPIF_TYPES_H */