Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
isppreview.h
Go to the documentation of this file.
1 /*
2  * isppreview.h
3  *
4  * TI OMAP3 ISP - Preview module
5  *
6  * Copyright (C) 2010 Nokia Corporation
7  * Copyright (C) 2009 Texas Instruments, Inc.
8  *
9  * Contacts: Laurent Pinchart <[email protected]>
10  * Sakari Ailus <[email protected]>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24  * 02110-1301 USA
25  */
26 
27 #ifndef OMAP3_ISP_PREVIEW_H
28 #define OMAP3_ISP_PREVIEW_H
29 
30 #include <linux/omap3isp.h>
31 #include <linux/types.h>
32 #include <media/v4l2-ctrls.h>
33 
34 #include "ispvideo.h"
35 
36 #define ISPPRV_BRIGHT_STEP 0x1
37 #define ISPPRV_BRIGHT_DEF 0x0
38 #define ISPPRV_BRIGHT_LOW 0x0
39 #define ISPPRV_BRIGHT_HIGH 0xFF
40 #define ISPPRV_BRIGHT_UNITS 0x1
41 
42 #define ISPPRV_CONTRAST_STEP 0x1
43 #define ISPPRV_CONTRAST_DEF 0x10
44 #define ISPPRV_CONTRAST_LOW 0x0
45 #define ISPPRV_CONTRAST_HIGH 0xFF
46 #define ISPPRV_CONTRAST_UNITS 0x1
47 
48 /* Additional features not listed in linux/omap3isp.h */
49 #define OMAP3ISP_PREV_CONTRAST (1 << 17)
50 #define OMAP3ISP_PREV_BRIGHTNESS (1 << 18)
51 #define OMAP3ISP_PREV_FEATURES_END (1 << 19)
52 
57 };
58 
59 #define PREVIEW_OUTPUT_RESIZER (1 << 1)
60 #define PREVIEW_OUTPUT_MEMORY (1 << 2)
61 
62 /* Configure byte layout of YUV image */
68 };
69 
70 /*
71  * struct prev_params - Structure for all configuration
72  * @busy: Bitmask of busy parameters (being updated or used)
73  * @update: Bitmask of the parameters to be updated
74  * @features: Set of features enabled.
75  * @cfa: CFA coefficients.
76  * @csup: Chroma suppression coefficients.
77  * @luma: Luma enhancement coefficients.
78  * @nf: Noise filter coefficients.
79  * @dcor: Noise filter coefficients.
80  * @gamma: Gamma coefficients.
81  * @wbal: White Balance parameters.
82  * @blkadj: Black adjustment parameters.
83  * @rgb2rgb: RGB blending parameters.
84  * @csc: Color space conversion (RGB to YCbCr) parameters.
85  * @hmed: Horizontal median filter.
86  * @yclimit: YC limits parameters.
87  * @contrast: Contrast.
88  * @brightness: Brightness.
89  */
90 struct prev_params {
108 };
109 
110 /* Sink and source previewer pads */
111 #define PREV_PAD_SINK 0
112 #define PREV_PAD_SOURCE 1
113 #define PREV_PADS_NUM 2
114 
115 /*
116  * struct isp_prev_device - Structure for storing ISP Preview module information
117  * @subdev: V4L2 subdevice
118  * @pads: Media entity pads
119  * @formats: Active formats at the subdev pad
120  * @crop: Active crop rectangle
121  * @input: Module currently connected to the input pad
122  * @output: Bitmask of the active output
123  * @video_in: Input video entity
124  * @video_out: Output video entity
125  * @params.params : Active and shadow parameters sets
126  * @params.active: Bitmask of parameters active in set 0
127  * @params.lock: Parameters lock, protects params.active and params.shadow
128  * @underrun: Whether the preview entity has queued buffers on the output
129  * @state: Current preview pipeline state
130  *
131  * This structure is used to store the OMAP ISP Preview module Information.
132  */
136  struct v4l2_mbus_framefmt formats[PREV_PADS_NUM];
137  struct v4l2_rect crop;
138 
140 
142  unsigned int output;
145 
146  struct {
147  unsigned int cfa_order;
148  struct prev_params params[2];
151  } params;
152 
156 };
157 
158 struct isp_device;
159 
160 int omap3isp_preview_init(struct isp_device *isp);
161 void omap3isp_preview_cleanup(struct isp_device *isp);
162 
164  struct v4l2_device *vdev);
166 
169 
171 
173 
174 #endif /* OMAP3_ISP_PREVIEW_H */