1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef OMAP3_ISP_PREVIEW_H
15 #define OMAP3_ISP_PREVIEW_H
16
17 #include <linux/omap3isp.h>
18 #include <linux/types.h>
19 #include <media/v4l2-ctrls.h>
20
21 #include "ispvideo.h"
22
23 #define ISPPRV_BRIGHT_STEP 0x1
24 #define ISPPRV_BRIGHT_DEF 0x0
25 #define ISPPRV_BRIGHT_LOW 0x0
26 #define ISPPRV_BRIGHT_HIGH 0xFF
27 #define ISPPRV_BRIGHT_UNITS 0x1
28
29 #define ISPPRV_CONTRAST_STEP 0x1
30 #define ISPPRV_CONTRAST_DEF 0x10
31 #define ISPPRV_CONTRAST_LOW 0x0
32 #define ISPPRV_CONTRAST_HIGH 0xFF
33 #define ISPPRV_CONTRAST_UNITS 0x1
34
35
36 #define OMAP3ISP_PREV_CONTRAST (1 << 17)
37 #define OMAP3ISP_PREV_BRIGHTNESS (1 << 18)
38 #define OMAP3ISP_PREV_FEATURES_END (1 << 19)
39
40 enum preview_input_entity {
41 PREVIEW_INPUT_NONE,
42 PREVIEW_INPUT_CCDC,
43 PREVIEW_INPUT_MEMORY,
44 };
45
46 #define PREVIEW_OUTPUT_RESIZER (1 << 1)
47 #define PREVIEW_OUTPUT_MEMORY (1 << 2)
48
49
50 enum preview_ycpos_mode {
51 YCPOS_YCrYCb = 0,
52 YCPOS_YCbYCr = 1,
53 YCPOS_CbYCrY = 2,
54 YCPOS_CrYCbY = 3
55 };
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 struct prev_params {
78 u32 busy;
79 u32 update;
80 u32 features;
81 struct omap3isp_prev_cfa cfa;
82 struct omap3isp_prev_csup csup;
83 struct omap3isp_prev_luma luma;
84 struct omap3isp_prev_nf nf;
85 struct omap3isp_prev_dcor dcor;
86 struct omap3isp_prev_gtables gamma;
87 struct omap3isp_prev_wbal wbal;
88 struct omap3isp_prev_blkadj blkadj;
89 struct omap3isp_prev_rgbtorgb rgb2rgb;
90 struct omap3isp_prev_csc csc;
91 struct omap3isp_prev_hmed hmed;
92 struct omap3isp_prev_yclimit yclimit;
93 u8 contrast;
94 u8 brightness;
95 };
96
97
98 #define PREV_PAD_SINK 0
99 #define PREV_PAD_SOURCE 1
100 #define PREV_PADS_NUM 2
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120 struct isp_prev_device {
121 struct v4l2_subdev subdev;
122 struct media_pad pads[PREV_PADS_NUM];
123 struct v4l2_mbus_framefmt formats[PREV_PADS_NUM];
124 struct v4l2_rect crop;
125
126 struct v4l2_ctrl_handler ctrls;
127
128 enum preview_input_entity input;
129 unsigned int output;
130 struct isp_video video_in;
131 struct isp_video video_out;
132
133 struct {
134 unsigned int cfa_order;
135 struct prev_params params[2];
136 u32 active;
137 spinlock_t lock;
138 } params;
139
140 enum isp_pipeline_stream_state state;
141 wait_queue_head_t wait;
142 atomic_t stopping;
143 };
144
145 struct isp_device;
146
147 int omap3isp_preview_init(struct isp_device *isp);
148 void omap3isp_preview_cleanup(struct isp_device *isp);
149
150 int omap3isp_preview_register_entities(struct isp_prev_device *prv,
151 struct v4l2_device *vdev);
152 void omap3isp_preview_unregister_entities(struct isp_prev_device *prv);
153
154 void omap3isp_preview_isr_frame_sync(struct isp_prev_device *prev);
155 void omap3isp_preview_isr(struct isp_prev_device *prev);
156
157 int omap3isp_preview_busy(struct isp_prev_device *isp_prev);
158
159 void omap3isp_preview_restore_context(struct isp_device *isp);
160
161 #endif