blob: ab310800075647fade5c6095ee2ad28d43abdcfa [file] [log] [blame]
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001/*
2 * Z-star vc0321 library
3 * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
4 * Copyright (C) 2006 Michel Xhaard
5 *
6 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define MODULE_NAME "vc032x"
24
25#include "gspca.h"
26
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030027MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
28MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
29MODULE_LICENSE("GPL");
30
31/* specific webcam descriptor */
32struct sd {
33 struct gspca_dev gspca_dev; /* !! must be the first item */
34
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030035 __u8 hflip;
36 __u8 vflip;
37 __u8 lightfreq;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -030038 __u8 sharpness;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030039
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030040 char bridge;
41#define BRIDGE_VC0321 0
42#define BRIDGE_VC0323 1
43 char sensor;
44#define SENSOR_HV7131R 0
Jean-Francois Moinecbb05542008-11-26 16:17:13 -030045#define SENSOR_MI0360 1
46#define SENSOR_MI1320 2
47#define SENSOR_MI1310_SOC 3
48#define SENSOR_OV7660 4
49#define SENSOR_OV7670 5
Jean-Francois Moine88521532008-12-10 05:06:13 -030050#define SENSOR_PO1200 6
51#define SENSOR_PO3130NC 7
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030052};
53
54/* V4L2 controls supported by the driver */
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030055static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val);
56static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val);
57static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val);
58static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030059static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
60static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine47a42b02008-12-13 07:45:34 -030061static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
62static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030063
64static struct ctrl sd_ctrls[] = {
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030065/* next 2 controls work with ov7660 and ov7670 only */
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030066#define HFLIP_IDX 0
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030067 {
68 {
69 .id = V4L2_CID_HFLIP,
70 .type = V4L2_CTRL_TYPE_BOOLEAN,
71 .name = "Mirror",
72 .minimum = 0,
73 .maximum = 1,
74 .step = 1,
75#define HFLIP_DEF 0
76 .default_value = HFLIP_DEF,
77 },
78 .set = sd_sethflip,
79 .get = sd_gethflip,
80 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030081#define VFLIP_IDX 1
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030082 {
83 {
84 .id = V4L2_CID_VFLIP,
85 .type = V4L2_CTRL_TYPE_BOOLEAN,
86 .name = "Vflip",
87 .minimum = 0,
88 .maximum = 1,
89 .step = 1,
90#define VFLIP_DEF 0
91 .default_value = VFLIP_DEF,
92 },
93 .set = sd_setvflip,
94 .get = sd_getvflip,
95 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030096#define LIGHTFREQ_IDX 2
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030097 {
98 {
99 .id = V4L2_CID_POWER_LINE_FREQUENCY,
100 .type = V4L2_CTRL_TYPE_MENU,
101 .name = "Light frequency filter",
102 .minimum = 0,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300103 .maximum = 2, /* 0: No, 1: 50Hz, 2:60Hz */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300104 .step = 1,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300105#define FREQ_DEF 1
106 .default_value = FREQ_DEF,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300107 },
108 .set = sd_setfreq,
109 .get = sd_getfreq,
110 },
Jean-Francois Moine47a42b02008-12-13 07:45:34 -0300111/* po1200 only */
112#define SHARPNESS_IDX 3
113 {
114 {
115 .id = V4L2_CID_SHARPNESS,
116 .type = V4L2_CTRL_TYPE_INTEGER,
117 .name = "Sharpness",
118 .minimum = 0,
119 .maximum = 2,
120 .step = 1,
121#define SHARPNESS_DEF 1
122 .default_value = SHARPNESS_DEF,
123 },
124 .set = sd_setsharpness,
125 .get = sd_getsharpness,
126 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300127};
128
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300129static const struct v4l2_pix_format vc0321_mode[] = {
Jean-Francois Moine20122542008-09-03 17:12:20 -0300130 {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300131 .bytesperline = 320,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300132 .sizeimage = 320 * 240 * 2,
133 .colorspace = V4L2_COLORSPACE_SRGB,
134 .priv = 1},
Jean-Francois Moine20122542008-09-03 17:12:20 -0300135 {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300136 .bytesperline = 640,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300137 .sizeimage = 640 * 480 * 2,
138 .colorspace = V4L2_COLORSPACE_SRGB,
139 .priv = 0},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300140};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300141static const struct v4l2_pix_format vc0323_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300142 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
143 .bytesperline = 320,
144 .sizeimage = 320 * 240 * 3 / 8 + 590,
145 .colorspace = V4L2_COLORSPACE_JPEG,
146 .priv = 1},
147 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
148 .bytesperline = 640,
149 .sizeimage = 640 * 480 * 3 / 8 + 590,
150 .colorspace = V4L2_COLORSPACE_JPEG,
151 .priv = 0},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300152};
153
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300154static const struct v4l2_pix_format svga_mode[] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -0300155 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
156 .bytesperline = 800,
157 .sizeimage = 800 * 600 * 1 / 4 + 590,
158 .colorspace = V4L2_COLORSPACE_JPEG,
159 .priv = 0},
160};
161
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -0300162/* OV7660/7670 registers */
163#define OV7660_REG_MVFP 0x1e
164#define OV7660_MVFP_MIRROR 0x20
165#define OV7660_MVFP_VFLIP 0x10
166
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300167static const __u8 mi0360_matrix[9] = {
168 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
169};
170
171static const __u8 mi0360_initVGA_JPG[][4] = {
172 {0xb0, 0x03, 0x19, 0xcc},
173 {0xb0, 0x04, 0x02, 0xcc},
174 {0xb3, 0x00, 0x24, 0xcc},
175 {0xb3, 0x00, 0x25, 0xcc},
176 {0xb3, 0x08, 0x01, 0xcc},
177 {0xb3, 0x09, 0x0c, 0xcc},
178 {0xb3, 0x05, 0x01, 0xcc},
179 {0xb3, 0x06, 0x03, 0xcc},
180 {0xb3, 0x03, 0x0a, 0xcc},
181 {0xb3, 0x20, 0x00, 0xcc},
182 {0xb3, 0x21, 0x00, 0xcc},
183 {0xb3, 0x22, 0x01, 0xcc},
184 {0xb3, 0x23, 0xe0, 0xcc},
185 {0xb3, 0x04, 0x05, 0xcc},
186 {0xb3, 0x14, 0x00, 0xcc},
187 {0xb3, 0x15, 0x00, 0xcc},
188 {0xb3, 0x16, 0x02, 0xcc},
189 {0xb3, 0x17, 0x7f, 0xcc},
190 {0xb3, 0x35, 0xdd, 0xcc},
191 {0xb3, 0x34, 0x02, 0xcc},
192 {0xb3, 0x00, 0x25, 0xcc},
193 {0xbc, 0x00, 0x71, 0xcc},
194 {0xb8, 0x00, 0x13, 0xcc},
195 {0xb8, 0x27, 0x20, 0xcc},
196 {0xb8, 0x2c, 0x50, 0xcc},
197 {0xb8, 0x2d, 0xf8, 0xcc},
198 {0xb8, 0x2e, 0xf8, 0xcc},
199 {0xb8, 0x2f, 0xf8, 0xcc},
200 {0xb8, 0x30, 0x50, 0xcc},
201 {0xb8, 0x31, 0xf8, 0xcc},
202 {0xb8, 0x32, 0xf8, 0xcc},
203 {0xb8, 0x33, 0xf8, 0xcc},
204 {0xb8, 0x34, 0x50, 0xcc},
205 {0xb8, 0x35, 0x00, 0xcc},
206 {0xb8, 0x36, 0x00, 0xcc},
207 {0xb8, 0x37, 0x00, 0xcc},
208 {0xb8, 0x01, 0x79, 0xcc},
209 {0xb8, 0x08, 0xe0, 0xcc},
210 {0xb3, 0x01, 0x41, 0xcc},
211 {0xb8, 0x01, 0x79, 0xcc},
212 {0xb8, 0x14, 0x18, 0xcc},
213 {0xb8, 0xb2, 0x0a, 0xcc},
214 {0xb8, 0xb4, 0x0a, 0xcc},
215 {0xb8, 0xb5, 0x0a, 0xcc},
216 {0xb8, 0xfe, 0x00, 0xcc},
217 {0xb8, 0xff, 0x28, 0xcc},
218 {0xb9, 0x00, 0x28, 0xcc},
219 {0xb9, 0x01, 0x28, 0xcc},
220 {0xb9, 0x02, 0x28, 0xcc},
221 {0xb9, 0x03, 0x00, 0xcc},
222 {0xb9, 0x04, 0x00, 0xcc},
223 {0xb9, 0x05, 0x3c, 0xcc},
224 {0xb9, 0x06, 0x3c, 0xcc},
225 {0xb9, 0x07, 0x3c, 0xcc},
226 {0xb9, 0x08, 0x3c, 0xcc},
227 {0xb8, 0x8e, 0x00, 0xcc},
228 {0xb8, 0x8f, 0xff, 0xcc},
229 {0xb8, 0x81, 0x09, 0xcc},
230 {0x31, 0x00, 0x00, 0xbb},
231 {0x09, 0x01, 0xc7, 0xbb},
232 {0x34, 0x01, 0x00, 0xbb},
233 {0x2b, 0x00, 0x28, 0xbb},
234 {0x2c, 0x00, 0x30, 0xbb},
235 {0x2d, 0x00, 0x30, 0xbb},
236 {0x2e, 0x00, 0x28, 0xbb},
237 {0x62, 0x04, 0x11, 0xbb},
238 {0x03, 0x01, 0xe0, 0xbb},
239 {0x2c, 0x00, 0x2c, 0xbb},
240 {0x20, 0xd0, 0x00, 0xbb},
241 {0x01, 0x00, 0x08, 0xbb},
242 {0x06, 0x00, 0x10, 0xbb},
243 {0x05, 0x00, 0x20, 0xbb},
244 {0x20, 0x00, 0x00, 0xbb},
245 {0xb6, 0x00, 0x00, 0xcc},
246 {0xb6, 0x03, 0x02, 0xcc},
247 {0xb6, 0x02, 0x80, 0xcc},
248 {0xb6, 0x05, 0x01, 0xcc},
249 {0xb6, 0x04, 0xe0, 0xcc},
250 {0xb6, 0x12, 0x78, 0xcc},
251 {0xb6, 0x18, 0x02, 0xcc},
252 {0xb6, 0x17, 0x58, 0xcc},
253 {0xb6, 0x16, 0x00, 0xcc},
254 {0xb6, 0x22, 0x12, 0xcc},
255 {0xb6, 0x23, 0x0b, 0xcc},
256 {0xb3, 0x02, 0x02, 0xcc},
257 {0xbf, 0xc0, 0x39, 0xcc},
258 {0xbf, 0xc1, 0x04, 0xcc},
259 {0xbf, 0xcc, 0x10, 0xcc},
260 {0xb9, 0x12, 0x00, 0xcc},
261 {0xb9, 0x13, 0x0a, 0xcc},
262 {0xb9, 0x14, 0x0a, 0xcc},
263 {0xb9, 0x15, 0x0a, 0xcc},
264 {0xb9, 0x16, 0x0a, 0xcc},
265 {0xb9, 0x18, 0x00, 0xcc},
266 {0xb9, 0x19, 0x0f, 0xcc},
267 {0xb9, 0x1a, 0x0f, 0xcc},
268 {0xb9, 0x1b, 0x0f, 0xcc},
269 {0xb9, 0x1c, 0x0f, 0xcc},
270 {0xb8, 0x8e, 0x00, 0xcc},
271 {0xb8, 0x8f, 0xff, 0xcc},
272 {0xb6, 0x12, 0xf8, 0xcc},
273 {0xb8, 0x0c, 0x20, 0xcc},
274 {0xb8, 0x0d, 0x70, 0xcc},
275 {0xb6, 0x13, 0x13, 0xcc},
276 {0x35, 0x00, 0x60, 0xbb},
277 {0xb3, 0x5c, 0x01, 0xcc},
278 {}
279};
280static const __u8 mi0360_initQVGA_JPG[][4] = {
281 {0xb0, 0x03, 0x19, 0xcc},
282 {0xb0, 0x04, 0x02, 0xcc},
283 {0xb3, 0x00, 0x24, 0xcc},
284 {0xb3, 0x00, 0x25, 0xcc},
285 {0xb3, 0x08, 0x01, 0xcc},
286 {0xb3, 0x09, 0x0c, 0xcc},
287 {0xb3, 0x05, 0x01, 0xcc},
288 {0xb3, 0x06, 0x03, 0xcc},
289 {0xb3, 0x03, 0x0a, 0xcc},
290 {0xb3, 0x20, 0x00, 0xcc},
291 {0xb3, 0x21, 0x00, 0xcc},
292 {0xb3, 0x22, 0x01, 0xcc},
293 {0xb3, 0x23, 0xe0, 0xcc},
294 {0xb3, 0x04, 0x05, 0xcc},
295 {0xb3, 0x14, 0x00, 0xcc},
296 {0xb3, 0x15, 0x00, 0xcc},
297 {0xb3, 0x16, 0x02, 0xcc},
298 {0xb3, 0x17, 0x7f, 0xcc},
299 {0xb3, 0x35, 0xdd, 0xcc},
300 {0xb3, 0x34, 0x02, 0xcc},
301 {0xb3, 0x00, 0x25, 0xcc},
302 {0xbc, 0x00, 0xd1, 0xcc},
303 {0xb8, 0x00, 0x13, 0xcc},
304 {0xb8, 0x27, 0x20, 0xcc},
305 {0xb8, 0x2c, 0x50, 0xcc},
306 {0xb8, 0x2d, 0xf8, 0xcc},
307 {0xb8, 0x2e, 0xf8, 0xcc},
308 {0xb8, 0x2f, 0xf8, 0xcc},
309 {0xb8, 0x30, 0x50, 0xcc},
310 {0xb8, 0x31, 0xf8, 0xcc},
311 {0xb8, 0x32, 0xf8, 0xcc},
312 {0xb8, 0x33, 0xf8, 0xcc},
313 {0xb8, 0x34, 0x50, 0xcc},
314 {0xb8, 0x35, 0x00, 0xcc},
315 {0xb8, 0x36, 0x00, 0xcc},
316 {0xb8, 0x37, 0x00, 0xcc},
317 {0xb8, 0x01, 0x79, 0xcc},
318 {0xb8, 0x08, 0xe0, 0xcc},
319 {0xb3, 0x01, 0x41, 0xcc},
320 {0xb8, 0x01, 0x79, 0xcc},
321 {0xb8, 0x14, 0x18, 0xcc},
322 {0xb8, 0xb2, 0x0a, 0xcc},
323 {0xb8, 0xb4, 0x0a, 0xcc},
324 {0xb8, 0xb5, 0x0a, 0xcc},
325 {0xb8, 0xfe, 0x00, 0xcc},
326 {0xb8, 0xff, 0x28, 0xcc},
327 {0xb9, 0x00, 0x28, 0xcc},
328 {0xb9, 0x01, 0x28, 0xcc},
329 {0xb9, 0x02, 0x28, 0xcc},
330 {0xb9, 0x03, 0x00, 0xcc},
331 {0xb9, 0x04, 0x00, 0xcc},
332 {0xb9, 0x05, 0x3c, 0xcc},
333 {0xb9, 0x06, 0x3c, 0xcc},
334 {0xb9, 0x07, 0x3c, 0xcc},
335 {0xb9, 0x08, 0x3c, 0xcc},
336 {0xb8, 0x8e, 0x00, 0xcc},
337 {0xb8, 0x8f, 0xff, 0xcc},
338 {0xb8, 0x81, 0x09, 0xcc},
339 {0x31, 0x00, 0x00, 0xbb},
340 {0x09, 0x01, 0xc7, 0xbb},
341 {0x34, 0x01, 0x00, 0xbb},
342 {0x2b, 0x00, 0x28, 0xbb},
343 {0x2c, 0x00, 0x30, 0xbb},
344 {0x2d, 0x00, 0x30, 0xbb},
345 {0x2e, 0x00, 0x28, 0xbb},
346 {0x62, 0x04, 0x11, 0xbb},
347 {0x03, 0x01, 0xe0, 0xbb},
348 {0x2c, 0x00, 0x2c, 0xbb},
349 {0x20, 0xd0, 0x00, 0xbb},
350 {0x01, 0x00, 0x08, 0xbb},
351 {0x06, 0x00, 0x10, 0xbb},
352 {0x05, 0x00, 0x20, 0xbb},
353 {0x20, 0x00, 0x00, 0xbb},
354 {0xb6, 0x00, 0x00, 0xcc},
355 {0xb6, 0x03, 0x01, 0xcc},
356 {0xb6, 0x02, 0x40, 0xcc},
357 {0xb6, 0x05, 0x00, 0xcc},
358 {0xb6, 0x04, 0xf0, 0xcc},
359 {0xb6, 0x12, 0x78, 0xcc},
360 {0xb6, 0x18, 0x00, 0xcc},
361 {0xb6, 0x17, 0x96, 0xcc},
362 {0xb6, 0x16, 0x00, 0xcc},
363 {0xb6, 0x22, 0x12, 0xcc},
364 {0xb6, 0x23, 0x0b, 0xcc},
365 {0xb3, 0x02, 0x02, 0xcc},
366 {0xbf, 0xc0, 0x39, 0xcc},
367 {0xbf, 0xc1, 0x04, 0xcc},
368 {0xbf, 0xcc, 0x10, 0xcc},
369 {0xb9, 0x12, 0x00, 0xcc},
370 {0xb9, 0x13, 0x0a, 0xcc},
371 {0xb9, 0x14, 0x0a, 0xcc},
372 {0xb9, 0x15, 0x0a, 0xcc},
373 {0xb9, 0x16, 0x0a, 0xcc},
374 {0xb9, 0x18, 0x00, 0xcc},
375 {0xb9, 0x19, 0x0f, 0xcc},
376 {0xb9, 0x1a, 0x0f, 0xcc},
377 {0xb9, 0x1b, 0x0f, 0xcc},
378 {0xb9, 0x1c, 0x0f, 0xcc},
379 {0xb8, 0x8e, 0x00, 0xcc},
380 {0xb8, 0x8f, 0xff, 0xcc},
381 {0xb6, 0x12, 0xf8, 0xcc},
382 {0xb6, 0x13, 0x13, 0xcc},
383 {0xbc, 0x02, 0x18, 0xcc},
384 {0xbc, 0x03, 0x50, 0xcc},
385 {0xbc, 0x04, 0x18, 0xcc},
386 {0xbc, 0x05, 0x00, 0xcc},
387 {0xbc, 0x06, 0x00, 0xcc},
388 {0xbc, 0x08, 0x30, 0xcc},
389 {0xbc, 0x09, 0x40, 0xcc},
390 {0xbc, 0x0a, 0x10, 0xcc},
391 {0xb8, 0x0c, 0x20, 0xcc},
392 {0xb8, 0x0d, 0x70, 0xcc},
393 {0xbc, 0x0b, 0x00, 0xcc},
394 {0xbc, 0x0c, 0x00, 0xcc},
395 {0x35, 0x00, 0xef, 0xbb},
396 {0xb3, 0x5c, 0x01, 0xcc},
397 {}
398};
399
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300400static const __u8 mi1310_socinitVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300401 {0xb0, 0x03, 0x19, 0xcc},
402 {0xb0, 0x04, 0x02, 0xcc},
403 {0xb3, 0x00, 0x64, 0xcc},
404 {0xb3, 0x00, 0x65, 0xcc},
405 {0xb3, 0x05, 0x00, 0xcc},
406 {0xb3, 0x06, 0x00, 0xcc},
407 {0xb3, 0x08, 0x01, 0xcc},
408 {0xb3, 0x09, 0x0c, 0xcc},
409 {0xb3, 0x34, 0x02, 0xcc},
410 {0xb3, 0x35, 0xdd, 0xcc},
411 {0xb3, 0x02, 0x00, 0xcc},
412 {0xb3, 0x03, 0x0a, 0xcc},
413 {0xb3, 0x04, 0x05, 0xcc},
414 {0xb3, 0x20, 0x00, 0xcc},
415 {0xb3, 0x21, 0x00, 0xcc},
416 {0xb3, 0x22, 0x03, 0xcc},
417 {0xb3, 0x23, 0xc0, 0xcc},
418 {0xb3, 0x14, 0x00, 0xcc},
419 {0xb3, 0x15, 0x00, 0xcc},
420 {0xb3, 0x16, 0x04, 0xcc},
421 {0xb3, 0x17, 0xff, 0xcc},
422 {0xb3, 0x00, 0x65, 0xcc},
423 {0xb8, 0x00, 0x00, 0xcc},
424 {0xbc, 0x00, 0xd0, 0xcc},
425 {0xbc, 0x01, 0x01, 0xcc},
426 {0xf0, 0x00, 0x02, 0xbb},
427 {0xc8, 0x9f, 0x0b, 0xbb},
428 {0x5b, 0x00, 0x01, 0xbb},
429 {0x2f, 0xde, 0x20, 0xbb},
430 {0xf0, 0x00, 0x00, 0xbb},
431 {0x20, 0x03, 0x02, 0xbb},
432 {0xf0, 0x00, 0x01, 0xbb},
433 {0x05, 0x00, 0x07, 0xbb},
434 {0x34, 0x00, 0x00, 0xbb},
435 {0x35, 0xff, 0x00, 0xbb},
436 {0xdc, 0x07, 0x02, 0xbb},
437 {0xdd, 0x3c, 0x18, 0xbb},
438 {0xde, 0x92, 0x6d, 0xbb},
439 {0xdf, 0xcd, 0xb1, 0xbb},
440 {0xe0, 0xff, 0xe7, 0xbb},
441 {0x06, 0xf0, 0x0d, 0xbb},
442 {0x06, 0x70, 0x0e, 0xbb},
443 {0x4c, 0x00, 0x01, 0xbb},
444 {0x4d, 0x00, 0x01, 0xbb},
445 {0xf0, 0x00, 0x02, 0xbb},
446 {0x2e, 0x0c, 0x55, 0xbb},
447 {0x21, 0xb6, 0x6e, 0xbb},
448 {0x36, 0x30, 0x10, 0xbb},
449 {0x37, 0x00, 0xc1, 0xbb},
450 {0xf0, 0x00, 0x00, 0xbb},
451 {0x07, 0x00, 0x84, 0xbb},
452 {0x08, 0x02, 0x4a, 0xbb},
453 {0x05, 0x01, 0x10, 0xbb},
454 {0x06, 0x00, 0x39, 0xbb},
455 {0xf0, 0x00, 0x02, 0xbb},
456 {0x58, 0x02, 0x67, 0xbb},
457 {0x57, 0x02, 0x00, 0xbb},
458 {0x5a, 0x02, 0x67, 0xbb},
459 {0x59, 0x02, 0x00, 0xbb},
460 {0x5c, 0x12, 0x0d, 0xbb},
461 {0x5d, 0x16, 0x11, 0xbb},
462 {0x39, 0x06, 0x18, 0xbb},
463 {0x3a, 0x06, 0x18, 0xbb},
464 {0x3b, 0x06, 0x18, 0xbb},
465 {0x3c, 0x06, 0x18, 0xbb},
466 {0x64, 0x7b, 0x5b, 0xbb},
467 {0xf0, 0x00, 0x02, 0xbb},
468 {0x36, 0x30, 0x10, 0xbb},
469 {0x37, 0x00, 0xc0, 0xbb},
470 {0xbc, 0x0e, 0x00, 0xcc},
471 {0xbc, 0x0f, 0x05, 0xcc},
472 {0xbc, 0x10, 0xc0, 0xcc},
473 {0xbc, 0x11, 0x03, 0xcc},
474 {0xb6, 0x00, 0x00, 0xcc},
475 {0xb6, 0x03, 0x02, 0xcc},
476 {0xb6, 0x02, 0x80, 0xcc},
477 {0xb6, 0x05, 0x01, 0xcc},
478 {0xb6, 0x04, 0xe0, 0xcc},
479 {0xb6, 0x12, 0xf8, 0xcc},
480 {0xb6, 0x13, 0x25, 0xcc},
481 {0xb6, 0x18, 0x02, 0xcc},
482 {0xb6, 0x17, 0x58, 0xcc},
483 {0xb6, 0x16, 0x00, 0xcc},
484 {0xb6, 0x22, 0x12, 0xcc},
485 {0xb6, 0x23, 0x0b, 0xcc},
486 {0xbf, 0xc0, 0x39, 0xcc},
487 {0xbf, 0xc1, 0x04, 0xcc},
488 {0xbf, 0xcc, 0x00, 0xcc},
489 {0xbc, 0x02, 0x18, 0xcc},
490 {0xbc, 0x03, 0x50, 0xcc},
491 {0xbc, 0x04, 0x18, 0xcc},
492 {0xbc, 0x05, 0x00, 0xcc},
493 {0xbc, 0x06, 0x00, 0xcc},
494 {0xbc, 0x08, 0x30, 0xcc},
495 {0xbc, 0x09, 0x40, 0xcc},
496 {0xbc, 0x0a, 0x10, 0xcc},
497 {0xbc, 0x0b, 0x00, 0xcc},
498 {0xbc, 0x0c, 0x00, 0xcc},
499 {0xb3, 0x5c, 0x01, 0xcc},
500 {0xf0, 0x00, 0x01, 0xbb},
501 {0x80, 0x00, 0x03, 0xbb},
502 {0x81, 0xc7, 0x14, 0xbb},
503 {0x82, 0xeb, 0xe8, 0xbb},
504 {0x83, 0xfe, 0xf4, 0xbb},
505 {0x84, 0xcd, 0x10, 0xbb},
506 {0x85, 0xf3, 0xee, 0xbb},
507 {0x86, 0xff, 0xf1, 0xbb},
508 {0x87, 0xcd, 0x10, 0xbb},
509 {0x88, 0xf3, 0xee, 0xbb},
510 {0x89, 0x01, 0xf1, 0xbb},
511 {0x8a, 0xe5, 0x17, 0xbb},
512 {0x8b, 0xe8, 0xe2, 0xbb},
513 {0x8c, 0xf7, 0xed, 0xbb},
514 {0x8d, 0x00, 0xff, 0xbb},
515 {0x8e, 0xec, 0x10, 0xbb},
516 {0x8f, 0xf0, 0xed, 0xbb},
517 {0x90, 0xf9, 0xf2, 0xbb},
518 {0x91, 0x00, 0x00, 0xbb},
519 {0x92, 0xe9, 0x0d, 0xbb},
520 {0x93, 0xf4, 0xf2, 0xbb},
521 {0x94, 0xfb, 0xf5, 0xbb},
522 {0x95, 0x00, 0xff, 0xbb},
523 {0xb6, 0x0f, 0x08, 0xbb},
524 {0xb7, 0x3d, 0x16, 0xbb},
525 {0xb8, 0x0c, 0x04, 0xbb},
526 {0xb9, 0x1c, 0x07, 0xbb},
527 {0xba, 0x0a, 0x03, 0xbb},
528 {0xbb, 0x1b, 0x09, 0xbb},
529 {0xbc, 0x17, 0x0d, 0xbb},
530 {0xbd, 0x23, 0x1d, 0xbb},
531 {0xbe, 0x00, 0x28, 0xbb},
532 {0xbf, 0x11, 0x09, 0xbb},
533 {0xc0, 0x16, 0x15, 0xbb},
534 {0xc1, 0x00, 0x1b, 0xbb},
535 {0xc2, 0x0e, 0x07, 0xbb},
536 {0xc3, 0x14, 0x10, 0xbb},
537 {0xc4, 0x00, 0x17, 0xbb},
538 {0x06, 0x74, 0x8e, 0xbb},
539 {0xf0, 0x00, 0x01, 0xbb},
540 {0x06, 0xf4, 0x8e, 0xbb},
541 {0x00, 0x00, 0x50, 0xdd},
542 {0x06, 0x74, 0x8e, 0xbb},
543 {0xf0, 0x00, 0x02, 0xbb},
544 {0x24, 0x50, 0x20, 0xbb},
545 {0xf0, 0x00, 0x02, 0xbb},
546 {0x34, 0x0c, 0x50, 0xbb},
547 {0xb3, 0x01, 0x41, 0xcc},
548 {0xf0, 0x00, 0x00, 0xbb},
549 {0x03, 0x03, 0xc0, 0xbb},
550 {},
551};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300552static const __u8 mi1310_socinitQVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300553 {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc},
554 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
555 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc},
556 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
557 {0xb3, 0x34, 0x02, 0xcc}, {0xb3, 0x35, 0xdd, 0xcc},
558 {0xb3, 0x02, 0x00, 0xcc}, {0xb3, 0x03, 0x0a, 0xcc},
559 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
560 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x03, 0xcc},
561 {0xb3, 0x23, 0xc0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
562 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x04, 0xcc},
563 {0xb3, 0x17, 0xff, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
564 {0xb8, 0x00, 0x00, 0xcc}, {0xbc, 0x00, 0xf0, 0xcc},
565 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x02, 0xbb},
566 {0xc8, 0x9f, 0x0b, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
567 {0x2f, 0xde, 0x20, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
568 {0x20, 0x03, 0x02, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
569 {0x05, 0x00, 0x07, 0xbb}, {0x34, 0x00, 0x00, 0xbb},
570 {0x35, 0xff, 0x00, 0xbb}, {0xdc, 0x07, 0x02, 0xbb},
571 {0xdd, 0x3c, 0x18, 0xbb}, {0xde, 0x92, 0x6d, 0xbb},
572 {0xdf, 0xcd, 0xb1, 0xbb}, {0xe0, 0xff, 0xe7, 0xbb},
573 {0x06, 0xf0, 0x0d, 0xbb}, {0x06, 0x70, 0x0e, 0xbb},
574 {0x4c, 0x00, 0x01, 0xbb}, {0x4d, 0x00, 0x01, 0xbb},
575 {0xf0, 0x00, 0x02, 0xbb}, {0x2e, 0x0c, 0x55, 0xbb},
576 {0x21, 0xb6, 0x6e, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
577 {0x37, 0x00, 0xc1, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
578 {0x07, 0x00, 0x84, 0xbb}, {0x08, 0x02, 0x4a, 0xbb},
579 {0x05, 0x01, 0x10, 0xbb}, {0x06, 0x00, 0x39, 0xbb},
580 {0xf0, 0x00, 0x02, 0xbb}, {0x58, 0x02, 0x67, 0xbb},
581 {0x57, 0x02, 0x00, 0xbb}, {0x5a, 0x02, 0x67, 0xbb},
582 {0x59, 0x02, 0x00, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
583 {0x5d, 0x16, 0x11, 0xbb}, {0x39, 0x06, 0x18, 0xbb},
584 {0x3a, 0x06, 0x18, 0xbb}, {0x3b, 0x06, 0x18, 0xbb},
585 {0x3c, 0x06, 0x18, 0xbb}, {0x64, 0x7b, 0x5b, 0xbb},
586 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
587 {0x37, 0x00, 0xc0, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
588 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
589 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
590 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
591 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
592 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x25, 0xcc},
593 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
594 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
595 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
596 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
597 {0xb3, 0x5c, 0x01, 0xcc}, {0xf0, 0x00, 0x01, 0xbb},
598 {0x80, 0x00, 0x03, 0xbb}, {0x81, 0xc7, 0x14, 0xbb},
599 {0x82, 0xeb, 0xe8, 0xbb}, {0x83, 0xfe, 0xf4, 0xbb},
600 {0x84, 0xcd, 0x10, 0xbb}, {0x85, 0xf3, 0xee, 0xbb},
601 {0x86, 0xff, 0xf1, 0xbb}, {0x87, 0xcd, 0x10, 0xbb},
602 {0x88, 0xf3, 0xee, 0xbb}, {0x89, 0x01, 0xf1, 0xbb},
603 {0x8a, 0xe5, 0x17, 0xbb}, {0x8b, 0xe8, 0xe2, 0xbb},
604 {0x8c, 0xf7, 0xed, 0xbb}, {0x8d, 0x00, 0xff, 0xbb},
605 {0x8e, 0xec, 0x10, 0xbb}, {0x8f, 0xf0, 0xed, 0xbb},
606 {0x90, 0xf9, 0xf2, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
607 {0x92, 0xe9, 0x0d, 0xbb}, {0x93, 0xf4, 0xf2, 0xbb},
608 {0x94, 0xfb, 0xf5, 0xbb}, {0x95, 0x00, 0xff, 0xbb},
609 {0xb6, 0x0f, 0x08, 0xbb}, {0xb7, 0x3d, 0x16, 0xbb},
610 {0xb8, 0x0c, 0x04, 0xbb}, {0xb9, 0x1c, 0x07, 0xbb},
611 {0xba, 0x0a, 0x03, 0xbb}, {0xbb, 0x1b, 0x09, 0xbb},
612 {0xbc, 0x17, 0x0d, 0xbb}, {0xbd, 0x23, 0x1d, 0xbb},
613 {0xbe, 0x00, 0x28, 0xbb}, {0xbf, 0x11, 0x09, 0xbb},
614 {0xc0, 0x16, 0x15, 0xbb}, {0xc1, 0x00, 0x1b, 0xbb},
615 {0xc2, 0x0e, 0x07, 0xbb}, {0xc3, 0x14, 0x10, 0xbb},
616 {0xc4, 0x00, 0x17, 0xbb}, {0x06, 0x74, 0x8e, 0xbb},
617 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0xf4, 0x8e, 0xbb},
618 {0x00, 0x00, 0x50, 0xdd}, {0x06, 0x74, 0x8e, 0xbb},
619 {0xf0, 0x00, 0x02, 0xbb}, {0x24, 0x50, 0x20, 0xbb},
620 {0xf0, 0x00, 0x02, 0xbb}, {0x34, 0x0c, 0x50, 0xbb},
621 {0xb3, 0x01, 0x41, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
622 {0x03, 0x03, 0xc0, 0xbb},
623 {},
624};
625
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300626static const __u8 mi1320_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300627 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
628 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
629};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300630static const __u8 mi1320_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300631 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
632};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300633static const __u8 mi1320_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300634 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
635 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
636 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
637 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
638 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
639 {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
640 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
641 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
642 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
643 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
644 {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
645 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
646 {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
647 {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
648 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
649 {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
650 {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
651 {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
652 {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
653 {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
654 {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
655 {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
656 {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
657 {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
658 {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
659 {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
660 {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
661 {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
662 {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
663 {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
664 {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
665 {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
666 {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
667 {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
668 {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
669 {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
670 {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
671 {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
672 {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
673 {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
674 {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
675 {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
676 {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
677 {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
678 {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
679 {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
680 {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
681 {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
682 {0x08, 0x00, 0x27, 0xbb}, {0x20, 0x01, 0x03, 0xbb},
683 {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
684 {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
685 {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
686 {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
687 {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
688 {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
689 {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
690 {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
691 {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
692 {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
693 {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
694 {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
695 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
696 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
697 {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
698 {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
699 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
700 {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
701 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
702 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
703 {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
704 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
705 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
706 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
707 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
708 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
709 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
710 {}
711};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300712static const __u8 mi1320_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300713 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
714 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
715 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
716 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
717 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
718 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
719 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
720 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
721 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
722 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
723 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
724 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
725 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
726 {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
727 {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
728 {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
729 {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
730 {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
731 {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
732 {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
733 {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
734 {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
735 {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
736 {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
737 {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
738 {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
739 {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
740 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
741 {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
742 {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
743 {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
744 {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
745 {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
746 {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
747 {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
748 {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
749 {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
750 {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
751 {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
752 {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
753 {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
754 {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
755 {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
756 {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
757 {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
758 {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
759 {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
760 {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
761 {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
762 {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
763 {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
764 {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
765 {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
766 {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
767 {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
768 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
769 {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
770 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
771 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
772 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
773 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
774 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
775 {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
776 {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
777 {0xb3, 0x01, 0x41, 0xcc},
778 {}
779};
780
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300781static const __u8 po3130_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300782 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
783 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
784};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300785static const __u8 po3130_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300786 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
787};
788
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300789static const __u8 po3130_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300790 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
791 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
792 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
793 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
794 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
795 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
796 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
797 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
798 {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
799 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
800 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
801 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
802 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
803 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
804 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
805 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
806 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
807 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
808 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
809 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
810 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
811 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
812 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
813 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
814 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
815 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
816 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
817 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
818 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
819 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
820 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
821 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
822 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
823 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
824 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
825 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
826 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
827 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
828 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
829 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
830 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
831 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
832 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
833 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
834 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
835 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
836 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
837 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
838 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
839 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
840 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
841 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
842 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
843 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
844 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
845 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
846 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
847 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
848 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
849 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
850 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
851 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
852 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
853 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
854 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
855 {0x00, 0x7e, 0xea, 0xaa},
856 {0x00, 0x4c, 0x07, 0xaa},
857 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
858 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
859/* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
860 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
861 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
862 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
863 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
864 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
865 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
866 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
867 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
868 {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
869 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
870 {}
871};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300872static const __u8 po3130_rundata[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300873 {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
874 {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
875 {0x00, 0x44, 0x40, 0xaa},
876/* {0x00, 0xd5, 0x7c, 0xaa}, */
877 {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
878 {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
879 {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
880 {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
881 {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
882 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
883 {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
884 {}
885};
886
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300887static const __u8 po3130_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300888 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
889 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
890 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
891 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
892 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
893 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
894 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
895 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
896 {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
897 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
898 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
899 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
900 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
901 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
902 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
903 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
904 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
905 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
906 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
907 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
908 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
909 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
910 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
911 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
912 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
913 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
914 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
915 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
916 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
917 {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
918 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
919 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
920 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
921 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
922 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
923 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
924 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
925 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
926 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
927 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
928 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
929 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
930 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
931 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
932 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
933 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
934 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
935 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
936 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
937 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
938 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
939 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
940 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
941 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
942 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
943 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
944 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
945 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
946 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
947 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
948 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
949 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
950 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
951 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
952 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
953 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
954 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
955 {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
956 {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
957 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
958 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
959 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
960 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
961 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
962 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
963 {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
964 {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
965 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
966 {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
967 {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
968 {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
969 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
970 {}
971};
972
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300973static const __u8 hv7131r_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300974/* 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
975 * 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff */
976 0x04, 0x1a, 0x36, 0x55, 0x6f, 0x87, 0x9d, 0xb0, 0xc1,
977 0xcf, 0xda, 0xe4, 0xec, 0xf3, 0xf8, 0xfd, 0xff
978};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300979static const __u8 hv7131r_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300980 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
981};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300982static const __u8 hv7131r_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300983 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
984 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
985 {0xb3, 0x00, 0x24, 0xcc},
986 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
987 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
988 {0xb3, 0x06, 0x01, 0xcc},
989 {0xb3, 0x01, 0x45, 0xcc}, {0xb3, 0x03, 0x0b, 0xcc},
990 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
991 {0xb3, 0x21, 0x00, 0xcc},
992 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
993 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
994 {0xb3, 0x16, 0x02, 0xcc},
995 {0xb3, 0x17, 0x7f, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
996 {0xb3, 0x35, 0x91, 0xcc}, {0xb3, 0x00, 0x27, 0xcc},
997 {0xbc, 0x00, 0x73, 0xcc},
998 {0xb8, 0x00, 0x23, 0xcc}, {0x00, 0x01, 0x0c, 0xaa},
999 {0x00, 0x14, 0x01, 0xaa}, {0x00, 0x15, 0xe6, 0xaa},
1000 {0x00, 0x16, 0x02, 0xaa},
1001 {0x00, 0x17, 0x86, 0xaa}, {0x00, 0x23, 0x00, 0xaa},
1002 {0x00, 0x25, 0x09, 0xaa}, {0x00, 0x26, 0x27, 0xaa},
1003 {0x00, 0x27, 0xc0, 0xaa},
1004 {0xb8, 0x2c, 0x60, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1005 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1006 {0xb8, 0x30, 0x50, 0xcc},
1007 {0xb8, 0x31, 0xf8, 0xcc}, {0xb8, 0x32, 0xf8, 0xcc},
1008 {0xb8, 0x33, 0xf8, 0xcc}, {0xb8, 0x34, 0x65, 0xcc},
1009 {0xb8, 0x35, 0x00, 0xcc},
1010 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1011 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x01, 0x7d, 0xcc},
1012 {0xb8, 0x81, 0x09, 0xcc},
1013 {0xb3, 0x01, 0x41, 0xcc}, {0xb8, 0xfe, 0x00, 0xcc},
1014 {0xb8, 0xff, 0x28, 0xcc}, {0xb9, 0x00, 0x28, 0xcc},
1015 {0xb9, 0x01, 0x28, 0xcc},
1016 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1017 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1018 {0xb9, 0x06, 0x3c, 0xcc},
1019 {0xb9, 0x07, 0x3c, 0xcc}, {0xb9, 0x08, 0x3c, 0xcc},
1020 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1021 {0x00, 0x30, 0x18, 0xaa},
1022 {}
1023};
1024
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001025static const __u8 hv7131r_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001026 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1027 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1028 {0xb3, 0x00, 0x24, 0xcc},
1029 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1030 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1031 {0xb3, 0x06, 0x01, 0xcc},
1032 {0xb3, 0x03, 0x0b, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1033 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
1034 {0xb3, 0x22, 0x01, 0xcc},
1035 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
1036 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x02, 0xcc},
1037 {0xb3, 0x17, 0x7f, 0xcc},
1038 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0x91, 0xcc},
1039 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1040 {0xb8, 0x00, 0x21, 0xcc},
1041 {0x00, 0x01, 0x0c, 0xaa}, {0x00, 0x14, 0x01, 0xaa},
1042 {0x00, 0x15, 0xe6, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
1043 {0x00, 0x17, 0x86, 0xaa},
1044 {0x00, 0x23, 0x00, 0xaa}, {0x00, 0x25, 0x01, 0xaa},
1045 {0x00, 0x26, 0xd4, 0xaa}, {0x00, 0x27, 0xc0, 0xaa},
1046 {0xbc, 0x02, 0x08, 0xcc},
1047 {0xbc, 0x03, 0x70, 0xcc}, {0xbc, 0x04, 0x08, 0xcc},
1048 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1049 {0xbc, 0x08, 0x3c, 0xcc},
1050 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x04, 0xcc},
1051 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1052 {0xb8, 0xfe, 0x02, 0xcc},
1053 {0xb8, 0xff, 0x07, 0xcc}, {0xb9, 0x00, 0x14, 0xcc},
1054 {0xb9, 0x01, 0x14, 0xcc}, {0xb9, 0x02, 0x14, 0xcc},
1055 {0xb9, 0x03, 0x00, 0xcc},
1056 {0xb9, 0x04, 0x02, 0xcc}, {0xb9, 0x05, 0x05, 0xcc},
1057 {0xb9, 0x06, 0x0f, 0xcc}, {0xb9, 0x07, 0x0f, 0xcc},
1058 {0xb9, 0x08, 0x0f, 0xcc},
1059 {0xb8, 0x2c, 0x60, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1060 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1061 {0xb8, 0x30, 0x50, 0xcc},
1062 {0xb8, 0x31, 0xf8, 0xcc}, {0xb8, 0x32, 0xf8, 0xcc},
1063 {0xb8, 0x33, 0xf8, 0xcc},
1064 {0xb8, 0x34, 0x65, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1065 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1066 {0xb8, 0x27, 0x20, 0xcc},
1067 {0xb8, 0x01, 0x7d, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1068 {0xb3, 0x01, 0x41, 0xcc}, {0xb8, 0xfe, 0x00, 0xcc},
1069 {0xb8, 0xff, 0x28, 0xcc},
1070 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1071 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1072 {0xb9, 0x04, 0x00, 0xcc},
1073 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1074 {0xb9, 0x07, 0x3c, 0xcc}, {0xb9, 0x08, 0x3c, 0xcc},
1075 {0xb8, 0x8e, 0x00, 0xcc},
1076 {0xb8, 0x8f, 0xff, 0xcc}, {0x00, 0x30, 0x18, 0xaa},
1077 {}
1078};
1079
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001080static const __u8 ov7660_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001081 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1082 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1083};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001084static const __u8 ov7660_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001085 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1086};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001087static const __u8 ov7660_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001088 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1089 {0x00, 0x00, 0x50, 0xdd},
1090 {0xb0, 0x03, 0x01, 0xcc},
1091 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1092 {0xb3, 0x05, 0x01, 0xcc},
1093 {0xb3, 0x06, 0x03, 0xcc},
1094 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1095 {0xb3, 0x05, 0x00, 0xcc},
1096 {0xb3, 0x06, 0x01, 0xcc},
1097 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1098 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1099 {0xb3, 0x21, 0x00, 0xcc},
1100 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1101 {0xb3, 0x1f, 0x02, 0xcc},
1102 {0xb3, 0x34, 0x01, 0xcc},
1103 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1104 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1105 {0xb8, 0x01, 0x7d, 0xcc},
1106 {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1107 {0xb8, 0x27, 0x20, 0xcc},
1108 {0xb8, 0x8f, 0x50, 0xcc},
1109 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1110 {0x00, 0x12, 0x80, 0xaa},
1111 {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001112 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001113 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1114 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1115 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1116 {0x00, 0x13, 0xa7, 0xaa},
1117 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1118 {0x00, 0x36, 0x00, 0xaa},
1119 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1120 {0x00, 0x39, 0x43, 0xaa},
1121 {0x00, 0x8d, 0xcf, 0xaa},
1122 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1123 {0x00, 0x0f, 0x62, 0xaa},
1124 {0x00, 0x35, 0x84, 0xaa},
1125 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1126 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1127 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1128 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1129 {0x00, 0x01, 0x80, 0xaa},
1130 {0x00, 0x02, 0x80, 0xaa},
1131 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1132 {0xb9, 0x00, 0x28, 0xcc},
1133 {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
1134 {0xb9, 0x03, 0x00, 0xcc},
1135 {0xb9, 0x04, 0x00, 0xcc},
1136 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1137 {0xb9, 0x07, 0x3c, 0xcc},
1138 {0xb9, 0x08, 0x3c, 0xcc},
1139
1140 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1141
1142 {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
1143 {}
1144};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001145static const __u8 ov7660_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001146 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1147 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1148 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1149 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
1150 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1151 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1152 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1153 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1154 {0xb3, 0x21, 0x00, 0xcc},
1155 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1156 {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1157 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1158 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1159 {0xb8, 0x01, 0x7d, 0xcc},
1160/* sizer */
1161 {0xbc, 0x00, 0xd3, 0xcc},
1162 {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1163 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
1164 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1165 {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001166 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001167 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1168 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1169 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1170 {0x00, 0x13, 0xa7, 0xaa},
1171 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1172 {0x00, 0x36, 0x00, 0xaa},
1173 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1174 {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
1175 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1176 {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
1177 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1178 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1179 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1180 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1181 {0x00, 0x01, 0x80, 0xaa},
1182 {0x00, 0x02, 0x80, 0xaa},
1183/* sizer filters */
1184 {0xbc, 0x02, 0x08, 0xcc},
1185 {0xbc, 0x03, 0x70, 0xcc},
1186 {0xb8, 0x35, 0x00, 0xcc},
1187 {0xb8, 0x36, 0x00, 0xcc},
1188 {0xb8, 0x37, 0x00, 0xcc},
1189 {0xbc, 0x04, 0x08, 0xcc},
1190 {0xbc, 0x05, 0x00, 0xcc},
1191 {0xbc, 0x06, 0x00, 0xcc},
1192 {0xbc, 0x08, 0x3c, 0xcc},
1193 {0xbc, 0x09, 0x40, 0xcc},
1194 {0xbc, 0x0a, 0x04, 0xcc},
1195 {0xbc, 0x0b, 0x00, 0xcc},
1196 {0xbc, 0x0c, 0x00, 0xcc},
1197/* */
1198 {0xb8, 0xfe, 0x00, 0xcc},
1199 {0xb8, 0xff, 0x28, 0xcc},
1200/* */
1201 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1202 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1203 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1204 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1205 {0xb9, 0x08, 0x3c, 0xcc},
1206/* */
1207 {0xb8, 0x8e, 0x00, 0xcc},
1208 {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1209 {0x00, 0x29, 0x3c, 0xaa},
1210 {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001211 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001212};
1213
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001214static const __u8 ov7660_50HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001215 {0x00, 0x3b, 0x08, 0xaa},
1216 {0x00, 0x9d, 0x40, 0xaa},
1217 {0x00, 0x13, 0xa7, 0xaa},
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001218 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001219};
1220
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001221static const __u8 ov7660_60HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001222 {0x00, 0x3b, 0x00, 0xaa},
1223 {0x00, 0x9e, 0x40, 0xaa},
1224 {0x00, 0x13, 0xa7, 0xaa},
1225 {}
1226};
1227
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001228static const __u8 ov7660_NoFliker[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001229 {0x00, 0x13, 0x87, 0xaa},
1230 {}
1231};
1232
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001233static const __u8 ov7670_initVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001234 {0xb3, 0x01, 0x05, 0xcc},
1235 {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc},
1236 {0x00, 0x00, 0x10, 0xdd},
1237 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1238 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1239 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1240 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1241 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1242 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1243 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1244 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1245 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1246 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1247 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0x41, 0xcc},
1248 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1249 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1250 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1251 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1252 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1253 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1254 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1255 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1256 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1257 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
1258 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
1259 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
1260 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
1261 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
1262 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
1263 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
1264 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
1265 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
1266 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
1267 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
1268 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
1269 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
1270 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
1271 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001272 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1273 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001274 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
1275 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
1276 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
1277 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
1278 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
1279 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
1280 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
1281 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
1282 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
1283 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
1284 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
1285 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
1286 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
1287 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
1288 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
1289 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
1290 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
1291 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
1292 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
1293 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
1294 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
1295 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
1296 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
1297 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
1298 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
1299 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
1300 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
1301 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
1302 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1303 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
1304 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1305 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
1306 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1307 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
1308 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1309 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
1310 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
1311 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
1312 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
1313 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
1314 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
1315 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
1316 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
1317 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
1318 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
1319 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
1320 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
1321 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
1322 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
1323 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
1324 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
1325 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
1326 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
1327 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
1328 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
1329 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1330 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
1331 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
1332 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
1333 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
1334 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
1335 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
1336 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
1337 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001338 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
1339 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001340 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
1341 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
1342 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
1343 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1344 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
1345 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1346 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
1347 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1348 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
1349 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1350 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
1351 {0xb6, 0x03, 0x02, 0xcc}, {0xb6, 0x02, 0x80, 0xcc},
1352 {0xb6, 0x05, 0x01, 0xcc}, {0xb6, 0x04, 0xe0, 0xcc},
1353 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x13, 0xcc},
1354 {0xb6, 0x18, 0x02, 0xcc}, {0xb6, 0x17, 0x58, 0xcc},
1355 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
1356 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
1357 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
1358 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
1359 {0x00, 0x77, 0x05, 0xaa},
1360 {},
1361};
1362
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001363static const __u8 ov7670_initQVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001364 {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd},
1365 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1366 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1367 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1368 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1369 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1370 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1371 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1372 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1373 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1374 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1375 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1376 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1377 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1378 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1379 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1380 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1381 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1382 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1383 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1384 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1385 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1386 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
1387 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
1388 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
1389 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
1390 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
1391 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
1392 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
1393 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
1394 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
1395 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
1396 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
1397 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
1398 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
1399 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
1400 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001401 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1402 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001403 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
1404 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
1405 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
1406 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
1407 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
1408 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
1409 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
1410 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
1411 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
1412 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
1413 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
1414 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
1415 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
1416 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
1417 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
1418 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
1419 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
1420 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
1421 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
1422 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
1423 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
1424 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
1425 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
1426 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
1427 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
1428 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
1429 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
1430 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
1431 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1432 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
1433 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1434 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
1435 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1436 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
1437 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1438 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
1439 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
1440 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
1441 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
1442 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
1443 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
1444 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
1445 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
1446 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
1447 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
1448 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
1449 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
1450 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
1451 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
1452 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
1453 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
1454 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
1455 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
1456 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
1457 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
1458 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1459 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
1460 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
1461 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
1462 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
1463 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
1464 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
1465 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
1466 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001467 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
1468 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001469 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
1470 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
1471 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
1472 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1473 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
1474 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1475 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
1476 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1477 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
1478 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1479 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
1480 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
1481 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
1482 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x21, 0xcc},
1483 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
1484 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
1485 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
1486 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
1487 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
1488 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
1489 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
1490 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
1491 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1492 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
1493 {0x00, 0x77, 0x05, 0xaa },
1494 {},
1495};
Jean-Francois Moine88521532008-12-10 05:06:13 -03001496
1497/* PO1200 - values from usbvm326.inf and ms-win trace */
1498static const __u8 po1200_gamma[17] = {
1499 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1500 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1501};
1502static const __u8 po1200_matrix[9] = {
1503 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
1504};
1505static const __u8 po1200_initVGA_data[][4] = {
1506 {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
1507 {0xb0, 0x03, 0x19, 0xcc},
1508/* {0x00, 0x00, 0x33, 0xdd}, */
1509 {0xb0, 0x04, 0x02, 0xcc},
1510 {0xb0, 0x02, 0x02, 0xcc},
1511 {0xb3, 0x5d, 0x00, 0xcc},
1512 {0xb3, 0x01, 0x01, 0xcc},
1513 {0xb3, 0x00, 0x64, 0xcc},
1514 {0xb3, 0x00, 0x65, 0xcc},
1515 {0xb3, 0x05, 0x01, 0xcc},
1516 {0xb3, 0x06, 0x01, 0xcc},
1517 {0xb3, 0x5c, 0x01, 0xcc},
1518 {0xb3, 0x08, 0x01, 0xcc},
1519 {0xb3, 0x09, 0x0c, 0xcc},
1520 {0xb3, 0x00, 0x67, 0xcc},
1521 {0xb3, 0x02, 0xb2, 0xcc},
1522 {0xb3, 0x03, 0x18, 0xcc},
1523 {0xb3, 0x04, 0x15, 0xcc},
1524 {0xb3, 0x20, 0x00, 0xcc},
1525 {0xb3, 0x21, 0x00, 0xcc},
1526 {0xb3, 0x22, 0x02, 0xcc},
1527 {0xb3, 0x23, 0x58, 0xcc},
1528 {0xb3, 0x14, 0x00, 0xcc},
1529 {0xb3, 0x15, 0x00, 0xcc},
1530 {0xb3, 0x16, 0x03, 0xcc},
1531 {0xb3, 0x17, 0x1f, 0xcc},
1532 {0xbc, 0x00, 0x71, 0xcc},
1533 {0xbc, 0x01, 0x01, 0xcc},
1534 {0xb0, 0x54, 0x13, 0xcc},
1535 {0xb3, 0x00, 0x67, 0xcc},
1536 {0xb3, 0x34, 0x01, 0xcc},
1537 {0xb3, 0x35, 0xdc, 0xcc},
1538 {0x00, 0x03, 0x00, 0xaa},
1539 {0x00, 0x12, 0x05, 0xaa},
1540 {0x00, 0x13, 0x02, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001541 {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001542 {0x00, 0x21, 0x00, 0xaa},
1543 {0x00, 0x25, 0x02, 0xaa},
1544 {0x00, 0x3c, 0x4f, 0xaa},
1545 {0x00, 0x3f, 0xe0, 0xaa},
1546 {0x00, 0x42, 0xff, 0xaa},
1547 {0x00, 0x45, 0x34, 0xaa},
1548 {0x00, 0x55, 0xfe, 0xaa},
1549 {0x00, 0x59, 0xd3, 0xaa},
1550 {0x00, 0x5e, 0x04, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001551 {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001552 {0x00, 0x62, 0x02, 0xaa},
1553 {0x00, 0xa7, 0x31, 0xaa},
1554 {0x00, 0xa9, 0x66, 0xaa},
1555 {0x00, 0xb0, 0x00, 0xaa},
1556 {0x00, 0xb1, 0x00, 0xaa},
1557 {0x00, 0xb3, 0x11, 0xaa},
1558 {0x00, 0xb6, 0x26, 0xaa},
1559 {0x00, 0xb7, 0x20, 0xaa},
1560 {0x00, 0xba, 0x04, 0xaa},
1561 {0x00, 0x88, 0x42, 0xaa},
1562 {0x00, 0x89, 0x9a, 0xaa},
1563 {0x00, 0x8a, 0x88, 0xaa},
1564 {0x00, 0x8b, 0x8e, 0xaa},
1565 {0x00, 0x8c, 0x3e, 0xaa},
1566 {0x00, 0x8d, 0x90, 0xaa},
1567 {0x00, 0x8e, 0x87, 0xaa},
1568 {0x00, 0x8f, 0x96, 0xaa},
1569 {0x00, 0x90, 0x3d, 0xaa},
1570 {0x00, 0x64, 0x00, 0xaa},
1571 {0x00, 0x65, 0x10, 0xaa},
1572 {0x00, 0x66, 0x20, 0xaa},
1573 {0x00, 0x67, 0x2b, 0xaa},
1574 {0x00, 0x68, 0x36, 0xaa},
1575 {0x00, 0x69, 0x49, 0xaa},
1576 {0x00, 0x6a, 0x5a, 0xaa},
1577 {0x00, 0x6b, 0x7f, 0xaa},
1578 {0x00, 0x6c, 0x9b, 0xaa},
1579 {0x00, 0x6d, 0xba, 0xaa},
1580 {0x00, 0x6e, 0xd4, 0xaa},
1581 {0x00, 0x6f, 0xea, 0xaa},
1582 {0x00, 0x70, 0x00, 0xaa},
1583 {0x00, 0x71, 0x10, 0xaa},
1584 {0x00, 0x72, 0x20, 0xaa},
1585 {0x00, 0x73, 0x2b, 0xaa},
1586 {0x00, 0x74, 0x36, 0xaa},
1587 {0x00, 0x75, 0x49, 0xaa},
1588 {0x00, 0x76, 0x5a, 0xaa},
1589 {0x00, 0x77, 0x7f, 0xaa},
1590 {0x00, 0x78, 0x9b, 0xaa},
1591 {0x00, 0x79, 0xba, 0xaa},
1592 {0x00, 0x7a, 0xd4, 0xaa},
1593 {0x00, 0x7b, 0xea, 0xaa},
1594 {0x00, 0x7c, 0x00, 0xaa},
1595 {0x00, 0x7d, 0x10, 0xaa},
1596 {0x00, 0x7e, 0x20, 0xaa},
1597 {0x00, 0x7f, 0x2b, 0xaa},
1598 {0x00, 0x80, 0x36, 0xaa},
1599 {0x00, 0x81, 0x49, 0xaa},
1600 {0x00, 0x82, 0x5a, 0xaa},
1601 {0x00, 0x83, 0x7f, 0xaa},
1602 {0x00, 0x84, 0x9b, 0xaa},
1603 {0x00, 0x85, 0xba, 0xaa},
1604 {0x00, 0x86, 0xd4, 0xaa},
1605 {0x00, 0x87, 0xea, 0xaa},
1606 {0x00, 0x57, 0x2a, 0xaa},
1607 {0x00, 0x03, 0x01, 0xaa},
1608 {0x00, 0x04, 0x10, 0xaa},
1609 {0x00, 0x05, 0x10, 0xaa},
1610 {0x00, 0x06, 0x10, 0xaa},
1611 {0x00, 0x07, 0x10, 0xaa},
1612 {0x00, 0x08, 0x13, 0xaa},
1613 {0x00, 0x0a, 0x00, 0xaa},
1614 {0x00, 0x0b, 0x10, 0xaa},
1615 {0x00, 0x0c, 0x20, 0xaa},
1616 {0x00, 0x0d, 0x18, 0xaa},
1617 {0x00, 0x22, 0x01, 0xaa},
1618 {0x00, 0x23, 0x60, 0xaa},
1619 {0x00, 0x25, 0x08, 0xaa},
1620 {0x00, 0x26, 0x82, 0xaa},
1621 {0x00, 0x2e, 0x0f, 0xaa},
1622 {0x00, 0x2f, 0x1e, 0xaa},
1623 {0x00, 0x30, 0x2d, 0xaa},
1624 {0x00, 0x31, 0x3c, 0xaa},
1625 {0x00, 0x32, 0x4b, 0xaa},
1626 {0x00, 0x33, 0x5a, 0xaa},
1627 {0x00, 0x34, 0x69, 0xaa},
1628 {0x00, 0x35, 0x78, 0xaa},
1629 {0x00, 0x36, 0x87, 0xaa},
1630 {0x00, 0x37, 0x96, 0xaa},
1631 {0x00, 0x38, 0xa5, 0xaa},
1632 {0x00, 0x39, 0xb4, 0xaa},
1633 {0x00, 0x3a, 0xc3, 0xaa},
1634 {0x00, 0x3b, 0xd2, 0xaa},
1635 {0x00, 0x3c, 0xe1, 0xaa},
1636 {0x00, 0x3e, 0xff, 0xaa},
1637 {0x00, 0x3f, 0xff, 0xaa},
1638 {0x00, 0x40, 0xff, 0xaa},
1639 {0x00, 0x41, 0xff, 0xaa},
1640 {0x00, 0x42, 0xff, 0xaa},
1641 {0x00, 0x43, 0xff, 0xaa},
1642 {0x00, 0x03, 0x00, 0xaa},
1643 {0x00, 0x03, 0x00, 0xaa},
1644 {0x00, 0x20, 0xc4, 0xaa},
1645 {0x00, 0x13, 0x03, 0xaa},
1646 {0x00, 0x3c, 0x50, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001647 {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001648 {0x00, 0x51, 0x5b, 0xaa},
1649 {0x00, 0x52, 0x91, 0xaa},
1650 {0x00, 0x53, 0x4c, 0xaa},
1651 {0x00, 0x54, 0x50, 0xaa},
1652 {0x00, 0x56, 0x02, 0xaa},
1653 {0xb6, 0x00, 0x00, 0xcc},
1654 {0xb6, 0x03, 0x03, 0xcc},
1655 {0xb6, 0x02, 0x20, 0xcc},
1656 {0xb6, 0x05, 0x02, 0xcc},
1657 {0xb6, 0x04, 0x58, 0xcc},
1658 {0xb6, 0x12, 0xf8, 0xcc},
1659 {0xb6, 0x13, 0x21, 0xcc},
1660 {0xb6, 0x18, 0x03, 0xcc},
1661 {0xb6, 0x17, 0xa9, 0xcc},
1662 {0xb6, 0x16, 0x80, 0xcc},
1663 {0xb6, 0x22, 0x12, 0xcc},
1664 {0xb6, 0x23, 0x0b, 0xcc},
1665 {0xbf, 0xc0, 0x39, 0xcc},
1666 {0xbf, 0xc1, 0x04, 0xcc},
1667 {0xbf, 0xcc, 0x00, 0xcc},
1668 {0xb8, 0x06, 0x20, 0xcc},
1669 {0xb8, 0x07, 0x03, 0xcc},
1670 {0xb8, 0x08, 0x58, 0xcc},
1671 {0xb8, 0x09, 0x02, 0xcc},
1672 {0xb3, 0x01, 0x41, 0xcc},
1673 {0x00, 0x03, 0x00, 0xaa},
1674 {0x00, 0xd9, 0x0f, 0xaa},
1675 {0x00, 0xda, 0xaa, 0xaa},
1676 {0x00, 0xd9, 0x10, 0xaa},
1677 {0x00, 0xda, 0xaa, 0xaa},
1678 {0x00, 0xd9, 0x11, 0xaa},
1679 {0x00, 0xda, 0x00, 0xaa},
1680 {0x00, 0xd9, 0x12, 0xaa},
1681 {0x00, 0xda, 0xff, 0xaa},
1682 {0x00, 0xd9, 0x13, 0xaa},
1683 {0x00, 0xda, 0xff, 0xaa},
1684 {0x00, 0xe8, 0x11, 0xaa},
1685 {0x00, 0xe9, 0x12, 0xaa},
1686 {0x00, 0xea, 0x5c, 0xaa},
1687 {0x00, 0xeb, 0xff, 0xaa},
1688 {0x00, 0xd8, 0x80, 0xaa},
1689 {0x00, 0xe6, 0x02, 0xaa},
1690 {0x00, 0xd6, 0x40, 0xaa},
1691 {0x00, 0xe3, 0x05, 0xaa},
1692 {0x00, 0xe0, 0x40, 0xaa},
1693 {0x00, 0xde, 0x03, 0xaa},
1694 {0x00, 0xdf, 0x03, 0xaa},
1695 {0x00, 0xdb, 0x02, 0xaa},
1696 {0x00, 0xdc, 0x00, 0xaa},
1697 {0x00, 0xdd, 0x03, 0xaa},
1698 {0x00, 0xe1, 0x08, 0xaa},
1699 {0x00, 0xe2, 0x01, 0xaa},
1700 {0x00, 0xd6, 0x40, 0xaa},
1701 {0x00, 0xe4, 0x40, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001702 {0x00, 0xa8, 0x8f, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001703 {0x00, 0xb4, 0x16, 0xaa},
1704 {0xb0, 0x02, 0x06, 0xcc},
1705 {0xb0, 0x18, 0x06, 0xcc},
1706 {0xb0, 0x19, 0x06, 0xcc},
1707 {0xb3, 0x5d, 0x18, 0xcc},
1708 {0xb3, 0x05, 0x00, 0xcc},
1709 {0xb3, 0x06, 0x00, 0xcc},
1710 {0x00, 0xb4, 0x0e, 0xaa},
1711 {0x00, 0xb5, 0x49, 0xaa},
1712 {0x00, 0xb6, 0x1c, 0xaa},
1713 {0x00, 0xb7, 0x96, 0xaa},
1714/* end of usbvm326.inf - start of ms-win trace */
1715 {0xb6, 0x12, 0xf8, 0xcc},
1716 {0xb6, 0x13, 0x3d, 0xcc},
1717/*read b306*/
1718 {0x00, 0x03, 0x00, 0xaa},
1719 {0x00, 0x1a, 0x09, 0xaa},
1720 {0x00, 0x1b, 0x8a, 0xaa},
1721/*read b827*/
1722 {0xb8, 0x27, 0x00, 0xcc},
1723 {0xb8, 0x26, 0x60, 0xcc},
1724 {0xb8, 0x26, 0x60, 0xcc},
1725/*gamma - to do?*/
1726 {0x00, 0x03, 0x00, 0xaa},
1727 {0x00, 0xae, 0x84, 0xaa},
1728/*gamma again*/
1729 {0x00, 0x03, 0x00, 0xaa},
1730 {0x00, 0x96, 0xa0, 0xaa},
1731/*matrix*/
1732 {0x00, 0x03, 0x00, 0xaa},
1733 {0x00, 0x91, 0x35, 0xaa},
1734 {0x00, 0x92, 0x22, 0xaa},
1735/*gamma*/
1736 {0x00, 0x03, 0x00, 0xaa},
1737 {0x00, 0x95, 0x85, 0xaa},
1738/*matrix*/
1739 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001740 {0x00, 0x4d, 0x20, 0xaa},
1741 {0xb8, 0x22, 0x40, 0xcc},
1742 {0xb8, 0x23, 0x40, 0xcc},
1743 {0xb8, 0x24, 0x40, 0xcc},
1744 {0xb8, 0x81, 0x09, 0xcc},
1745 {0x00, 0x00, 0x64, 0xdd},
1746 {0x00, 0x03, 0x01, 0xaa},
1747/*read 46*/
1748 {0x00, 0x46, 0x3c, 0xaa},
1749 {0x00, 0x03, 0x00, 0xaa},
1750 {0x00, 0x16, 0x40, 0xaa},
1751 {0x00, 0x17, 0x40, 0xaa},
1752 {0x00, 0x18, 0x40, 0xaa},
1753 {0x00, 0x19, 0x41, 0xaa},
1754 {0x00, 0x03, 0x01, 0xaa},
1755 {0x00, 0x46, 0x3c, 0xaa},
1756 {0x00, 0x00, 0x18, 0xdd},
1757/*read bfff*/
1758 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001759 {0x00, 0xb4, 0x1c, 0xaa},
1760 {0x00, 0xb5, 0x92, 0xaa},
1761 {0x00, 0xb6, 0x39, 0xaa},
1762 {0x00, 0xb7, 0x24, 0xaa},
1763/*write 89 0400 1415*/
1764};
1765
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001766struct sensor_info {
1767 int sensorId;
1768 __u8 I2cAdd;
1769 __u8 IdAdd;
1770 __u16 VpId;
1771 __u8 m1;
1772 __u8 m2;
1773 __u8 op;
1774 };
1775
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001776static const struct sensor_info sensor_info_data[] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001777/* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
1778 {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
1779 {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
1780 {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01},
1781 {SENSOR_MI1320, 0x80 | 0xc8, 0x00, 0x148c, 0x64, 0x65, 0x01},
1782 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
1783 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001784/* (tested in vc032x_probe_sensor) */
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001785/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001786 {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001787};
1788
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001789/* read 'len' bytes in gspca_dev->usb_buf */
1790static void reg_r(struct gspca_dev *gspca_dev,
1791 __u16 req,
1792 __u16 index,
1793 __u16 len)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001794{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001795 usb_control_msg(gspca_dev->dev,
1796 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001797 req,
1798 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1799 1, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001800 index, gspca_dev->usb_buf, len,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001801 500);
1802}
1803
1804static void reg_w(struct usb_device *dev,
1805 __u16 req,
1806 __u16 value,
1807 __u16 index)
1808{
1809 usb_control_msg(dev,
1810 usb_sndctrlpipe(dev, 0),
1811 req,
1812 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1813 value, index, NULL, 0,
1814 500);
1815}
1816
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001817static void read_sensor_register(struct gspca_dev *gspca_dev,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001818 __u16 address, __u16 *value)
1819{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001820 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001821 __u8 ldata, mdata, hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001822 int retry = 50;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001823
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001824 *value = 0;
1825
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001826 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001827 /*PDEBUG(D_PROBE, " I2c Bus Busy Wait 0x%02X ", tmpvalue); */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001828 if (!(gspca_dev->usb_buf[0] & 0x02)) {
1829 PDEBUG(D_ERR, "I2c Bus Busy Wait %d",
1830 gspca_dev->usb_buf[0] & 0x02);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001831 return;
1832 }
1833 reg_w(dev, 0xa0, address, 0xb33a);
1834 reg_w(dev, 0xa0, 0x02, 0xb339);
1835
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001836 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
1837 while (retry-- && gspca_dev->usb_buf[0]) {
1838 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001839/* PDEBUG(D_PROBE, "Read again 0xb33b %d", tmpvalue); */
1840 msleep(1);
1841 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001842 reg_r(gspca_dev, 0xa1, 0xb33e, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001843 ldata = gspca_dev->usb_buf[0];
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001844 reg_r(gspca_dev, 0xa1, 0xb33d, 1);
1845 mdata = gspca_dev->usb_buf[0];
1846 reg_r(gspca_dev, 0xa1, 0xb33c, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001847 hdata = gspca_dev->usb_buf[0];
1848 PDEBUG(D_PROBE, "Read Sensor %02x%02x %02x",
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001849 hdata, mdata, ldata);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001850 reg_r(gspca_dev, 0xa1, 0xb334, 1);
1851 if (gspca_dev->usb_buf[0] == 0x02)
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001852 *value = (hdata << 8) + mdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001853 else
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001854 *value = hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001855}
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001856
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001857static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
1858{
1859 struct usb_device *dev = gspca_dev->dev;
1860 int i;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001861 __u16 value;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001862 const struct sensor_info *ptsensor_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001863
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001864 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001865 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001866 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
1867 ptsensor_info = &sensor_info_data[i];
1868 reg_w(dev, 0xa0, 0x02, 0xb334);
1869 reg_w(dev, 0xa0, ptsensor_info->m1, 0xb300);
1870 reg_w(dev, 0xa0, ptsensor_info->m2, 0xb300);
1871 reg_w(dev, 0xa0, 0x01, 0xb308);
1872 reg_w(dev, 0xa0, 0x0c, 0xb309);
1873 reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001874 reg_w(dev, 0xa0, ptsensor_info->op, 0xb301);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001875 read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value);
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001876 if (value == ptsensor_info->VpId)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001877 return ptsensor_info->sensorId;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001878
1879 /* special case for MI0360 */
1880 if (ptsensor_info->sensorId == SENSOR_MI1310_SOC
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001881 && value == 0x8243)
Jean-Francois Moine8d3f6e32008-12-10 05:13:05 -03001882 return SENSOR_MI0360;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001883 }
1884 return -1;
1885}
1886
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001887static __u8 i2c_write(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001888 __u8 reg, const __u8 *val, __u8 size)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001889{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001890 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001891
1892 if (size > 3 || size < 1)
1893 return -EINVAL;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001894 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03001895 reg_w(dev, 0xa0, size, 0xb334);
1896 reg_w(dev, 0xa0, reg, 0xb33a);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001897 switch (size) {
1898 case 1:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03001899 reg_w(dev, 0xa0, val[0], 0xb336);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001900 break;
1901 case 2:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03001902 reg_w(dev, 0xa0, val[0], 0xb336);
1903 reg_w(dev, 0xa0, val[1], 0xb337);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001904 break;
1905 case 3:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03001906 reg_w(dev, 0xa0, val[0], 0xb336);
1907 reg_w(dev, 0xa0, val[1], 0xb337);
1908 reg_w(dev, 0xa0, val[2], 0xb338);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001909 break;
1910 default:
1911 reg_w(dev, 0xa0, 0x01, 0xb334);
1912 return -EINVAL;
1913 }
1914 reg_w(dev, 0xa0, 0x01, 0xb339);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001915 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
1916 return gspca_dev->usb_buf[0] == 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001917}
1918
1919static void put_tab_to_reg(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001920 const __u8 *tab, __u8 tabsize, __u16 addr)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001921{
1922 int j;
1923 __u16 ad = addr;
1924
1925 for (j = 0; j < tabsize; j++)
1926 reg_w(gspca_dev->dev, 0xa0, tab[j], ad++);
1927}
1928
1929static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001930 const __u8 data[][4])
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001931{
1932 struct usb_device *dev = gspca_dev->dev;
1933 int i = 0;
1934
1935 for (;;) {
1936 switch (data[i][3]) {
1937 default:
1938 return;
1939 case 0xcc: /* normal write */
1940 reg_w(dev, 0xa0, data[i][2],
1941 ((data[i][0])<<8) | data[i][1]);
1942 break;
1943 case 0xaa: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001944 i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001945 break;
1946 case 0xbb: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001947 i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001948 break;
1949 case 0xdd:
1950 msleep(data[i][2] + 10);
1951 break;
1952 }
1953 i++;
1954 }
1955 /*not reached*/
1956}
1957
1958/*
1959 "GammaT"=hex:04,17,31,4f,6a,83,99,ad,bf,ce,da,e5,ee,f5,fb,ff,ff
1960 "MatrixT"=hex:60,f9,e5,e7,50,05,f3,e6,66
1961 */
1962
1963static void vc0321_reset(struct gspca_dev *gspca_dev)
1964{
1965 reg_w(gspca_dev->dev, 0xa0, 0x00, 0xb04d);
1966 reg_w(gspca_dev->dev, 0xa0, 0x01, 0xb301);
1967 msleep(100);
1968 reg_w(gspca_dev->dev, 0xa0, 0x01, 0xb003);
1969 msleep(100);
1970}
1971
1972/* this function is called at probe time */
1973static int sd_config(struct gspca_dev *gspca_dev,
1974 const struct usb_device_id *id)
1975{
1976 struct sd *sd = (struct sd *) gspca_dev;
1977 struct usb_device *dev = gspca_dev->dev;
1978 struct cam *cam;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001979 int sensor;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001980
1981 cam = &gspca_dev->cam;
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03001982 sd->bridge = id->driver_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001983
1984 vc0321_reset(gspca_dev);
1985 sensor = vc032x_probe_sensor(gspca_dev);
1986 switch (sensor) {
1987 case -1:
1988 PDEBUG(D_PROBE, "Unknown sensor...");
1989 return -EINVAL;
1990 case SENSOR_HV7131R:
1991 PDEBUG(D_PROBE, "Find Sensor HV7131R");
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001992 break;
1993 case SENSOR_MI0360:
1994 PDEBUG(D_PROBE, "Find Sensor MI0360");
1995 sd->bridge = BRIDGE_VC0323;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001996 break;
1997 case SENSOR_MI1310_SOC:
1998 PDEBUG(D_PROBE, "Find Sensor MI1310_SOC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001999 break;
2000 case SENSOR_MI1320:
2001 PDEBUG(D_PROBE, "Find Sensor MI1320");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002002 break;
2003 case SENSOR_OV7660:
2004 PDEBUG(D_PROBE, "Find Sensor OV7660");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002005 break;
2006 case SENSOR_OV7670:
2007 PDEBUG(D_PROBE, "Find Sensor OV7670");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002008 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002009 case SENSOR_PO1200:
2010 PDEBUG(D_PROBE, "Find Sensor PO1200");
2011 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002012 case SENSOR_PO3130NC:
2013 PDEBUG(D_PROBE, "Find Sensor PO3130NC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002014 break;
2015 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002016 sd->sensor = sensor;
2017
2018 if (sd->bridge == BRIDGE_VC0321) {
2019 cam->cam_mode = vc0321_mode;
2020 cam->nmodes = ARRAY_SIZE(vc0321_mode);
2021 } else {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002022 if (sensor != SENSOR_PO1200) {
2023 cam->cam_mode = vc0323_mode;
2024 cam->nmodes = ARRAY_SIZE(vc0323_mode);
2025 } else {
2026 cam->cam_mode = svga_mode;
2027 cam->nmodes = ARRAY_SIZE(svga_mode);
2028 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002029 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002030
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002031 sd->hflip = HFLIP_DEF;
2032 sd->vflip = VFLIP_DEF;
2033 if (sd->sensor == SENSOR_OV7670) {
2034 sd->hflip = 1;
2035 sd->vflip = 1;
2036 }
Jean-Francois Moined0d0e392008-07-10 07:06:44 -03002037 sd->lightfreq = FREQ_DEF;
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03002038 if (sd->sensor != SENSOR_OV7670)
2039 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002040 switch (sd->sensor) {
2041 case SENSOR_OV7660:
2042 case SENSOR_OV7670:
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002043 case SENSOR_PO1200:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002044 break;
2045 default:
2046 gspca_dev->ctrl_dis = (1 << HFLIP_IDX)
2047 | (1 << VFLIP_IDX);
2048 break;
2049 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002050
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002051 sd->sharpness = SHARPNESS_DEF;
2052
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002053 if (sd->bridge == BRIDGE_VC0321) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002054 reg_r(gspca_dev, 0x8a, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002055 reg_w(dev, 0x87, 0x00, 0x0f0f);
2056
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002057 reg_r(gspca_dev, 0x8b, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002058 reg_w(dev, 0x88, 0x00, 0x0202);
2059 }
2060 return 0;
2061}
2062
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03002063/* this function is called at probe and time */
2064static int sd_init(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002065{
2066 return 0;
2067}
2068
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002069/* for OV7660 and OV7670 only */
2070static void sethvflip(struct gspca_dev *gspca_dev)
2071{
2072 struct sd *sd = (struct sd *) gspca_dev;
2073 __u8 data;
2074
2075 switch (sd->sensor) {
2076 case SENSOR_OV7660:
2077 data = 1;
2078 break;
2079 case SENSOR_OV7670:
2080 data = 7;
2081 break;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002082 case SENSOR_PO1200:
2083 data = 0;
2084 i2c_write(gspca_dev, 0x03, &data, 1);
2085 data = 0x80 * sd->hflip
2086 | 0x40 * sd->vflip
2087 | 0x06;
2088 i2c_write(gspca_dev, 0x1e, &data, 1);
2089 return;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002090 default:
2091 return;
2092 }
2093 data |= OV7660_MVFP_MIRROR * sd->hflip
2094 | OV7660_MVFP_VFLIP * sd->vflip;
2095 i2c_write(gspca_dev, OV7660_REG_MVFP, &data, 1);
2096}
2097
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002098static void setlightfreq(struct gspca_dev *gspca_dev)
2099{
2100 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002101 static const __u8 (*ov7660_freq_tb[3])[4] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002102 {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
2103
2104 if (sd->sensor != SENSOR_OV7660)
2105 return;
2106 usb_exchange(gspca_dev, ov7660_freq_tb[sd->lightfreq]);
2107}
2108
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002109/* po1200 only */
2110static void setsharpness(struct gspca_dev *gspca_dev)
2111{
2112 struct sd *sd = (struct sd *) gspca_dev;
2113 __u8 data;
2114
2115 if (sd->sensor != SENSOR_PO1200)
2116 return;
2117 data = 0;
2118 i2c_write(gspca_dev, 0x03, &data, 1);
2119 data = 0xb5 + sd->sharpness * 3;
2120 i2c_write(gspca_dev, 0x61, &data, 1);
2121}
2122
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002123static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002124{
2125 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002126 const __u8 *GammaT = NULL;
2127 const __u8 *MatrixT = NULL;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002128 int mode;
2129
2130 /* Assume start use the good resolution from gspca_dev->mode */
2131 if (sd->bridge == BRIDGE_VC0321) {
2132 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfec);
2133 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfed);
2134 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfee);
2135 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef);
2136 }
2137
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03002138 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002139 switch (sd->sensor) {
2140 case SENSOR_HV7131R:
2141 GammaT = hv7131r_gamma;
2142 MatrixT = hv7131r_matrix;
2143 if (mode) {
2144 /* 320x240 */
2145 usb_exchange(gspca_dev, hv7131r_initQVGA_data);
2146 } else {
2147 /* 640x480 */
2148 usb_exchange(gspca_dev, hv7131r_initVGA_data);
2149 }
2150 break;
2151 case SENSOR_OV7660:
2152 GammaT = ov7660_gamma;
2153 MatrixT = ov7660_matrix;
2154 if (mode) {
2155 /* 320x240 */
2156 usb_exchange(gspca_dev, ov7660_initQVGA_data);
2157 } else {
2158 /* 640x480 */
2159 usb_exchange(gspca_dev, ov7660_initVGA_data);
2160 }
2161 break;
2162 case SENSOR_OV7670:
2163 /*GammaT = ov7660_gamma; */
2164 /*MatrixT = ov7660_matrix; */
2165 if (mode) {
2166 /* 320x240 */
2167 usb_exchange(gspca_dev, ov7670_initQVGA_JPG);
2168 } else {
2169 /* 640x480 */
2170 usb_exchange(gspca_dev, ov7670_initVGA_JPG);
2171 }
2172 break;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002173 case SENSOR_MI0360:
2174 GammaT = mi1320_gamma;
2175 MatrixT = mi0360_matrix;
2176 if (mode) {
2177 /* 320x240 */
2178 usb_exchange(gspca_dev, mi0360_initQVGA_JPG);
2179 } else {
2180 /* 640x480 */
2181 usb_exchange(gspca_dev, mi0360_initVGA_JPG);
2182 }
2183 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002184 case SENSOR_MI1310_SOC:
2185 if (mode) {
2186 /* 320x240 */
2187 usb_exchange(gspca_dev, mi1310_socinitQVGA_JPG);
2188 } else {
2189 /* 640x480 */
2190 usb_exchange(gspca_dev, mi1310_socinitVGA_JPG);
2191 }
2192 break;
2193 case SENSOR_MI1320:
2194 GammaT = mi1320_gamma;
2195 MatrixT = mi1320_matrix;
2196 if (mode) {
2197 /* 320x240 */
2198 usb_exchange(gspca_dev, mi1320_initQVGA_data);
2199 } else {
2200 /* 640x480 */
2201 usb_exchange(gspca_dev, mi1320_initVGA_data);
2202 }
2203 break;
2204 case SENSOR_PO3130NC:
2205 GammaT = po3130_gamma;
2206 MatrixT = po3130_matrix;
2207 if (mode) {
2208 /* 320x240 */
2209 usb_exchange(gspca_dev, po3130_initQVGA_data);
2210 } else {
2211 /* 640x480 */
2212 usb_exchange(gspca_dev, po3130_initVGA_data);
2213 }
2214 usb_exchange(gspca_dev, po3130_rundata);
2215 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002216 case SENSOR_PO1200:
2217 GammaT = po1200_gamma;
2218 MatrixT = po1200_matrix;
2219 usb_exchange(gspca_dev, po1200_initVGA_data);
2220 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002221 default:
2222 PDEBUG(D_PROBE, "Damned !! no sensor found Bye");
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002223 return -EMEDIUMTYPE;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002224 }
2225 if (GammaT && MatrixT) {
2226 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
2227 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
2228 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
2229 put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
2230
2231 /* Seem SHARPNESS */
2232 /*
2233 reg_w(gspca_dev->dev, 0xa0, 0x80, 0xb80a);
2234 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb80b);
2235 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb80e);
2236 */
2237 /* all 0x40 ??? do nothing
2238 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb822);
2239 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb823);
2240 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb824);
2241 */
2242 /* Only works for HV7131R ??
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002243 reg_r (gspca_dev, 0xa1, 0xb881, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002244 reg_w(gspca_dev->dev, 0xa0, 0xfe01, 0xb881);
2245 reg_w(gspca_dev->dev, 0xa0, 0x79, 0xb801);
2246 */
2247 /* only hv7131r et ov7660
2248 reg_w(gspca_dev->dev, 0xa0, 0x20, 0xb827);
2249 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb826); * ISP_GAIN 80
2250 reg_w(gspca_dev->dev, 0xa0, 0x23, 0xb800); * ISP CTRL_BAS
2251 */
2252 /* set the led on 0x0892 0x0896 */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002253 if (sd->sensor != SENSOR_PO1200) {
2254 reg_w(gspca_dev->dev, 0x89, 0xffff, 0xfdff);
2255 msleep(100);
Jean-Francois Moine88521532008-12-10 05:06:13 -03002256 sethvflip(gspca_dev);
2257 setlightfreq(gspca_dev);
2258 } else {
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002259 setsharpness(gspca_dev);
2260 sethvflip(gspca_dev);
Jean-Francois Moine88521532008-12-10 05:06:13 -03002261 reg_w(gspca_dev->dev, 0x89, 0x0400, 0x1415);
2262 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002263 }
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002264 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002265}
2266
2267static void sd_stopN(struct gspca_dev *gspca_dev)
2268{
2269 struct usb_device *dev = gspca_dev->dev;
2270
2271 reg_w(dev, 0x89, 0xffff, 0xffff);
2272 reg_w(dev, 0xa0, 0x01, 0xb301);
2273 reg_w(dev, 0xa0, 0x09, 0xb003);
2274}
2275
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002276/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002277static void sd_stop0(struct gspca_dev *gspca_dev)
2278{
2279 struct usb_device *dev = gspca_dev->dev;
2280
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002281 if (!gspca_dev->present)
2282 return;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002283 reg_w(dev, 0x89, 0xffff, 0xffff);
2284}
2285
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002286static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2287 struct gspca_frame *frame, /* target */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002288 __u8 *data, /* isoc packet */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002289 int len) /* iso pkt length */
2290{
2291 struct sd *sd = (struct sd *) gspca_dev;
2292
2293 if (data[0] == 0xff && data[1] == 0xd8) {
2294 PDEBUG(D_PACK,
2295 "vc032x header packet found len %d", len);
2296 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
2297 data, 0);
2298 if (sd->bridge == BRIDGE_VC0321) {
2299#define VCHDRSZ 46
2300 data += VCHDRSZ;
2301 len -= VCHDRSZ;
2302#undef VCHDRSZ
2303 }
2304 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2305 data, len);
2306 return;
2307 }
Hans de Goeded473a002008-12-11 05:02:18 -03002308
2309 /* The vc0321 sends some additional data after sending the complete
2310 * frame, we ignore this. */
2311 if (sd->bridge == BRIDGE_VC0321
2312 && len > frame->v4l2_buf.length - (frame->data_end - frame->data))
2313 len = frame->v4l2_buf.length - (frame->data_end - frame->data);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002314 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
2315}
2316
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002317static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val)
2318{
2319 struct sd *sd = (struct sd *) gspca_dev;
2320
2321 sd->hflip = val;
2322 if (gspca_dev->streaming)
2323 sethvflip(gspca_dev);
2324 return 0;
2325}
2326
2327static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val)
2328{
2329 struct sd *sd = (struct sd *) gspca_dev;
2330
2331 *val = sd->hflip;
2332 return 0;
2333}
2334
2335static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val)
2336{
2337 struct sd *sd = (struct sd *) gspca_dev;
2338
2339 sd->vflip = val;
2340 if (gspca_dev->streaming)
2341 sethvflip(gspca_dev);
2342 return 0;
2343}
2344
2345static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val)
2346{
2347 struct sd *sd = (struct sd *) gspca_dev;
2348
2349 *val = sd->vflip;
2350 return 0;
2351}
2352
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002353static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
2354{
2355 struct sd *sd = (struct sd *) gspca_dev;
2356
2357 sd->lightfreq = val;
2358 if (gspca_dev->streaming)
2359 setlightfreq(gspca_dev);
2360 return 0;
2361}
2362
2363static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
2364{
2365 struct sd *sd = (struct sd *) gspca_dev;
2366
2367 *val = sd->lightfreq;
2368 return 0;
2369}
2370
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002371static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
2372{
2373 struct sd *sd = (struct sd *) gspca_dev;
2374
2375 sd->sharpness = val;
2376 if (gspca_dev->streaming)
2377 setsharpness(gspca_dev);
2378 return 0;
2379}
2380
2381static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
2382{
2383 struct sd *sd = (struct sd *) gspca_dev;
2384
2385 *val = sd->sharpness;
2386 return 0;
2387}
2388
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002389static int sd_querymenu(struct gspca_dev *gspca_dev,
2390 struct v4l2_querymenu *menu)
2391{
2392 switch (menu->id) {
2393 case V4L2_CID_POWER_LINE_FREQUENCY:
2394 switch (menu->index) {
2395 case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002396 strcpy((char *) menu->name, "NoFliker");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002397 return 0;
2398 case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002399 strcpy((char *) menu->name, "50 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002400 return 0;
2401 case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002402 strcpy((char *) menu->name, "60 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002403 return 0;
2404 }
2405 break;
2406 }
2407 return -EINVAL;
2408}
2409
2410/* sub-driver description */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002411static const struct sd_desc sd_desc = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002412 .name = MODULE_NAME,
2413 .ctrls = sd_ctrls,
2414 .nctrls = ARRAY_SIZE(sd_ctrls),
2415 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03002416 .init = sd_init,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002417 .start = sd_start,
2418 .stopN = sd_stopN,
2419 .stop0 = sd_stop0,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002420 .pkt_scan = sd_pkt_scan,
2421 .querymenu = sd_querymenu,
2422};
2423
2424/* -- module initialisation -- */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002425static const __devinitdata struct usb_device_id device_table[] = {
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002426 {USB_DEVICE(0x046d, 0x0892), .driver_info = BRIDGE_VC0321},
2427 {USB_DEVICE(0x046d, 0x0896), .driver_info = BRIDGE_VC0321},
Jean-Francois Moineda3bcb52008-12-29 09:06:09 -03002428 {USB_DEVICE(0x046d, 0x0897), .driver_info = BRIDGE_VC0321},
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002429 {USB_DEVICE(0x0ac8, 0x0321), .driver_info = BRIDGE_VC0321},
2430 {USB_DEVICE(0x0ac8, 0x0323), .driver_info = BRIDGE_VC0323},
2431 {USB_DEVICE(0x0ac8, 0x0328), .driver_info = BRIDGE_VC0321},
2432 {USB_DEVICE(0x0ac8, 0xc001), .driver_info = BRIDGE_VC0321},
2433 {USB_DEVICE(0x0ac8, 0xc002), .driver_info = BRIDGE_VC0321},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002434 {USB_DEVICE(0x15b8, 0x6002), .driver_info = BRIDGE_VC0323},
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002435 {USB_DEVICE(0x17ef, 0x4802), .driver_info = BRIDGE_VC0323},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002436 {}
2437};
2438MODULE_DEVICE_TABLE(usb, device_table);
2439
2440/* -- device connect -- */
2441static int sd_probe(struct usb_interface *intf,
2442 const struct usb_device_id *id)
2443{
2444 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2445 THIS_MODULE);
2446}
2447
2448static struct usb_driver sd_driver = {
2449 .name = MODULE_NAME,
2450 .id_table = device_table,
2451 .probe = sd_probe,
2452 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03002453#ifdef CONFIG_PM
2454 .suspend = gspca_suspend,
2455 .resume = gspca_resume,
2456#endif
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002457};
2458
2459/* -- module insert / remove -- */
2460static int __init sd_mod_init(void)
2461{
Alexey Klimovf69e9522009-01-01 13:02:07 -03002462 int ret;
2463 ret = usb_register(&sd_driver);
2464 if (ret < 0)
Alexey Klimove6b14842009-01-01 13:04:58 -03002465 return ret;
Jean-Francois Moine10b0e962008-07-22 05:35:10 -03002466 PDEBUG(D_PROBE, "registered");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002467 return 0;
2468}
2469static void __exit sd_mod_exit(void)
2470{
2471 usb_deregister(&sd_driver);
2472 PDEBUG(D_PROBE, "deregistered");
2473}
2474
2475module_init(sd_mod_init);
2476module_exit(sd_mod_exit);