1 Subject:
2 [PATCH 2/7] interface for configuring CCDC and common ccdc types
3 From:
4 m-karicheri2-l0cyMroinI0@public.gmane.org
5 Date:
6 Fri, 13 Mar 2009 17:22:39 -0400
7 To:
8 davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org, davinci_opensource_ccb-uAqBSO/uNfhBDgjK7y7TUQ@public.gmane.org, psp_video-uAqBSO/uNfhBDgjK7y7TUQ@public.gmane.org
9 Newsgroups:
10 gmane.linux.davinci
12 Adding an interface for configuring ccdc as per data format of decoder
13 output. Also adds a header file for common ccdc data types.
15 Signed-off-by: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
16 ---
17 include/media/davinci/ccdc_common.h | 48 +++++++++++++
18 include/media/davinci/ccdc_hw_device.h | 117 ++++++++++++++++++++++++++++++++
19 2 files changed, 165 insertions(+), 0 deletions(-)
20 create mode 100644 include/media/davinci/ccdc_common.h
21 create mode 100644 include/media/davinci/ccdc_hw_device.h
23 diff --git a/include/media/davinci/ccdc_common.h b/include/media/davinci/ccdc_common.h
24 new file mode 100644
25 index 0000000..0992af5
26 --- /dev/null
27 +++ b/include/media/davinci/ccdc_common.h
28 @@ -0,0 +1,48 @@
29 +/*
30 + * Copyright (C) 2008-2009 Texas Instruments Inc
31 + *
32 + * This program is free software; you can redistribute it and/or modify
33 + * it under the terms of the GNU General Public License as published by
34 + * the Free Software Foundation; either version 2 of the License, or
35 + * (at your option) any later version.
36 + *
37 + * This program is distributed in the hope that it will be useful,
38 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
39 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 + * GNU General Public License for more details.
41 + *
42 + * You should have received a copy of the GNU General Public License
43 + * along with this program; if not, write to the Free Software
44 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
45 + *
46 + **************************************************************************/
47 +#ifndef _CCDC_COMMON_H
48 +#define _CCDC_COMMON_H
49 +enum ccdc_pixfmt {
50 + CCDC_PIXFMT_RAW = 0,
51 + CCDC_PIXFMT_YCBCR_16BIT = 1,
52 + CCDC_PIXFMT_YCBCR_8BIT = 2
53 +};
54 +
55 +enum ccdc_frmfmt {
56 + CCDC_FRMFMT_PROGRESSIVE = 0,
57 + CCDC_FRMFMT_INTERLACED = 1
58 +};
59 +
60 +/* PIXEL ORDER IN MEMORY from LSB to MSB */
61 +/* only applicable for 8-bit input mode */
62 +enum ccdc_pixorder {
63 + CCDC_PIXORDER_CBYCRY = 1,
64 + CCDC_PIXORDER_YCBYCR = 0
65 +};
66 +
67 +enum ccdc_buftype {
68 + CCDC_BUFTYPE_FLD_INTERLEAVED,
69 + CCDC_BUFTYPE_FLD_SEPARATED
70 +};
71 +
72 +enum ccdc_pinpol {
73 + CCDC_PINPOL_POSITIVE = 0,
74 + CCDC_PINPOL_NEGATIVE = 1
75 +};
76 +#endif
77 diff --git a/include/media/davinci/ccdc_hw_device.h b/include/media/davinci/ccdc_hw_device.h
78 new file mode 100644
79 index 0000000..4ae9876
80 --- /dev/null
81 +++ b/include/media/davinci/ccdc_hw_device.h
82 @@ -0,0 +1,117 @@
83 +/*
84 + * Copyright (C) 2008 Texas Instruments Inc
85 + *
86 + * This program is free software; you can redistribute it and/or modify
87 + * it under the terms of the GNU General Public License as published by
88 + * the Free Software Foundation; either version 2 of the License, or
89 + * (at your option) any later version.
90 + *
91 + * This program is distributed in the hope that it will be useful,
92 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
93 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94 + * GNU General Public License for more details.
95 + *
96 + * You should have received a copy of the GNU General Public License
97 + * along with this program; if not, write to the Free Software
98 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
99 + *
100 + * ccdc device API
101 + */
102 +#ifndef _CCDC_HW_DEVICE_H
103 +#define _CCDC_HW_DEVICE_H
104 +
105 +#ifdef __KERNEL__
106 +#include <linux/videodev2.h>
107 +#include <linux/device.h>
108 +#include <media/davinci/vpfe_types.h>
109 +#include <media/davinci/ccdc_common.h>
110 +/*
111 + * Maximum number of capture channels supported by VPFE
112 + */
113 +#define CCDC_CAPTURE_NUM_CHANNELS 1
114 +/*
115 + * vpfe hw interface
116 + */
117 +struct ccdc_hw_device {
118 +
119 + /* vpfe device name */
120 + char name[30];
121 +
122 + /* Pointer to initialize function to initialize ccdc device */
123 + int (*open) (struct device *dev);
124 + /* Set of functions pointers for control related functions.
125 + * Use queryctrl of decoder interface to check if it is a decoder
126 + * control id. If not passed to ccdc to process it
127 + */
128 + /* set ccdc base address */
129 + void (*set_ccdc_base)(void *base, int size);
130 +
131 + /* set vpss base address */
132 + void (*set_vpss_base)(void *base, int size);
133 +
134 + /* get ccdc base */
135 + void * (*get_ccdc_base)(void);
136 +
137 + /* get vpss base */
138 + void * (*get_vpss_base)(void);
139 +
140 + void (*enable) (int en);
141 + /*
142 + * Pointer to function to enable or disable ccdc
143 + */
144 + u32 (*reset) (void);
145 + /* reset sbl. only for 6446 */
146 + void (*enable_out_to_sdram) (int en);
147 + /* Pointer to function to set hw frame type */
148 + int (*set_hw_if_type) (enum vpfe_hw_if_type iface);
149 + /* get interface parameters */
150 + int (*get_hw_if_params) (struct vpfe_hw_if_param *param);
151 + /* Pointer to function to set parameters. Used
152 + * for implementing VPFE_S_CCDC_PARAMS
153 + */
154 + int (*setparams) (void *params);
155 + /* Pointer to function to get parameter. Used
156 + * for implementing VPFE_G_CCDC_PARAMS
157 + */
158 + int (*getparams) (void *params);
159 + /* Pointer to function to configure ccdc */
160 + int (*configure) (void);
161 +
162 + /* enumerate hw pix formats */
163 + int (*enum_pix)(enum vpfe_hw_pix_format *hw_pix, int i);
164 + /* Pointer to function to set buffer type */
165 + int (*set_buftype) (enum ccdc_buftype buf_type);
166 + /* Pointer to function to get buffer type */
167 + int (*get_buftype) (enum ccdc_buftype *buf_type);
168 + /* Pointer to function to set frame format */
169 + int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);
170 + /* Pointer to function to get frame format */
171 + int (*get_frame_format) (enum ccdc_frmfmt *frm_fmt);
172 + /* Pointer to function to set buffer type */
173 + int (*get_pixelformat) (enum vpfe_hw_pix_format *pixfmt);
174 + /* Pointer to function to get pixel format. Uses V4L2 type */
175 + int (*set_pixelformat) (enum vpfe_hw_pix_format pixfmt);
176 + /* Pointer to function to set image window */
177 + int (*set_image_window) (struct v4l2_rect *win);
178 + /* Pointer to function to set image window */
179 + int (*get_image_window) (struct v4l2_rect *win);
180 + /* Pointer to function to get line length */
181 + int (*get_line_length) (unsigned int *len);
182 +
183 + /* Query SoC control IDs */
184 + int (*queryctrl)(struct v4l2_queryctrl *qctrl);
185 + /* Set SoC control */
186 + int (*setcontrol)(struct v4l2_control *ctrl);
187 + /* Get SoC control */
188 + int (*getcontrol)(struct v4l2_control *ctrl);
189 + /* Pointer to function to set current standard info */
190 + /* Pointer to function to set frame buffer address */
191 + void (*setfbaddr) (unsigned long addr);
192 + /* Pointer to function to get field id */
193 + int (*getfid) (void);
194 + /* Pointer to deinitialize function */
195 + int (*close) (struct device *dev);
196 +};
197 +
198 +#endif
199 +#endif
200 -- 1.6.0.4