blob: 71921c8784246c9eddb993daaf87eafbfd065a09 [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 Moine8b605f12009-07-27 06:28:37 -030035 u8 hflip;
36 u8 vflip;
37 u8 lightfreq;
38 u8 sharpness;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030039
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030040 u8 image_offset;
41
Jean-Francois Moine8b605f12009-07-27 06:28:37 -030042 u8 bridge;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030043#define BRIDGE_VC0321 0
44#define BRIDGE_VC0323 1
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -030045 u8 sensor;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030046#define SENSOR_HV7131R 0
Jean-Francois Moinecbb05542008-11-26 16:17:13 -030047#define SENSOR_MI0360 1
Jean-Francois Moinedb786a32009-03-23 06:03:52 -030048#define SENSOR_MI1310_SOC 2
49#define SENSOR_MI1320 3
50#define SENSOR_MI1320_SOC 4
51#define SENSOR_OV7660 5
52#define SENSOR_OV7670 6
53#define SENSOR_PO1200 7
54#define SENSOR_PO3130NC 8
Jean-Francois Moinee27188e2009-07-27 06:00:03 -030055 u8 flags;
56#define FL_SAMSUNG 0x01 /* SamsungQ1 (2 sensors) */
57#define FL_HFLIP 0x02 /* mirrored by default */
58#define FL_VFLIP 0x04 /* vertical flipped by default */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030059};
60
61/* V4L2 controls supported by the driver */
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030062static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val);
63static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val);
64static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val);
65static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030066static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
67static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine47a42b02008-12-13 07:45:34 -030068static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
69static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030070
71static struct ctrl sd_ctrls[] = {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -030072/* next 2 controls work with some sensors only */
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030073#define HFLIP_IDX 0
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030074 {
75 {
76 .id = V4L2_CID_HFLIP,
77 .type = V4L2_CTRL_TYPE_BOOLEAN,
78 .name = "Mirror",
79 .minimum = 0,
80 .maximum = 1,
81 .step = 1,
82#define HFLIP_DEF 0
83 .default_value = HFLIP_DEF,
84 },
85 .set = sd_sethflip,
86 .get = sd_gethflip,
87 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030088#define VFLIP_IDX 1
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030089 {
90 {
91 .id = V4L2_CID_VFLIP,
92 .type = V4L2_CTRL_TYPE_BOOLEAN,
93 .name = "Vflip",
94 .minimum = 0,
95 .maximum = 1,
96 .step = 1,
97#define VFLIP_DEF 0
98 .default_value = VFLIP_DEF,
99 },
100 .set = sd_setvflip,
101 .get = sd_getvflip,
102 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -0300103#define LIGHTFREQ_IDX 2
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300104 {
105 {
106 .id = V4L2_CID_POWER_LINE_FREQUENCY,
107 .type = V4L2_CTRL_TYPE_MENU,
108 .name = "Light frequency filter",
109 .minimum = 0,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300110 .maximum = 2, /* 0: No, 1: 50Hz, 2:60Hz */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300111 .step = 1,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300112#define FREQ_DEF 1
113 .default_value = FREQ_DEF,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300114 },
115 .set = sd_setfreq,
116 .get = sd_getfreq,
117 },
Jean-Francois Moine47a42b02008-12-13 07:45:34 -0300118/* po1200 only */
119#define SHARPNESS_IDX 3
120 {
121 {
122 .id = V4L2_CID_SHARPNESS,
123 .type = V4L2_CTRL_TYPE_INTEGER,
124 .name = "Sharpness",
125 .minimum = 0,
126 .maximum = 2,
127 .step = 1,
128#define SHARPNESS_DEF 1
129 .default_value = SHARPNESS_DEF,
130 },
131 .set = sd_setsharpness,
132 .get = sd_getsharpness,
133 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300134};
135
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300136static const struct v4l2_pix_format vc0321_mode[] = {
Jean-Francois Moine20122542008-09-03 17:12:20 -0300137 {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300138 .bytesperline = 320,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300139 .sizeimage = 320 * 240 * 2,
140 .colorspace = V4L2_COLORSPACE_SRGB,
141 .priv = 1},
Jean-Francois Moine20122542008-09-03 17:12:20 -0300142 {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300143 .bytesperline = 640,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300144 .sizeimage = 640 * 480 * 2,
145 .colorspace = V4L2_COLORSPACE_SRGB,
146 .priv = 0},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300147};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300148static const struct v4l2_pix_format vc0323_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300149 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
150 .bytesperline = 320,
151 .sizeimage = 320 * 240 * 3 / 8 + 590,
152 .colorspace = V4L2_COLORSPACE_JPEG,
153 .priv = 1},
154 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
155 .bytesperline = 640,
156 .sizeimage = 640 * 480 * 3 / 8 + 590,
157 .colorspace = V4L2_COLORSPACE_JPEG,
158 .priv = 0},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300159 {1280, 960, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300160 .bytesperline = 1280,
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300161 .sizeimage = 1280 * 960 * 3 / 8 + 590,
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300162 .colorspace = V4L2_COLORSPACE_JPEG,
163 .priv = 2},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300164};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300165static const struct v4l2_pix_format bi_mode[] = {
Jean-Francois Moine2c956102009-05-05 04:59:45 -0300166 {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300167 .bytesperline = 320,
168 .sizeimage = 320 * 240 * 2,
169 .colorspace = V4L2_COLORSPACE_SRGB,
Jean-Francois Moine51412aa2009-03-26 06:03:28 -0300170 .priv = 2},
Jean-Francois Moine2c956102009-05-05 04:59:45 -0300171 {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300172 .bytesperline = 640,
173 .sizeimage = 640 * 480 * 2,
174 .colorspace = V4L2_COLORSPACE_SRGB,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300175 .priv = 1},
Jean-Francois Moine2c956102009-05-05 04:59:45 -0300176 {1280, 1024, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300177 .bytesperline = 1280,
178 .sizeimage = 1280 * 1024 * 2,
179 .colorspace = V4L2_COLORSPACE_SRGB,
180 .priv = 0},
181};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300182static const struct v4l2_pix_format svga_mode[] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -0300183 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
184 .bytesperline = 800,
185 .sizeimage = 800 * 600 * 1 / 4 + 590,
186 .colorspace = V4L2_COLORSPACE_JPEG,
187 .priv = 0},
188};
189
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -0300190/* OV7660/7670 registers */
191#define OV7660_REG_MVFP 0x1e
192#define OV7660_MVFP_MIRROR 0x20
193#define OV7660_MVFP_VFLIP 0x10
194
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300195static const u8 mi0360_matrix[9] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300196 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
197};
198
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300199static const u8 mi0360_initVGA_JPG[][4] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300200 {0xb0, 0x03, 0x19, 0xcc},
201 {0xb0, 0x04, 0x02, 0xcc},
202 {0xb3, 0x00, 0x24, 0xcc},
203 {0xb3, 0x00, 0x25, 0xcc},
204 {0xb3, 0x08, 0x01, 0xcc},
205 {0xb3, 0x09, 0x0c, 0xcc},
206 {0xb3, 0x05, 0x01, 0xcc},
207 {0xb3, 0x06, 0x03, 0xcc},
208 {0xb3, 0x03, 0x0a, 0xcc},
209 {0xb3, 0x20, 0x00, 0xcc},
210 {0xb3, 0x21, 0x00, 0xcc},
211 {0xb3, 0x22, 0x01, 0xcc},
212 {0xb3, 0x23, 0xe0, 0xcc},
213 {0xb3, 0x04, 0x05, 0xcc},
214 {0xb3, 0x14, 0x00, 0xcc},
215 {0xb3, 0x15, 0x00, 0xcc},
216 {0xb3, 0x16, 0x02, 0xcc},
217 {0xb3, 0x17, 0x7f, 0xcc},
218 {0xb3, 0x35, 0xdd, 0xcc},
219 {0xb3, 0x34, 0x02, 0xcc},
220 {0xb3, 0x00, 0x25, 0xcc},
221 {0xbc, 0x00, 0x71, 0xcc},
222 {0xb8, 0x00, 0x13, 0xcc},
223 {0xb8, 0x27, 0x20, 0xcc},
224 {0xb8, 0x2c, 0x50, 0xcc},
225 {0xb8, 0x2d, 0xf8, 0xcc},
226 {0xb8, 0x2e, 0xf8, 0xcc},
227 {0xb8, 0x2f, 0xf8, 0xcc},
228 {0xb8, 0x30, 0x50, 0xcc},
229 {0xb8, 0x31, 0xf8, 0xcc},
230 {0xb8, 0x32, 0xf8, 0xcc},
231 {0xb8, 0x33, 0xf8, 0xcc},
232 {0xb8, 0x34, 0x50, 0xcc},
233 {0xb8, 0x35, 0x00, 0xcc},
234 {0xb8, 0x36, 0x00, 0xcc},
235 {0xb8, 0x37, 0x00, 0xcc},
236 {0xb8, 0x01, 0x79, 0xcc},
237 {0xb8, 0x08, 0xe0, 0xcc},
238 {0xb3, 0x01, 0x41, 0xcc},
239 {0xb8, 0x01, 0x79, 0xcc},
240 {0xb8, 0x14, 0x18, 0xcc},
241 {0xb8, 0xb2, 0x0a, 0xcc},
242 {0xb8, 0xb4, 0x0a, 0xcc},
243 {0xb8, 0xb5, 0x0a, 0xcc},
244 {0xb8, 0xfe, 0x00, 0xcc},
245 {0xb8, 0xff, 0x28, 0xcc},
246 {0xb9, 0x00, 0x28, 0xcc},
247 {0xb9, 0x01, 0x28, 0xcc},
248 {0xb9, 0x02, 0x28, 0xcc},
249 {0xb9, 0x03, 0x00, 0xcc},
250 {0xb9, 0x04, 0x00, 0xcc},
251 {0xb9, 0x05, 0x3c, 0xcc},
252 {0xb9, 0x06, 0x3c, 0xcc},
253 {0xb9, 0x07, 0x3c, 0xcc},
254 {0xb9, 0x08, 0x3c, 0xcc},
255 {0xb8, 0x8e, 0x00, 0xcc},
256 {0xb8, 0x8f, 0xff, 0xcc},
257 {0xb8, 0x81, 0x09, 0xcc},
258 {0x31, 0x00, 0x00, 0xbb},
259 {0x09, 0x01, 0xc7, 0xbb},
260 {0x34, 0x01, 0x00, 0xbb},
261 {0x2b, 0x00, 0x28, 0xbb},
262 {0x2c, 0x00, 0x30, 0xbb},
263 {0x2d, 0x00, 0x30, 0xbb},
264 {0x2e, 0x00, 0x28, 0xbb},
265 {0x62, 0x04, 0x11, 0xbb},
266 {0x03, 0x01, 0xe0, 0xbb},
267 {0x2c, 0x00, 0x2c, 0xbb},
268 {0x20, 0xd0, 0x00, 0xbb},
269 {0x01, 0x00, 0x08, 0xbb},
270 {0x06, 0x00, 0x10, 0xbb},
271 {0x05, 0x00, 0x20, 0xbb},
272 {0x20, 0x00, 0x00, 0xbb},
273 {0xb6, 0x00, 0x00, 0xcc},
274 {0xb6, 0x03, 0x02, 0xcc},
275 {0xb6, 0x02, 0x80, 0xcc},
276 {0xb6, 0x05, 0x01, 0xcc},
277 {0xb6, 0x04, 0xe0, 0xcc},
278 {0xb6, 0x12, 0x78, 0xcc},
279 {0xb6, 0x18, 0x02, 0xcc},
280 {0xb6, 0x17, 0x58, 0xcc},
281 {0xb6, 0x16, 0x00, 0xcc},
282 {0xb6, 0x22, 0x12, 0xcc},
283 {0xb6, 0x23, 0x0b, 0xcc},
284 {0xb3, 0x02, 0x02, 0xcc},
285 {0xbf, 0xc0, 0x39, 0xcc},
286 {0xbf, 0xc1, 0x04, 0xcc},
287 {0xbf, 0xcc, 0x10, 0xcc},
288 {0xb9, 0x12, 0x00, 0xcc},
289 {0xb9, 0x13, 0x0a, 0xcc},
290 {0xb9, 0x14, 0x0a, 0xcc},
291 {0xb9, 0x15, 0x0a, 0xcc},
292 {0xb9, 0x16, 0x0a, 0xcc},
293 {0xb9, 0x18, 0x00, 0xcc},
294 {0xb9, 0x19, 0x0f, 0xcc},
295 {0xb9, 0x1a, 0x0f, 0xcc},
296 {0xb9, 0x1b, 0x0f, 0xcc},
297 {0xb9, 0x1c, 0x0f, 0xcc},
298 {0xb8, 0x8e, 0x00, 0xcc},
299 {0xb8, 0x8f, 0xff, 0xcc},
300 {0xb6, 0x12, 0xf8, 0xcc},
301 {0xb8, 0x0c, 0x20, 0xcc},
302 {0xb8, 0x0d, 0x70, 0xcc},
303 {0xb6, 0x13, 0x13, 0xcc},
304 {0x35, 0x00, 0x60, 0xbb},
305 {0xb3, 0x5c, 0x01, 0xcc},
306 {}
307};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300308static const u8 mi0360_initQVGA_JPG[][4] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300309 {0xb0, 0x03, 0x19, 0xcc},
310 {0xb0, 0x04, 0x02, 0xcc},
311 {0xb3, 0x00, 0x24, 0xcc},
312 {0xb3, 0x00, 0x25, 0xcc},
313 {0xb3, 0x08, 0x01, 0xcc},
314 {0xb3, 0x09, 0x0c, 0xcc},
315 {0xb3, 0x05, 0x01, 0xcc},
316 {0xb3, 0x06, 0x03, 0xcc},
317 {0xb3, 0x03, 0x0a, 0xcc},
318 {0xb3, 0x20, 0x00, 0xcc},
319 {0xb3, 0x21, 0x00, 0xcc},
320 {0xb3, 0x22, 0x01, 0xcc},
321 {0xb3, 0x23, 0xe0, 0xcc},
322 {0xb3, 0x04, 0x05, 0xcc},
323 {0xb3, 0x14, 0x00, 0xcc},
324 {0xb3, 0x15, 0x00, 0xcc},
325 {0xb3, 0x16, 0x02, 0xcc},
326 {0xb3, 0x17, 0x7f, 0xcc},
327 {0xb3, 0x35, 0xdd, 0xcc},
328 {0xb3, 0x34, 0x02, 0xcc},
329 {0xb3, 0x00, 0x25, 0xcc},
330 {0xbc, 0x00, 0xd1, 0xcc},
331 {0xb8, 0x00, 0x13, 0xcc},
332 {0xb8, 0x27, 0x20, 0xcc},
333 {0xb8, 0x2c, 0x50, 0xcc},
334 {0xb8, 0x2d, 0xf8, 0xcc},
335 {0xb8, 0x2e, 0xf8, 0xcc},
336 {0xb8, 0x2f, 0xf8, 0xcc},
337 {0xb8, 0x30, 0x50, 0xcc},
338 {0xb8, 0x31, 0xf8, 0xcc},
339 {0xb8, 0x32, 0xf8, 0xcc},
340 {0xb8, 0x33, 0xf8, 0xcc},
341 {0xb8, 0x34, 0x50, 0xcc},
342 {0xb8, 0x35, 0x00, 0xcc},
343 {0xb8, 0x36, 0x00, 0xcc},
344 {0xb8, 0x37, 0x00, 0xcc},
345 {0xb8, 0x01, 0x79, 0xcc},
346 {0xb8, 0x08, 0xe0, 0xcc},
347 {0xb3, 0x01, 0x41, 0xcc},
348 {0xb8, 0x01, 0x79, 0xcc},
349 {0xb8, 0x14, 0x18, 0xcc},
350 {0xb8, 0xb2, 0x0a, 0xcc},
351 {0xb8, 0xb4, 0x0a, 0xcc},
352 {0xb8, 0xb5, 0x0a, 0xcc},
353 {0xb8, 0xfe, 0x00, 0xcc},
354 {0xb8, 0xff, 0x28, 0xcc},
355 {0xb9, 0x00, 0x28, 0xcc},
356 {0xb9, 0x01, 0x28, 0xcc},
357 {0xb9, 0x02, 0x28, 0xcc},
358 {0xb9, 0x03, 0x00, 0xcc},
359 {0xb9, 0x04, 0x00, 0xcc},
360 {0xb9, 0x05, 0x3c, 0xcc},
361 {0xb9, 0x06, 0x3c, 0xcc},
362 {0xb9, 0x07, 0x3c, 0xcc},
363 {0xb9, 0x08, 0x3c, 0xcc},
364 {0xb8, 0x8e, 0x00, 0xcc},
365 {0xb8, 0x8f, 0xff, 0xcc},
366 {0xb8, 0x81, 0x09, 0xcc},
367 {0x31, 0x00, 0x00, 0xbb},
368 {0x09, 0x01, 0xc7, 0xbb},
369 {0x34, 0x01, 0x00, 0xbb},
370 {0x2b, 0x00, 0x28, 0xbb},
371 {0x2c, 0x00, 0x30, 0xbb},
372 {0x2d, 0x00, 0x30, 0xbb},
373 {0x2e, 0x00, 0x28, 0xbb},
374 {0x62, 0x04, 0x11, 0xbb},
375 {0x03, 0x01, 0xe0, 0xbb},
376 {0x2c, 0x00, 0x2c, 0xbb},
377 {0x20, 0xd0, 0x00, 0xbb},
378 {0x01, 0x00, 0x08, 0xbb},
379 {0x06, 0x00, 0x10, 0xbb},
380 {0x05, 0x00, 0x20, 0xbb},
381 {0x20, 0x00, 0x00, 0xbb},
382 {0xb6, 0x00, 0x00, 0xcc},
383 {0xb6, 0x03, 0x01, 0xcc},
384 {0xb6, 0x02, 0x40, 0xcc},
385 {0xb6, 0x05, 0x00, 0xcc},
386 {0xb6, 0x04, 0xf0, 0xcc},
387 {0xb6, 0x12, 0x78, 0xcc},
388 {0xb6, 0x18, 0x00, 0xcc},
389 {0xb6, 0x17, 0x96, 0xcc},
390 {0xb6, 0x16, 0x00, 0xcc},
391 {0xb6, 0x22, 0x12, 0xcc},
392 {0xb6, 0x23, 0x0b, 0xcc},
393 {0xb3, 0x02, 0x02, 0xcc},
394 {0xbf, 0xc0, 0x39, 0xcc},
395 {0xbf, 0xc1, 0x04, 0xcc},
396 {0xbf, 0xcc, 0x10, 0xcc},
397 {0xb9, 0x12, 0x00, 0xcc},
398 {0xb9, 0x13, 0x0a, 0xcc},
399 {0xb9, 0x14, 0x0a, 0xcc},
400 {0xb9, 0x15, 0x0a, 0xcc},
401 {0xb9, 0x16, 0x0a, 0xcc},
402 {0xb9, 0x18, 0x00, 0xcc},
403 {0xb9, 0x19, 0x0f, 0xcc},
404 {0xb9, 0x1a, 0x0f, 0xcc},
405 {0xb9, 0x1b, 0x0f, 0xcc},
406 {0xb9, 0x1c, 0x0f, 0xcc},
407 {0xb8, 0x8e, 0x00, 0xcc},
408 {0xb8, 0x8f, 0xff, 0xcc},
409 {0xb6, 0x12, 0xf8, 0xcc},
410 {0xb6, 0x13, 0x13, 0xcc},
411 {0xbc, 0x02, 0x18, 0xcc},
412 {0xbc, 0x03, 0x50, 0xcc},
413 {0xbc, 0x04, 0x18, 0xcc},
414 {0xbc, 0x05, 0x00, 0xcc},
415 {0xbc, 0x06, 0x00, 0xcc},
416 {0xbc, 0x08, 0x30, 0xcc},
417 {0xbc, 0x09, 0x40, 0xcc},
418 {0xbc, 0x0a, 0x10, 0xcc},
419 {0xb8, 0x0c, 0x20, 0xcc},
420 {0xb8, 0x0d, 0x70, 0xcc},
421 {0xbc, 0x0b, 0x00, 0xcc},
422 {0xbc, 0x0c, 0x00, 0xcc},
423 {0x35, 0x00, 0xef, 0xbb},
424 {0xb3, 0x5c, 0x01, 0xcc},
425 {}
426};
427
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300428static const u8 mi1310_socinitVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300429 {0xb0, 0x03, 0x19, 0xcc},
430 {0xb0, 0x04, 0x02, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300431 {0xb3, 0x00, 0x64, 0xcc},
432 {0xb3, 0x00, 0x65, 0xcc},
433 {0xb3, 0x05, 0x00, 0xcc},
434 {0xb3, 0x06, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300435 {0xb3, 0x08, 0x01, 0xcc},
436 {0xb3, 0x09, 0x0c, 0xcc},
437 {0xb3, 0x34, 0x02, 0xcc},
438 {0xb3, 0x35, 0xdd, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300439 {0xb3, 0x02, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300440 {0xb3, 0x03, 0x0a, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300441 {0xb3, 0x04, 0x05, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300442 {0xb3, 0x20, 0x00, 0xcc},
443 {0xb3, 0x21, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300444 {0xb3, 0x22, 0x03, 0xcc},
445 {0xb3, 0x23, 0xc0, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300446 {0xb3, 0x14, 0x00, 0xcc},
447 {0xb3, 0x15, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300448 {0xb3, 0x16, 0x04, 0xcc},
449 {0xb3, 0x17, 0xff, 0xcc},
450 {0xb3, 0x00, 0x65, 0xcc},
451 {0xb8, 0x00, 0x00, 0xcc},
452 {0xbc, 0x00, 0xd0, 0xcc},
453 {0xbc, 0x01, 0x01, 0xcc},
454 {0xf0, 0x00, 0x02, 0xbb},
455 {0xc8, 0x9f, 0x0b, 0xbb},
456 {0x5b, 0x00, 0x01, 0xbb},
457 {0x2f, 0xde, 0x20, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300458 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300459 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300460 {0xf0, 0x00, 0x01, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300461 {0x05, 0x00, 0x07, 0xbb},
462 {0x34, 0x00, 0x00, 0xbb},
463 {0x35, 0xff, 0x00, 0xbb},
464 {0xdc, 0x07, 0x02, 0xbb},
465 {0xdd, 0x3c, 0x18, 0xbb},
466 {0xde, 0x92, 0x6d, 0xbb},
467 {0xdf, 0xcd, 0xb1, 0xbb},
468 {0xe0, 0xff, 0xe7, 0xbb},
469 {0x06, 0xf0, 0x0d, 0xbb},
470 {0x06, 0x70, 0x0e, 0xbb},
471 {0x4c, 0x00, 0x01, 0xbb},
472 {0x4d, 0x00, 0x01, 0xbb},
473 {0xf0, 0x00, 0x02, 0xbb},
474 {0x2e, 0x0c, 0x55, 0xbb},
475 {0x21, 0xb6, 0x6e, 0xbb},
476 {0x36, 0x30, 0x10, 0xbb},
477 {0x37, 0x00, 0xc1, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300478 {0xf0, 0x00, 0x00, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300479 {0x07, 0x00, 0x84, 0xbb},
480 {0x08, 0x02, 0x4a, 0xbb},
481 {0x05, 0x01, 0x10, 0xbb},
482 {0x06, 0x00, 0x39, 0xbb},
483 {0xf0, 0x00, 0x02, 0xbb},
484 {0x58, 0x02, 0x67, 0xbb},
485 {0x57, 0x02, 0x00, 0xbb},
486 {0x5a, 0x02, 0x67, 0xbb},
487 {0x59, 0x02, 0x00, 0xbb},
488 {0x5c, 0x12, 0x0d, 0xbb},
489 {0x5d, 0x16, 0x11, 0xbb},
490 {0x39, 0x06, 0x18, 0xbb},
491 {0x3a, 0x06, 0x18, 0xbb},
492 {0x3b, 0x06, 0x18, 0xbb},
493 {0x3c, 0x06, 0x18, 0xbb},
494 {0x64, 0x7b, 0x5b, 0xbb},
495 {0xf0, 0x00, 0x02, 0xbb},
496 {0x36, 0x30, 0x10, 0xbb},
497 {0x37, 0x00, 0xc0, 0xbb},
498 {0xbc, 0x0e, 0x00, 0xcc},
499 {0xbc, 0x0f, 0x05, 0xcc},
500 {0xbc, 0x10, 0xc0, 0xcc},
501 {0xbc, 0x11, 0x03, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300502 {0xb6, 0x00, 0x00, 0xcc},
503 {0xb6, 0x03, 0x02, 0xcc},
504 {0xb6, 0x02, 0x80, 0xcc},
505 {0xb6, 0x05, 0x01, 0xcc},
506 {0xb6, 0x04, 0xe0, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300507 {0xb6, 0x12, 0xf8, 0xcc},
508 {0xb6, 0x13, 0x25, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300509 {0xb6, 0x18, 0x02, 0xcc},
510 {0xb6, 0x17, 0x58, 0xcc},
511 {0xb6, 0x16, 0x00, 0xcc},
512 {0xb6, 0x22, 0x12, 0xcc},
513 {0xb6, 0x23, 0x0b, 0xcc},
514 {0xbf, 0xc0, 0x39, 0xcc},
515 {0xbf, 0xc1, 0x04, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300516 {0xbf, 0xcc, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300517 {0xbc, 0x02, 0x18, 0xcc},
518 {0xbc, 0x03, 0x50, 0xcc},
519 {0xbc, 0x04, 0x18, 0xcc},
520 {0xbc, 0x05, 0x00, 0xcc},
521 {0xbc, 0x06, 0x00, 0xcc},
522 {0xbc, 0x08, 0x30, 0xcc},
523 {0xbc, 0x09, 0x40, 0xcc},
524 {0xbc, 0x0a, 0x10, 0xcc},
525 {0xbc, 0x0b, 0x00, 0xcc},
526 {0xbc, 0x0c, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300527 {0xb3, 0x5c, 0x01, 0xcc},
528 {0xf0, 0x00, 0x01, 0xbb},
529 {0x80, 0x00, 0x03, 0xbb},
530 {0x81, 0xc7, 0x14, 0xbb},
531 {0x82, 0xeb, 0xe8, 0xbb},
532 {0x83, 0xfe, 0xf4, 0xbb},
533 {0x84, 0xcd, 0x10, 0xbb},
534 {0x85, 0xf3, 0xee, 0xbb},
535 {0x86, 0xff, 0xf1, 0xbb},
536 {0x87, 0xcd, 0x10, 0xbb},
537 {0x88, 0xf3, 0xee, 0xbb},
538 {0x89, 0x01, 0xf1, 0xbb},
539 {0x8a, 0xe5, 0x17, 0xbb},
540 {0x8b, 0xe8, 0xe2, 0xbb},
541 {0x8c, 0xf7, 0xed, 0xbb},
542 {0x8d, 0x00, 0xff, 0xbb},
543 {0x8e, 0xec, 0x10, 0xbb},
544 {0x8f, 0xf0, 0xed, 0xbb},
545 {0x90, 0xf9, 0xf2, 0xbb},
546 {0x91, 0x00, 0x00, 0xbb},
547 {0x92, 0xe9, 0x0d, 0xbb},
548 {0x93, 0xf4, 0xf2, 0xbb},
549 {0x94, 0xfb, 0xf5, 0xbb},
550 {0x95, 0x00, 0xff, 0xbb},
551 {0xb6, 0x0f, 0x08, 0xbb},
552 {0xb7, 0x3d, 0x16, 0xbb},
553 {0xb8, 0x0c, 0x04, 0xbb},
554 {0xb9, 0x1c, 0x07, 0xbb},
555 {0xba, 0x0a, 0x03, 0xbb},
556 {0xbb, 0x1b, 0x09, 0xbb},
557 {0xbc, 0x17, 0x0d, 0xbb},
558 {0xbd, 0x23, 0x1d, 0xbb},
559 {0xbe, 0x00, 0x28, 0xbb},
560 {0xbf, 0x11, 0x09, 0xbb},
561 {0xc0, 0x16, 0x15, 0xbb},
562 {0xc1, 0x00, 0x1b, 0xbb},
563 {0xc2, 0x0e, 0x07, 0xbb},
564 {0xc3, 0x14, 0x10, 0xbb},
565 {0xc4, 0x00, 0x17, 0xbb},
566 {0x06, 0x74, 0x8e, 0xbb},
567 {0xf0, 0x00, 0x01, 0xbb},
568 {0x06, 0xf4, 0x8e, 0xbb},
569 {0x00, 0x00, 0x50, 0xdd},
570 {0x06, 0x74, 0x8e, 0xbb},
571 {0xf0, 0x00, 0x02, 0xbb},
572 {0x24, 0x50, 0x20, 0xbb},
573 {0xf0, 0x00, 0x02, 0xbb},
574 {0x34, 0x0c, 0x50, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300575 {0xb3, 0x01, 0x41, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300576 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300577 {0x03, 0x03, 0xc0, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300578 {},
579};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300580static const u8 mi1310_socinitQVGA_JPG[][4] = {
AceLan Kao4041f6b2009-07-27 05:43:55 -0300581 {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc},
582 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
583 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc},
584 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
585 {0xb3, 0x34, 0x02, 0xcc}, {0xb3, 0x35, 0xdd, 0xcc},
586 {0xb3, 0x02, 0x00, 0xcc}, {0xb3, 0x03, 0x0a, 0xcc},
587 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
588 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x03, 0xcc},
589 {0xb3, 0x23, 0xc0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
590 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x04, 0xcc},
591 {0xb3, 0x17, 0xff, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
592 {0xb8, 0x00, 0x00, 0xcc}, {0xbc, 0x00, 0xf0, 0xcc},
593 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x02, 0xbb},
594 {0xc8, 0x9f, 0x0b, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
595 {0x2f, 0xde, 0x20, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300596 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
597 {0xf0, 0x00, 0x01, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300598 {0x05, 0x00, 0x07, 0xbb}, {0x34, 0x00, 0x00, 0xbb},
599 {0x35, 0xff, 0x00, 0xbb}, {0xdc, 0x07, 0x02, 0xbb},
600 {0xdd, 0x3c, 0x18, 0xbb}, {0xde, 0x92, 0x6d, 0xbb},
601 {0xdf, 0xcd, 0xb1, 0xbb}, {0xe0, 0xff, 0xe7, 0xbb},
602 {0x06, 0xf0, 0x0d, 0xbb}, {0x06, 0x70, 0x0e, 0xbb},
603 {0x4c, 0x00, 0x01, 0xbb}, {0x4d, 0x00, 0x01, 0xbb},
604 {0xf0, 0x00, 0x02, 0xbb}, {0x2e, 0x0c, 0x55, 0xbb},
605 {0x21, 0xb6, 0x6e, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
606 {0x37, 0x00, 0xc1, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
607 {0x07, 0x00, 0x84, 0xbb}, {0x08, 0x02, 0x4a, 0xbb},
608 {0x05, 0x01, 0x10, 0xbb}, {0x06, 0x00, 0x39, 0xbb},
609 {0xf0, 0x00, 0x02, 0xbb}, {0x58, 0x02, 0x67, 0xbb},
610 {0x57, 0x02, 0x00, 0xbb}, {0x5a, 0x02, 0x67, 0xbb},
611 {0x59, 0x02, 0x00, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
612 {0x5d, 0x16, 0x11, 0xbb}, {0x39, 0x06, 0x18, 0xbb},
613 {0x3a, 0x06, 0x18, 0xbb}, {0x3b, 0x06, 0x18, 0xbb},
614 {0x3c, 0x06, 0x18, 0xbb}, {0x64, 0x7b, 0x5b, 0xbb},
615 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
616 {0x37, 0x00, 0xc0, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
617 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
618 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
619 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
620 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
621 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x25, 0xcc},
622 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
623 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
624 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
625 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
626 {0xb3, 0x5c, 0x01, 0xcc}, {0xf0, 0x00, 0x01, 0xbb},
627 {0x80, 0x00, 0x03, 0xbb}, {0x81, 0xc7, 0x14, 0xbb},
628 {0x82, 0xeb, 0xe8, 0xbb}, {0x83, 0xfe, 0xf4, 0xbb},
629 {0x84, 0xcd, 0x10, 0xbb}, {0x85, 0xf3, 0xee, 0xbb},
630 {0x86, 0xff, 0xf1, 0xbb}, {0x87, 0xcd, 0x10, 0xbb},
631 {0x88, 0xf3, 0xee, 0xbb}, {0x89, 0x01, 0xf1, 0xbb},
632 {0x8a, 0xe5, 0x17, 0xbb}, {0x8b, 0xe8, 0xe2, 0xbb},
633 {0x8c, 0xf7, 0xed, 0xbb}, {0x8d, 0x00, 0xff, 0xbb},
634 {0x8e, 0xec, 0x10, 0xbb}, {0x8f, 0xf0, 0xed, 0xbb},
635 {0x90, 0xf9, 0xf2, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
636 {0x92, 0xe9, 0x0d, 0xbb}, {0x93, 0xf4, 0xf2, 0xbb},
637 {0x94, 0xfb, 0xf5, 0xbb}, {0x95, 0x00, 0xff, 0xbb},
638 {0xb6, 0x0f, 0x08, 0xbb}, {0xb7, 0x3d, 0x16, 0xbb},
639 {0xb8, 0x0c, 0x04, 0xbb}, {0xb9, 0x1c, 0x07, 0xbb},
640 {0xba, 0x0a, 0x03, 0xbb}, {0xbb, 0x1b, 0x09, 0xbb},
641 {0xbc, 0x17, 0x0d, 0xbb}, {0xbd, 0x23, 0x1d, 0xbb},
642 {0xbe, 0x00, 0x28, 0xbb}, {0xbf, 0x11, 0x09, 0xbb},
643 {0xc0, 0x16, 0x15, 0xbb}, {0xc1, 0x00, 0x1b, 0xbb},
644 {0xc2, 0x0e, 0x07, 0xbb}, {0xc3, 0x14, 0x10, 0xbb},
645 {0xc4, 0x00, 0x17, 0xbb}, {0x06, 0x74, 0x8e, 0xbb},
646 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0xf4, 0x8e, 0xbb},
647 {0x00, 0x00, 0x50, 0xdd}, {0x06, 0x74, 0x8e, 0xbb},
648 {0xf0, 0x00, 0x02, 0xbb}, {0x24, 0x50, 0x20, 0xbb},
649 {0xf0, 0x00, 0x02, 0xbb}, {0x34, 0x0c, 0x50, 0xbb},
650 {0xb3, 0x01, 0x41, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
651 {0x03, 0x03, 0xc0, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300652 {},
653};
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300654static const u8 mi1310_soc_InitSXGA_JPG[][4] = {
655 {0xb0, 0x03, 0x19, 0xcc},
656 {0xb0, 0x04, 0x02, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300657 {0xb3, 0x00, 0x64, 0xcc},
658 {0xb3, 0x00, 0x65, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300659 {0xb3, 0x05, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300660 {0xb3, 0x06, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300661 {0xb3, 0x08, 0x01, 0xcc},
662 {0xb3, 0x09, 0x0c, 0xcc},
663 {0xb3, 0x34, 0x02, 0xcc},
664 {0xb3, 0x35, 0xdd, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300665 {0xb3, 0x02, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300666 {0xb3, 0x03, 0x0a, 0xcc},
667 {0xb3, 0x04, 0x0d, 0xcc},
668 {0xb3, 0x20, 0x00, 0xcc},
669 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300670 {0xb3, 0x22, 0x03, 0xcc},
671 {0xb3, 0x23, 0xc0, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300672 {0xb3, 0x14, 0x00, 0xcc},
673 {0xb3, 0x15, 0x00, 0xcc},
674 {0xb3, 0x16, 0x04, 0xcc},
675 {0xb3, 0x17, 0xff, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300676 {0xb3, 0x00, 0x65, 0xcc},
677 {0xb8, 0x00, 0x00, 0xcc},
678 {0xbc, 0x00, 0x70, 0xcc},
679 {0xbc, 0x01, 0x01, 0xcc},
680 {0xf0, 0x00, 0x02, 0xbb},
681 {0xc8, 0x9f, 0x0b, 0xbb},
682 {0x5b, 0x00, 0x01, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300683 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300684 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300685 {0xf0, 0x00, 0x01, 0xbb},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300686 {0x05, 0x00, 0x07, 0xbb},
687 {0x34, 0x00, 0x00, 0xbb},
688 {0x35, 0xff, 0x00, 0xbb},
689 {0xdc, 0x07, 0x02, 0xbb},
690 {0xdd, 0x3c, 0x18, 0xbb},
691 {0xde, 0x92, 0x6d, 0xbb},
692 {0xdf, 0xcd, 0xb1, 0xbb},
693 {0xe0, 0xff, 0xe7, 0xbb},
694 {0x06, 0xf0, 0x0d, 0xbb},
695 {0x06, 0x70, 0x0e, 0xbb},
696 {0x4c, 0x00, 0x01, 0xbb},
697 {0x4d, 0x00, 0x01, 0xbb},
698 {0xf0, 0x00, 0x02, 0xbb},
699 {0x2e, 0x0c, 0x60, 0xbb},
700 {0x21, 0xb6, 0x6e, 0xbb},
701 {0x37, 0x01, 0x40, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300702 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300703 {0x07, 0x00, 0x84, 0xbb},
704 {0x08, 0x02, 0x4a, 0xbb},
705 {0x05, 0x01, 0x10, 0xbb},
706 {0x06, 0x00, 0x39, 0xbb},
707 {0xf0, 0x00, 0x02, 0xbb},
708 {0x58, 0x02, 0x67, 0xbb},
709 {0x57, 0x02, 0x00, 0xbb},
710 {0x5a, 0x02, 0x67, 0xbb},
711 {0x59, 0x02, 0x00, 0xbb},
712 {0x5c, 0x12, 0x0d, 0xbb},
713 {0x5d, 0x16, 0x11, 0xbb},
714 {0x39, 0x06, 0x18, 0xbb},
715 {0x3a, 0x06, 0x18, 0xbb},
716 {0x3b, 0x06, 0x18, 0xbb},
717 {0x3c, 0x06, 0x18, 0xbb},
718 {0x64, 0x7b, 0x5b, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300719 {0xb6, 0x00, 0x00, 0xcc},
720 {0xb6, 0x03, 0x05, 0xcc},
721 {0xb6, 0x02, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300722 {0xb6, 0x05, 0x03, 0xcc},
723 {0xb6, 0x04, 0xc0, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300724 {0xb6, 0x12, 0xf8, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300725 {0xb6, 0x13, 0x29, 0xcc},
726 {0xb6, 0x18, 0x09, 0xcc},
727 {0xb6, 0x17, 0x60, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300728 {0xb6, 0x16, 0x00, 0xcc},
729 {0xb6, 0x22, 0x12, 0xcc},
730 {0xb6, 0x23, 0x0b, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300731 {0xbf, 0xc0, 0x39, 0xcc},
732 {0xbf, 0xc1, 0x04, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300733 {0xbf, 0xcc, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300734 {0xb3, 0x01, 0x41, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300735 {0x00, 0x00, 0x80, 0xdd},
736 {0xf0, 0x00, 0x02, 0xbb},
737 {0x00, 0x00, 0x10, 0xdd},
738 {0x22, 0xa0, 0x78, 0xbb},
739 {0x23, 0xa0, 0x78, 0xbb},
740 {0x24, 0x7f, 0x00, 0xbb},
741 {0x28, 0xea, 0x02, 0xbb},
742 {0x29, 0x86, 0x7a, 0xbb},
743 {0x5e, 0x52, 0x4c, 0xbb},
744 {0x5f, 0x20, 0x24, 0xbb},
745 {0x60, 0x00, 0x02, 0xbb},
746 {0x02, 0x00, 0xee, 0xbb},
747 {0x03, 0x39, 0x23, 0xbb},
748 {0x04, 0x07, 0x24, 0xbb},
749 {0x09, 0x00, 0xc0, 0xbb},
750 {0x0a, 0x00, 0x79, 0xbb},
751 {0x0b, 0x00, 0x04, 0xbb},
752 {0x0c, 0x00, 0x5c, 0xbb},
753 {0x0d, 0x00, 0xd9, 0xbb},
754 {0x0e, 0x00, 0x53, 0xbb},
755 {0x0f, 0x00, 0x21, 0xbb},
756 {0x10, 0x00, 0xa4, 0xbb},
757 {0x11, 0x00, 0xe5, 0xbb},
758 {0x15, 0x00, 0x00, 0xbb},
759 {0x16, 0x00, 0x00, 0xbb},
760 {0x17, 0x00, 0x00, 0xbb},
761 {0x18, 0x00, 0x00, 0xbb},
762 {0x19, 0x00, 0x00, 0xbb},
763 {0x1a, 0x00, 0x00, 0xbb},
764 {0x1b, 0x00, 0x00, 0xbb},
765 {0x1c, 0x00, 0x00, 0xbb},
766 {0x1d, 0x00, 0x00, 0xbb},
767 {0x1e, 0x00, 0x00, 0xbb},
768 {0xf0, 0x00, 0x01, 0xbb},
769 {0x00, 0x00, 0x20, 0xdd},
770 {0x06, 0xf0, 0x8e, 0xbb},
771 {0x00, 0x00, 0x80, 0xdd},
772 {0x06, 0x70, 0x8e, 0xbb},
773 {0xf0, 0x00, 0x02, 0xbb},
774 {0x00, 0x00, 0x20, 0xdd},
775 {0x5e, 0x6a, 0x53, 0xbb},
776 {0x5f, 0x40, 0x2c, 0xbb},
777 {0xf0, 0x00, 0x01, 0xbb},
778 {0x00, 0x00, 0x20, 0xdd},
779 {0x58, 0x00, 0x00, 0xbb},
780 {0x53, 0x09, 0x03, 0xbb},
781 {0x54, 0x31, 0x18, 0xbb},
782 {0x55, 0x8b, 0x5f, 0xbb},
783 {0x56, 0xc0, 0xa9, 0xbb},
784 {0x57, 0xe0, 0xd2, 0xbb},
785 {0xe1, 0x00, 0x00, 0xbb},
786 {0xdc, 0x09, 0x03, 0xbb},
787 {0xdd, 0x31, 0x18, 0xbb},
788 {0xde, 0x8b, 0x5f, 0xbb},
789 {0xdf, 0xc0, 0xa9, 0xbb},
790 {0xe0, 0xe0, 0xd2, 0xbb},
791 {0xb3, 0x5c, 0x01, 0xcc},
792 {0xf0, 0x00, 0x01, 0xbb},
793 {0x06, 0xf0, 0x8e, 0xbb},
794 {0xf0, 0x00, 0x02, 0xbb},
795 {0x2f, 0xde, 0x20, 0xbb},
796 {0xf0, 0x00, 0x02, 0xbb},
797 {0x24, 0x50, 0x20, 0xbb},
798 {0xbc, 0x0e, 0x00, 0xcc},
799 {0xbc, 0x0f, 0x05, 0xcc},
800 {0xbc, 0x10, 0xc0, 0xcc},
801 {0xf0, 0x00, 0x02, 0xbb},
802 {0x34, 0x0c, 0x50, 0xbb},
803 {0xbc, 0x11, 0x03, 0xcc},
804 {0xf0, 0x00, 0x01, 0xbb},
805 {0x80, 0x00, 0x03, 0xbb},
806 {0x81, 0xc7, 0x14, 0xbb},
807 {0x82, 0xeb, 0xe8, 0xbb},
808 {0x83, 0xfe, 0xf4, 0xbb},
809 {0x84, 0xcd, 0x10, 0xbb},
810 {0x85, 0xf3, 0xee, 0xbb},
811 {0x86, 0xff, 0xf1, 0xbb},
812 {0x87, 0xcd, 0x10, 0xbb},
813 {0x88, 0xf3, 0xee, 0xbb},
814 {0x89, 0x01, 0xf1, 0xbb},
815 {0x8a, 0xe5, 0x17, 0xbb},
816 {0x8b, 0xe8, 0xe2, 0xbb},
817 {0x8c, 0xf7, 0xed, 0xbb},
818 {0x8d, 0x00, 0xff, 0xbb},
819 {0x8e, 0xec, 0x10, 0xbb},
820 {0x8f, 0xf0, 0xed, 0xbb},
821 {0x90, 0xf9, 0xf2, 0xbb},
822 {0x91, 0x00, 0x00, 0xbb},
823 {0x92, 0xe9, 0x0d, 0xbb},
824 {0x93, 0xf4, 0xf2, 0xbb},
825 {0x94, 0xfb, 0xf5, 0xbb},
826 {0x95, 0x00, 0xff, 0xbb},
827 {0xb6, 0x0f, 0x08, 0xbb},
828 {0xb7, 0x3d, 0x16, 0xbb},
829 {0xb8, 0x0c, 0x04, 0xbb},
830 {0xb9, 0x1c, 0x07, 0xbb},
831 {0xba, 0x0a, 0x03, 0xbb},
832 {0xbb, 0x1b, 0x09, 0xbb},
833 {0xbc, 0x17, 0x0d, 0xbb},
834 {0xbd, 0x23, 0x1d, 0xbb},
835 {0xbe, 0x00, 0x28, 0xbb},
836 {0xbf, 0x11, 0x09, 0xbb},
837 {0xc0, 0x16, 0x15, 0xbb},
838 {0xc1, 0x00, 0x1b, 0xbb},
839 {0xc2, 0x0e, 0x07, 0xbb},
840 {0xc3, 0x14, 0x10, 0xbb},
841 {0xc4, 0x00, 0x17, 0xbb},
842 {0x06, 0x74, 0x8e, 0xbb},
843 {0xf0, 0x00, 0x00, 0xbb},
844 {0x03, 0x03, 0xc0, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300845 {}
846};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300847
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300848static const u8 mi1320_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300849 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
850 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
851};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300852static const u8 mi1320_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300853 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
854};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300855static const u8 mi1320_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300856 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
857 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
858 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
859 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
860 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
861 {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
862 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
863 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
864 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
865 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
866 {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
867 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
868 {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
869 {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
870 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
871 {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
872 {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
873 {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
874 {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
875 {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
876 {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
877 {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
878 {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
879 {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
880 {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
881 {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
882 {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
883 {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
884 {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
885 {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
886 {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
887 {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
888 {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
889 {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
890 {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
891 {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
892 {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
893 {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
894 {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
895 {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
896 {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
897 {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
898 {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
899 {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
900 {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
901 {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
902 {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
903 {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
904 {0x08, 0x00, 0x27, 0xbb}, {0x20, 0x01, 0x03, 0xbb},
905 {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
906 {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
907 {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
908 {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
909 {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
910 {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
911 {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
912 {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
913 {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
914 {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
915 {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
916 {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
917 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
918 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
919 {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
920 {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
921 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
922 {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
923 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
924 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
925 {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
926 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
927 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
928 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
929 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
930 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
931 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
932 {}
933};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300934static const u8 mi1320_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300935 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
936 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
937 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
938 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
939 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
940 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
941 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
942 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
943 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
944 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
945 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
946 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
947 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
948 {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
949 {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
950 {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
951 {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
952 {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
953 {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
954 {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
955 {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
956 {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
957 {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
958 {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
959 {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
960 {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
961 {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
962 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
963 {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
964 {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
965 {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
966 {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
967 {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
968 {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
969 {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
970 {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
971 {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
972 {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
973 {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
974 {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
975 {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
976 {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
977 {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
978 {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
979 {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
980 {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
981 {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
982 {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
983 {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
984 {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
985 {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
986 {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
987 {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
988 {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
989 {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
990 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
991 {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
992 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
993 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
994 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
995 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
996 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
997 {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
998 {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
999 {0xb3, 0x01, 0x41, 0xcc},
1000 {}
1001};
1002
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001003static const u8 mi1320_soc_InitVGA[][4] = {
1004 {0xb3, 0x01, 0x01, 0xcc},
1005 {0xb0, 0x03, 0x19, 0xcc},
1006 {0xb0, 0x04, 0x02, 0xcc},
1007 {0x00, 0x00, 0x30, 0xdd},
1008 {0xb3, 0x00, 0x64, 0xcc},
1009 {0xb3, 0x00, 0x67, 0xcc},
1010 {0xb3, 0x05, 0x01, 0xcc},
1011 {0xb3, 0x06, 0x01, 0xcc},
1012 {0xb3, 0x08, 0x01, 0xcc},
1013 {0xb3, 0x09, 0x0c, 0xcc},
1014 {0xb3, 0x34, 0x02, 0xcc},
1015 {0xb3, 0x35, 0xc8, 0xcc},
1016 {0xb3, 0x02, 0x00, 0xcc},
1017 {0xb3, 0x03, 0x0a, 0xcc},
1018 {0xb3, 0x04, 0x05, 0xcc},
1019 {0xb3, 0x20, 0x00, 0xcc},
1020 {0xb3, 0x21, 0x00, 0xcc},
1021 {0xb3, 0x22, 0x01, 0xcc},
1022 {0xb3, 0x23, 0xe0, 0xcc},
1023 {0xb3, 0x14, 0x00, 0xcc},
1024 {0xb3, 0x15, 0x00, 0xcc},
1025 {0xb3, 0x16, 0x02, 0xcc},
1026 {0xb3, 0x17, 0x7f, 0xcc},
1027 {0xb3, 0x00, 0x67, 0xcc},
1028 {0xb8, 0x00, 0x00, 0xcc},
1029 {0xbc, 0x00, 0x71, 0xcc},
1030 {0xbc, 0x01, 0x01, 0xcc},
1031 {0xb3, 0x5c, 0x01, 0xcc},
1032 {0xf0, 0x00, 0x02, 0xbb},
1033 {0x00, 0x00, 0x10, 0xdd},
1034 {0xc8, 0x00, 0x00, 0xbb},
1035 {0x00, 0x00, 0x30, 0xdd},
1036 {0xf0, 0x00, 0x00, 0xbb},
1037 {0x00, 0x00, 0x10, 0xdd},
1038 {0x07, 0x00, 0xe0, 0xbb},
1039 {0x08, 0x00, 0x0b, 0xbb},
1040 {0x21, 0x00, 0x0c, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001041 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001042 {0xbf, 0xc0, 0x26, 0xcc},
1043 {0xbf, 0xc1, 0x02, 0xcc},
1044 {0xbf, 0xcc, 0x04, 0xcc},
1045 {0xb3, 0x01, 0x41, 0xcc},
1046 {0xf0, 0x00, 0x00, 0xbb},
1047 {0x05, 0x01, 0x78, 0xbb},
1048 {0x06, 0x00, 0x11, 0xbb},
1049 {0x07, 0x01, 0x42, 0xbb},
1050 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001051 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001052 {0x21, 0x80, 0x00, 0xbb},
1053 {0x22, 0x0d, 0x0f, 0xbb},
1054 {0x24, 0x80, 0x00, 0xbb},
1055 {0x59, 0x00, 0xff, 0xbb},
1056 {0xf0, 0x00, 0x02, 0xbb},
1057 {0x39, 0x03, 0xca, 0xbb},
1058 {0x3a, 0x06, 0x80, 0xbb},
1059 {0x3b, 0x01, 0x52, 0xbb},
1060 {0x3c, 0x05, 0x40, 0xbb},
1061 {0x57, 0x01, 0x9c, 0xbb},
1062 {0x58, 0x01, 0xee, 0xbb},
1063 {0x59, 0x00, 0xf0, 0xbb},
1064 {0x5a, 0x01, 0x20, 0xbb},
1065 {0x5c, 0x1d, 0x17, 0xbb},
1066 {0x5d, 0x22, 0x1c, 0xbb},
1067 {0x64, 0x1e, 0x1c, 0xbb},
1068 {0x5b, 0x00, 0x00, 0xbb},
1069 {0xf0, 0x00, 0x02, 0xbb},
1070 {0x22, 0xa0, 0x78, 0xbb},
1071 {0x23, 0xa0, 0x78, 0xbb},
1072 {0x24, 0x7f, 0x00, 0xbb},
1073 {0x28, 0xea, 0x02, 0xbb},
1074 {0x29, 0x86, 0x7a, 0xbb},
1075 {0x5e, 0x52, 0x4c, 0xbb},
1076 {0x5f, 0x20, 0x24, 0xbb},
1077 {0x60, 0x00, 0x02, 0xbb},
1078 {0x02, 0x00, 0xee, 0xbb},
1079 {0x03, 0x39, 0x23, 0xbb},
1080 {0x04, 0x07, 0x24, 0xbb},
1081 {0x09, 0x00, 0xc0, 0xbb},
1082 {0x0a, 0x00, 0x79, 0xbb},
1083 {0x0b, 0x00, 0x04, 0xbb},
1084 {0x0c, 0x00, 0x5c, 0xbb},
1085 {0x0d, 0x00, 0xd9, 0xbb},
1086 {0x0e, 0x00, 0x53, 0xbb},
1087 {0x0f, 0x00, 0x21, 0xbb},
1088 {0x10, 0x00, 0xa4, 0xbb},
1089 {0x11, 0x00, 0xe5, 0xbb},
1090 {0x15, 0x00, 0x00, 0xbb},
1091 {0x16, 0x00, 0x00, 0xbb},
1092 {0x17, 0x00, 0x00, 0xbb},
1093 {0x18, 0x00, 0x00, 0xbb},
1094 {0x19, 0x00, 0x00, 0xbb},
1095 {0x1a, 0x00, 0x00, 0xbb},
1096 {0x1b, 0x00, 0x00, 0xbb},
1097 {0x1c, 0x00, 0x00, 0xbb},
1098 {0x1d, 0x00, 0x00, 0xbb},
1099 {0x1e, 0x00, 0x00, 0xbb},
1100 {0xf0, 0x00, 0x01, 0xbb},
1101 {0x06, 0xe0, 0x0e, 0xbb},
1102 {0x06, 0x60, 0x0e, 0xbb},
1103 {0xb3, 0x5c, 0x01, 0xcc},
1104 {}
1105};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001106static const u8 mi1320_soc_InitQVGA[][4] = {
1107 {0xb3, 0x01, 0x01, 0xcc},
1108 {0xb0, 0x03, 0x19, 0xcc},
1109 {0xb0, 0x04, 0x02, 0xcc},
1110 {0x00, 0x00, 0x30, 0xdd},
1111 {0xb3, 0x00, 0x64, 0xcc},
1112 {0xb3, 0x00, 0x67, 0xcc},
1113 {0xb3, 0x05, 0x01, 0xcc},
1114 {0xb3, 0x06, 0x01, 0xcc},
1115 {0xb3, 0x08, 0x01, 0xcc},
1116 {0xb3, 0x09, 0x0c, 0xcc},
1117 {0xb3, 0x34, 0x02, 0xcc},
1118 {0xb3, 0x35, 0xc8, 0xcc},
1119 {0xb3, 0x02, 0x00, 0xcc},
1120 {0xb3, 0x03, 0x0a, 0xcc},
1121 {0xb3, 0x04, 0x05, 0xcc},
1122 {0xb3, 0x20, 0x00, 0xcc},
1123 {0xb3, 0x21, 0x00, 0xcc},
1124 {0xb3, 0x22, 0x01, 0xcc},
1125 {0xb3, 0x23, 0xe0, 0xcc},
1126 {0xb3, 0x14, 0x00, 0xcc},
1127 {0xb3, 0x15, 0x00, 0xcc},
1128 {0xb3, 0x16, 0x02, 0xcc},
1129 {0xb3, 0x17, 0x7f, 0xcc},
1130 {0xb3, 0x00, 0x67, 0xcc},
1131 {0xb8, 0x00, 0x00, 0xcc},
1132 {0xbc, 0x00, 0xd1, 0xcc},
1133 {0xbc, 0x01, 0x01, 0xcc},
1134 {0xb3, 0x5c, 0x01, 0xcc},
1135 {0xf0, 0x00, 0x02, 0xbb},
1136 {0x00, 0x00, 0x10, 0xdd},
1137 {0xc8, 0x00, 0x00, 0xbb},
1138 {0x00, 0x00, 0x30, 0xdd},
1139 {0xf0, 0x00, 0x00, 0xbb},
1140 {0x00, 0x00, 0x10, 0xdd},
1141 {0x07, 0x00, 0xe0, 0xbb},
1142 {0x08, 0x00, 0x0b, 0xbb},
1143 {0x21, 0x00, 0x0c, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001144 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001145 {0xbf, 0xc0, 0x26, 0xcc},
1146 {0xbf, 0xc1, 0x02, 0xcc},
1147 {0xbf, 0xcc, 0x04, 0xcc},
1148 {0xbc, 0x02, 0x18, 0xcc},
1149 {0xbc, 0x03, 0x50, 0xcc},
1150 {0xbc, 0x04, 0x18, 0xcc},
1151 {0xbc, 0x05, 0x00, 0xcc},
1152 {0xbc, 0x06, 0x00, 0xcc},
1153 {0xbc, 0x08, 0x30, 0xcc},
1154 {0xbc, 0x09, 0x40, 0xcc},
1155 {0xbc, 0x0a, 0x10, 0xcc},
1156 {0xbc, 0x0b, 0x00, 0xcc},
1157 {0xbc, 0x0c, 0x00, 0xcc},
1158 {0xb3, 0x01, 0x41, 0xcc},
1159 {0xf0, 0x00, 0x00, 0xbb},
1160 {0x05, 0x01, 0x78, 0xbb},
1161 {0x06, 0x00, 0x11, 0xbb},
1162 {0x07, 0x01, 0x42, 0xbb},
1163 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001164 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001165 {0x21, 0x80, 0x00, 0xbb},
1166 {0x22, 0x0d, 0x0f, 0xbb},
1167 {0x24, 0x80, 0x00, 0xbb},
1168 {0x59, 0x00, 0xff, 0xbb},
1169 {0xf0, 0x00, 0x02, 0xbb},
1170 {0x39, 0x03, 0xca, 0xbb},
1171 {0x3a, 0x06, 0x80, 0xbb},
1172 {0x3b, 0x01, 0x52, 0xbb},
1173 {0x3c, 0x05, 0x40, 0xbb},
1174 {0x57, 0x01, 0x9c, 0xbb},
1175 {0x58, 0x01, 0xee, 0xbb},
1176 {0x59, 0x00, 0xf0, 0xbb},
1177 {0x5a, 0x01, 0x20, 0xbb},
1178 {0x5c, 0x1d, 0x17, 0xbb},
1179 {0x5d, 0x22, 0x1c, 0xbb},
1180 {0x64, 0x1e, 0x1c, 0xbb},
1181 {0x5b, 0x00, 0x00, 0xbb},
1182 {0xf0, 0x00, 0x02, 0xbb},
1183 {0x22, 0xa0, 0x78, 0xbb},
1184 {0x23, 0xa0, 0x78, 0xbb},
1185 {0x24, 0x7f, 0x00, 0xbb},
1186 {0x28, 0xea, 0x02, 0xbb},
1187 {0x29, 0x86, 0x7a, 0xbb},
1188 {0x5e, 0x52, 0x4c, 0xbb},
1189 {0x5f, 0x20, 0x24, 0xbb},
1190 {0x60, 0x00, 0x02, 0xbb},
1191 {0x02, 0x00, 0xee, 0xbb},
1192 {0x03, 0x39, 0x23, 0xbb},
1193 {0x04, 0x07, 0x24, 0xbb},
1194 {0x09, 0x00, 0xc0, 0xbb},
1195 {0x0a, 0x00, 0x79, 0xbb},
1196 {0x0b, 0x00, 0x04, 0xbb},
1197 {0x0c, 0x00, 0x5c, 0xbb},
1198 {0x0d, 0x00, 0xd9, 0xbb},
1199 {0x0e, 0x00, 0x53, 0xbb},
1200 {0x0f, 0x00, 0x21, 0xbb},
1201 {0x10, 0x00, 0xa4, 0xbb},
1202 {0x11, 0x00, 0xe5, 0xbb},
1203 {0x15, 0x00, 0x00, 0xbb},
1204 {0x16, 0x00, 0x00, 0xbb},
1205 {0x17, 0x00, 0x00, 0xbb},
1206 {0x18, 0x00, 0x00, 0xbb},
1207 {0x19, 0x00, 0x00, 0xbb},
1208 {0x1a, 0x00, 0x00, 0xbb},
1209 {0x1b, 0x00, 0x00, 0xbb},
1210 {0x1c, 0x00, 0x00, 0xbb},
1211 {0x1d, 0x00, 0x00, 0xbb},
1212 {0x1e, 0x00, 0x00, 0xbb},
1213 {0xf0, 0x00, 0x01, 0xbb},
1214 {0x06, 0xe0, 0x0e, 0xbb},
1215 {0x06, 0x60, 0x0e, 0xbb},
1216 {0xb3, 0x5c, 0x01, 0xcc},
1217 {}
1218};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001219static const u8 mi1320_soc_InitSXGA[][4] = {
1220 {0xb3, 0x01, 0x01, 0xcc},
1221 {0xb0, 0x03, 0x19, 0xcc},
1222 {0x00, 0x00, 0x30, 0xdd},
1223 {0xb3, 0x00, 0x64, 0xcc},
1224 {0xb3, 0x00, 0x67, 0xcc},
1225 {0xb3, 0x05, 0x01, 0xcc},
1226 {0xb3, 0x06, 0x01, 0xcc},
1227 {0xb3, 0x08, 0x01, 0xcc},
1228 {0xb3, 0x09, 0x0c, 0xcc},
1229 {0xb3, 0x34, 0x02, 0xcc},
1230 {0xb3, 0x35, 0xc8, 0xcc},
1231 {0xb3, 0x02, 0x00, 0xcc},
1232 {0xb3, 0x03, 0x0a, 0xcc},
1233 {0xb3, 0x04, 0x05, 0xcc},
1234 {0xb3, 0x20, 0x00, 0xcc},
1235 {0xb3, 0x21, 0x00, 0xcc},
1236 {0xb3, 0x22, 0x04, 0xcc},
1237 {0xb3, 0x23, 0x00, 0xcc},
1238 {0xb3, 0x14, 0x00, 0xcc},
1239 {0xb3, 0x15, 0x00, 0xcc},
1240 {0xb3, 0x16, 0x04, 0xcc},
1241 {0xb3, 0x17, 0xff, 0xcc},
1242 {0xb3, 0x00, 0x67, 0xcc},
1243 {0xbc, 0x00, 0x71, 0xcc},
1244 {0xbc, 0x01, 0x01, 0xcc},
1245 {0xb3, 0x5c, 0x01, 0xcc},
1246 {0xf0, 0x00, 0x02, 0xbb},
1247 {0x00, 0x00, 0x30, 0xdd},
1248 {0xc8, 0x9f, 0x0b, 0xbb},
1249 {0x00, 0x00, 0x20, 0xdd},
1250 {0x5b, 0x00, 0x01, 0xbb},
1251 {0x00, 0x00, 0x20, 0xdd},
1252 {0xf0, 0x00, 0x00, 0xbb},
1253 {0x00, 0x00, 0x30, 0xdd},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001254 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001255 {0x00, 0x00, 0x20, 0xdd},
1256 {0xbf, 0xc0, 0x26, 0xcc},
1257 {0xbf, 0xc1, 0x02, 0xcc},
1258 {0xbf, 0xcc, 0x04, 0xcc},
1259 {0xb3, 0x01, 0x41, 0xcc},
1260 {0xf0, 0x00, 0x00, 0xbb},
1261 {0x05, 0x01, 0x78, 0xbb},
1262 {0x06, 0x00, 0x11, 0xbb},
1263 {0x07, 0x01, 0x42, 0xbb},
1264 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001265 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001266 {0x21, 0x80, 0x00, 0xbb},
1267 {0x22, 0x0d, 0x0f, 0xbb},
1268 {0x24, 0x80, 0x00, 0xbb},
1269 {0x59, 0x00, 0xff, 0xbb},
1270 {0xf0, 0x00, 0x02, 0xbb},
1271 {0x39, 0x03, 0xca, 0xbb},
1272 {0x3a, 0x06, 0x80, 0xbb},
1273 {0x3b, 0x01, 0x52, 0xbb},
1274 {0x3c, 0x05, 0x40, 0xbb},
1275 {0x57, 0x01, 0x9c, 0xbb},
1276 {0x58, 0x01, 0xee, 0xbb},
1277 {0x59, 0x00, 0xf0, 0xbb},
1278 {0x5a, 0x01, 0x20, 0xbb},
1279 {0x5c, 0x1d, 0x17, 0xbb},
1280 {0x5d, 0x22, 0x1c, 0xbb},
1281 {0x64, 0x1e, 0x1c, 0xbb},
1282 {0x5b, 0x00, 0x00, 0xbb},
1283 {0xf0, 0x00, 0x02, 0xbb},
1284 {0x22, 0xa0, 0x78, 0xbb},
1285 {0x23, 0xa0, 0x78, 0xbb},
1286 {0x24, 0x7f, 0x00, 0xbb},
1287 {0x28, 0xea, 0x02, 0xbb},
1288 {0x29, 0x86, 0x7a, 0xbb},
1289 {0x5e, 0x52, 0x4c, 0xbb},
1290 {0x5f, 0x20, 0x24, 0xbb},
1291 {0x60, 0x00, 0x02, 0xbb},
1292 {0x02, 0x00, 0xee, 0xbb},
1293 {0x03, 0x39, 0x23, 0xbb},
1294 {0x04, 0x07, 0x24, 0xbb},
1295 {0x09, 0x00, 0xc0, 0xbb},
1296 {0x0a, 0x00, 0x79, 0xbb},
1297 {0x0b, 0x00, 0x04, 0xbb},
1298 {0x0c, 0x00, 0x5c, 0xbb},
1299 {0x0d, 0x00, 0xd9, 0xbb},
1300 {0x0e, 0x00, 0x53, 0xbb},
1301 {0x0f, 0x00, 0x21, 0xbb},
1302 {0x10, 0x00, 0xa4, 0xbb},
1303 {0x11, 0x00, 0xe5, 0xbb},
1304 {0x15, 0x00, 0x00, 0xbb},
1305 {0x16, 0x00, 0x00, 0xbb},
1306 {0x17, 0x00, 0x00, 0xbb},
1307 {0x18, 0x00, 0x00, 0xbb},
1308 {0x19, 0x00, 0x00, 0xbb},
1309 {0x1a, 0x00, 0x00, 0xbb},
1310 {0x1b, 0x00, 0x00, 0xbb},
1311 {0x1c, 0x00, 0x00, 0xbb},
1312 {0x1d, 0x00, 0x00, 0xbb},
1313 {0x1e, 0x00, 0x00, 0xbb},
1314 {0xf0, 0x00, 0x01, 0xbb},
1315 {0x06, 0xe0, 0x0e, 0xbb},
1316 {0x06, 0x60, 0x0e, 0xbb},
1317 {0xb3, 0x5c, 0x01, 0xcc},
1318 {0xf0, 0x00, 0x00, 0xbb},
1319 {0x05, 0x01, 0x13, 0xbb},
1320 {0x06, 0x00, 0x11, 0xbb},
1321 {0x07, 0x00, 0x85, 0xbb},
1322 {0x08, 0x00, 0x27, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001323 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001324 {0x21, 0x80, 0x00, 0xbb},
1325 {0x22, 0x0d, 0x0f, 0xbb},
1326 {0x24, 0x80, 0x00, 0xbb},
1327 {0x59, 0x00, 0xff, 0xbb},
1328 {0xf0, 0x00, 0x02, 0xbb},
1329 {0x39, 0x03, 0x0d, 0xbb},
1330 {0x3a, 0x06, 0x1b, 0xbb},
1331 {0x3b, 0x00, 0x95, 0xbb},
1332 {0x3c, 0x04, 0xdb, 0xbb},
1333 {0x57, 0x02, 0x00, 0xbb},
1334 {0x58, 0x02, 0x66, 0xbb},
1335 {0x59, 0x00, 0xff, 0xbb},
1336 {0x5a, 0x01, 0x33, 0xbb},
1337 {0x5c, 0x12, 0x0d, 0xbb},
1338 {0x5d, 0x16, 0x11, 0xbb},
1339 {0x64, 0x5e, 0x1c, 0xbb},
1340 {}
1341};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001342static const u8 po3130_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001343 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1344 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1345};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001346static const u8 po3130_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001347 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1348};
1349
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001350static const u8 po3130_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001351 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1352 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1353 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1354 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1355 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1356 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1357 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1358 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1359 {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
1360 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1361 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1362 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
1363 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
1364 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1365 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1366 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1367 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1368 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1369 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1370 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1371 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1372 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1373 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1374 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1375 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1376 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1377 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1378 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1379 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1380 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1381 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1382 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1383 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1384 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1385 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1386 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1387 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1388 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1389 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1390 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1391 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1392 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1393 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1394 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1395 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1396 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1397 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1398 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1399 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1400 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1401 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1402 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1403 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1404 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1405 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1406 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1407 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1408 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1409 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1410 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1411 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1412 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1413 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1414 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1415 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1416 {0x00, 0x7e, 0xea, 0xaa},
1417 {0x00, 0x4c, 0x07, 0xaa},
1418 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1419 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1420/* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1421 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
1422 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1423 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1424 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1425 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1426 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1427 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1428 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1429 {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1430 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1431 {}
1432};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001433static const u8 po3130_rundata[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001434 {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
1435 {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
1436 {0x00, 0x44, 0x40, 0xaa},
1437/* {0x00, 0xd5, 0x7c, 0xaa}, */
1438 {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
1439 {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
1440 {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
1441 {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
1442 {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
1443 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
1444 {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1445 {}
1446};
1447
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001448static const u8 po3130_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001449 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1450 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
1451 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1452 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1453 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1454 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1455 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1456 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1457 {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
1458 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1459 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1460 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
1461 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1462 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1463 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1464 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1465 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1466 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1467 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1468 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1469 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1470 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1471 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1472 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1473 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1474 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1475 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1476 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1477 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1478 {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1479 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1480 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1481 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1482 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1483 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1484 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1485 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1486 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1487 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1488 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1489 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1490 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1491 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1492 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1493 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1494 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1495 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1496 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1497 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1498 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1499 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1500 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1501 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1502 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1503 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1504 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1505 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1506 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1507 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1508 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1509 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1510 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1511 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1512 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1513 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1514 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
1515 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1516 {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1517 {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1518 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1519 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1520 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1521 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1522 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1523 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1524 {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
1525 {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
1526 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1527 {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
1528 {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
1529 {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1530 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1531 {}
1532};
1533
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001534static const u8 hv7131r_gamma[17] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001535 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1536 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001537};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001538static const u8 hv7131r_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001539 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1540};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001541static const u8 hv7131r_initVGA_data[][4] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001542 {0xb3, 0x01, 0x01, 0xcc},
1543 {0xb0, 0x03, 0x19, 0xcc},
1544 {0xb0, 0x04, 0x02, 0xcc},
1545 {0x00, 0x00, 0x20, 0xdd},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001546 {0xb3, 0x00, 0x24, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001547 {0xb3, 0x00, 0x25, 0xcc},
1548 {0xb3, 0x08, 0x01, 0xcc},
1549 {0xb3, 0x09, 0x0c, 0xcc},
1550 {0xb3, 0x05, 0x01, 0xcc},
1551 {0xb3, 0x06, 0x03, 0xcc},
1552 {0xb3, 0x01, 0x45, 0xcc},
1553 {0xb3, 0x03, 0x0b, 0xcc},
1554 {0xb3, 0x04, 0x05, 0xcc},
1555 {0xb3, 0x20, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001556 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001557 {0xb3, 0x22, 0x01, 0xcc},
1558 {0xb3, 0x23, 0xe0, 0xcc},
1559 {0xb3, 0x14, 0x00, 0xcc},
1560 {0xb3, 0x15, 0x02, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001561 {0xb3, 0x16, 0x02, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001562 {0xb3, 0x17, 0x7f, 0xcc},
1563 {0xb3, 0x34, 0x01, 0xcc},
1564 {0xb3, 0x35, 0x91, 0xcc},
1565 {0xb3, 0x00, 0x27, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001566 {0xbc, 0x00, 0x73, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001567 {0xb8, 0x00, 0x23, 0xcc},
1568 {0xb8, 0x2c, 0x50, 0xcc},
1569 {0xb8, 0x2d, 0xf8, 0xcc},
1570 {0xb8, 0x2e, 0xf8, 0xcc},
1571 {0xb8, 0x2f, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001572 {0xb8, 0x30, 0x50, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001573 {0xb8, 0x31, 0xf8, 0xcc},
1574 {0xb8, 0x32, 0xf8, 0xcc},
1575 {0xb8, 0x33, 0xf8, 0xcc},
1576 {0xb8, 0x34, 0x58, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001577 {0xb8, 0x35, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001578 {0xb8, 0x36, 0x00, 0xcc},
1579 {0xb8, 0x37, 0x00, 0xcc},
1580 {0xb8, 0x27, 0x20, 0xcc},
1581 {0xb8, 0x01, 0x7d, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001582 {0xb8, 0x81, 0x09, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001583 {0xb3, 0x01, 0x41, 0xcc},
1584 {0xb8, 0x8e, 0x00, 0xcc},
1585 {0xb8, 0x8f, 0xff, 0xcc},
1586 {0x00, 0x01, 0x0c, 0xaa},
1587 {0x00, 0x14, 0x01, 0xaa},
1588 {0x00, 0x15, 0xe6, 0xaa},
1589 {0x00, 0x16, 0x02, 0xaa},
1590 {0x00, 0x17, 0x86, 0xaa},
1591 {0x00, 0x23, 0x00, 0xaa},
1592 {0x00, 0x25, 0x03, 0xaa},
1593 {0x00, 0x26, 0xa9, 0xaa},
1594 {0x00, 0x27, 0x80, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001595 {0x00, 0x30, 0x18, 0xaa},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001596 {0xb6, 0x00, 0x00, 0xcc},
1597 {0xb6, 0x03, 0x02, 0xcc},
1598 {0xb6, 0x02, 0x80, 0xcc},
1599 {0xb6, 0x05, 0x01, 0xcc},
1600 {0xb6, 0x04, 0xe0, 0xcc},
1601 {0xb6, 0x12, 0x78, 0xcc},
1602 {0xb6, 0x18, 0x02, 0xcc},
1603 {0xb6, 0x17, 0x58, 0xcc},
1604 {0xb6, 0x16, 0x00, 0xcc},
1605 {0xb6, 0x22, 0x12, 0xcc},
1606 {0xb6, 0x23, 0x0b, 0xcc},
1607 {0xb3, 0x02, 0x02, 0xcc},
1608 {0xbf, 0xc0, 0x39, 0xcc},
1609 {0xbf, 0xc1, 0x04, 0xcc},
1610 {0xbf, 0xcc, 0x10, 0xcc},
1611 {0xb6, 0x12, 0xf8, 0xcc},
1612 {0xb6, 0x13, 0x13, 0xcc},
1613 {0xb9, 0x12, 0x00, 0xcc},
1614 {0xb9, 0x13, 0x0a, 0xcc},
1615 {0xb9, 0x14, 0x0a, 0xcc},
1616 {0xb9, 0x15, 0x0a, 0xcc},
1617 {0xb9, 0x16, 0x0a, 0xcc},
1618 {0xb8, 0x0c, 0x20, 0xcc},
1619 {0xb8, 0x0d, 0x70, 0xcc},
1620 {0xb9, 0x18, 0x00, 0xcc},
1621 {0xb9, 0x19, 0x0f, 0xcc},
1622 {0xb9, 0x1a, 0x0f, 0xcc},
1623 {0xb9, 0x1b, 0x0f, 0xcc},
1624 {0xb9, 0x1c, 0x0f, 0xcc},
1625 {0xb3, 0x5c, 0x01, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001626 {}
1627};
1628
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001629static const u8 hv7131r_initQVGA_data[][4] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001630 {0xb3, 0x01, 0x01, 0xcc},
1631 {0xb0, 0x03, 0x19, 0xcc},
1632 {0xb0, 0x04, 0x02, 0xcc},
1633 {0x00, 0x00, 0x20, 0xdd},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001634 {0xb3, 0x00, 0x24, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001635 {0xb3, 0x00, 0x25, 0xcc},
1636 {0xb3, 0x08, 0x01, 0xcc},
1637 {0xb3, 0x09, 0x0c, 0xcc},
1638 {0xb3, 0x05, 0x01, 0xcc},
1639 {0xb3, 0x06, 0x03, 0xcc},
1640 {0xb3, 0x01, 0x45, 0xcc},
1641 {0xb3, 0x03, 0x0b, 0xcc},
1642 {0xb3, 0x04, 0x05, 0xcc},
1643 {0xb3, 0x20, 0x00, 0xcc},
1644 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001645 {0xb3, 0x22, 0x01, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001646 {0xb3, 0x23, 0xe0, 0xcc},
1647 {0xb3, 0x14, 0x00, 0xcc},
1648 {0xb3, 0x15, 0x02, 0xcc},
1649 {0xb3, 0x16, 0x02, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001650 {0xb3, 0x17, 0x7f, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001651 {0xb3, 0x34, 0x01, 0xcc},
1652 {0xb3, 0x35, 0x91, 0xcc},
1653 {0xb3, 0x00, 0x27, 0xcc},
1654 {0xbc, 0x00, 0xd3, 0xcc},
1655 {0xb8, 0x00, 0x23, 0xcc},
1656 {0xb8, 0x2c, 0x50, 0xcc},
1657 {0xb8, 0x2d, 0xf8, 0xcc},
1658 {0xb8, 0x2e, 0xf8, 0xcc},
1659 {0xb8, 0x2f, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001660 {0xb8, 0x30, 0x50, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001661 {0xb8, 0x31, 0xf8, 0xcc},
1662 {0xb8, 0x32, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001663 {0xb8, 0x33, 0xf8, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001664 {0xb8, 0x34, 0x58, 0xcc},
1665 {0xb8, 0x35, 0x00, 0xcc},
1666 {0xb8, 0x36, 0x00, 0xcc},
1667 {0xb8, 0x37, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001668 {0xb8, 0x27, 0x20, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001669 {0xb8, 0x01, 0x7d, 0xcc},
1670 {0xb8, 0x81, 0x09, 0xcc},
1671 {0xb3, 0x01, 0x41, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001672 {0xb8, 0x8e, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001673 {0xb8, 0x8f, 0xff, 0xcc},
1674 {0x00, 0x01, 0x0c, 0xaa},
1675 {0x00, 0x14, 0x01, 0xaa},
1676 {0x00, 0x15, 0xe6, 0xaa},
1677 {0x00, 0x16, 0x02, 0xaa},
1678 {0x00, 0x17, 0x86, 0xaa},
1679 {0x00, 0x23, 0x00, 0xaa},
1680 {0x00, 0x25, 0x03, 0xaa},
1681 {0x00, 0x26, 0xa9, 0xaa},
1682 {0x00, 0x27, 0x80, 0xaa},
1683 {0x00, 0x30, 0x18, 0xaa},
1684 {0xb6, 0x00, 0x00, 0xcc},
1685 {0xb6, 0x03, 0x01, 0xcc},
1686 {0xb6, 0x02, 0x40, 0xcc},
1687 {0xb6, 0x05, 0x00, 0xcc},
1688 {0xb6, 0x04, 0xf0, 0xcc},
1689 {0xb6, 0x12, 0x78, 0xcc},
1690 {0xb6, 0x18, 0x00, 0xcc},
1691 {0xb6, 0x17, 0x96, 0xcc},
1692 {0xb6, 0x16, 0x00, 0xcc},
1693 {0xb6, 0x22, 0x12, 0xcc},
1694 {0xb6, 0x23, 0x0b, 0xcc},
1695 {0xb3, 0x02, 0x02, 0xcc},
1696 {0xbf, 0xc0, 0x39, 0xcc},
1697 {0xbf, 0xc1, 0x04, 0xcc},
1698 {0xbf, 0xcc, 0x10, 0xcc},
1699 {0xbc, 0x02, 0x18, 0xcc},
1700 {0xbc, 0x03, 0x50, 0xcc},
1701 {0xbc, 0x04, 0x18, 0xcc},
1702 {0xbc, 0x05, 0x00, 0xcc},
1703 {0xbc, 0x06, 0x00, 0xcc},
1704 {0xbc, 0x08, 0x30, 0xcc},
1705 {0xbc, 0x09, 0x40, 0xcc},
1706 {0xbc, 0x0a, 0x10, 0xcc},
1707 {0xbc, 0x0b, 0x00, 0xcc},
1708 {0xbc, 0x0c, 0x00, 0xcc},
1709 {0xb9, 0x12, 0x00, 0xcc},
1710 {0xb9, 0x13, 0x0a, 0xcc},
1711 {0xb9, 0x14, 0x0a, 0xcc},
1712 {0xb9, 0x15, 0x0a, 0xcc},
1713 {0xb9, 0x16, 0x0a, 0xcc},
1714 {0xb9, 0x18, 0x00, 0xcc},
1715 {0xb9, 0x19, 0x0f, 0xcc},
1716 {0xb8, 0x0c, 0x20, 0xcc},
1717 {0xb8, 0x0d, 0x70, 0xcc},
1718 {0xb9, 0x1a, 0x0f, 0xcc},
1719 {0xb9, 0x1b, 0x0f, 0xcc},
1720 {0xb9, 0x1c, 0x0f, 0xcc},
1721 {0xb6, 0x12, 0xf8, 0xcc},
1722 {0xb6, 0x13, 0x13, 0xcc},
1723 {0xb3, 0x5c, 0x01, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001724 {}
1725};
1726
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001727static const u8 ov7660_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001728 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1729 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1730};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001731static const u8 ov7660_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001732 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1733};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001734static const u8 ov7660_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001735 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1736 {0x00, 0x00, 0x50, 0xdd},
1737 {0xb0, 0x03, 0x01, 0xcc},
1738 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1739 {0xb3, 0x05, 0x01, 0xcc},
1740 {0xb3, 0x06, 0x03, 0xcc},
1741 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1742 {0xb3, 0x05, 0x00, 0xcc},
1743 {0xb3, 0x06, 0x01, 0xcc},
1744 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1745 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1746 {0xb3, 0x21, 0x00, 0xcc},
1747 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1748 {0xb3, 0x1f, 0x02, 0xcc},
1749 {0xb3, 0x34, 0x01, 0xcc},
1750 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1751 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1752 {0xb8, 0x01, 0x7d, 0xcc},
1753 {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1754 {0xb8, 0x27, 0x20, 0xcc},
1755 {0xb8, 0x8f, 0x50, 0xcc},
1756 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1757 {0x00, 0x12, 0x80, 0xaa},
1758 {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001759 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001760 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1761 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1762 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1763 {0x00, 0x13, 0xa7, 0xaa},
1764 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1765 {0x00, 0x36, 0x00, 0xaa},
1766 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1767 {0x00, 0x39, 0x43, 0xaa},
1768 {0x00, 0x8d, 0xcf, 0xaa},
1769 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1770 {0x00, 0x0f, 0x62, 0xaa},
1771 {0x00, 0x35, 0x84, 0xaa},
1772 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1773 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1774 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1775 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1776 {0x00, 0x01, 0x80, 0xaa},
1777 {0x00, 0x02, 0x80, 0xaa},
1778 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1779 {0xb9, 0x00, 0x28, 0xcc},
1780 {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
1781 {0xb9, 0x03, 0x00, 0xcc},
1782 {0xb9, 0x04, 0x00, 0xcc},
1783 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1784 {0xb9, 0x07, 0x3c, 0xcc},
1785 {0xb9, 0x08, 0x3c, 0xcc},
1786
1787 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1788
1789 {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
1790 {}
1791};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001792static const u8 ov7660_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001793 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1794 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1795 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1796 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
1797 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1798 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1799 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1800 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1801 {0xb3, 0x21, 0x00, 0xcc},
1802 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1803 {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1804 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1805 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1806 {0xb8, 0x01, 0x7d, 0xcc},
1807/* sizer */
1808 {0xbc, 0x00, 0xd3, 0xcc},
1809 {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1810 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
1811 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1812 {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001813 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001814 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1815 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1816 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1817 {0x00, 0x13, 0xa7, 0xaa},
1818 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1819 {0x00, 0x36, 0x00, 0xaa},
1820 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1821 {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
1822 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1823 {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
1824 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1825 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1826 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1827 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1828 {0x00, 0x01, 0x80, 0xaa},
1829 {0x00, 0x02, 0x80, 0xaa},
1830/* sizer filters */
1831 {0xbc, 0x02, 0x08, 0xcc},
1832 {0xbc, 0x03, 0x70, 0xcc},
1833 {0xb8, 0x35, 0x00, 0xcc},
1834 {0xb8, 0x36, 0x00, 0xcc},
1835 {0xb8, 0x37, 0x00, 0xcc},
1836 {0xbc, 0x04, 0x08, 0xcc},
1837 {0xbc, 0x05, 0x00, 0xcc},
1838 {0xbc, 0x06, 0x00, 0xcc},
1839 {0xbc, 0x08, 0x3c, 0xcc},
1840 {0xbc, 0x09, 0x40, 0xcc},
1841 {0xbc, 0x0a, 0x04, 0xcc},
1842 {0xbc, 0x0b, 0x00, 0xcc},
1843 {0xbc, 0x0c, 0x00, 0xcc},
1844/* */
1845 {0xb8, 0xfe, 0x00, 0xcc},
1846 {0xb8, 0xff, 0x28, 0xcc},
1847/* */
1848 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1849 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1850 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1851 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1852 {0xb9, 0x08, 0x3c, 0xcc},
1853/* */
1854 {0xb8, 0x8e, 0x00, 0xcc},
1855 {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1856 {0x00, 0x29, 0x3c, 0xaa},
1857 {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001858 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001859};
1860
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001861static const u8 ov7660_50HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001862 {0x00, 0x3b, 0x08, 0xaa},
1863 {0x00, 0x9d, 0x40, 0xaa},
1864 {0x00, 0x13, 0xa7, 0xaa},
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001865 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001866};
1867
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001868static const u8 ov7660_60HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001869 {0x00, 0x3b, 0x00, 0xaa},
1870 {0x00, 0x9e, 0x40, 0xaa},
1871 {0x00, 0x13, 0xa7, 0xaa},
1872 {}
1873};
1874
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001875static const u8 ov7660_NoFliker[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001876 {0x00, 0x13, 0x87, 0xaa},
1877 {}
1878};
1879
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001880static const u8 ov7670_initVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001881 {0xb3, 0x01, 0x05, 0xcc},
1882 {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc},
1883 {0x00, 0x00, 0x10, 0xdd},
1884 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1885 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1886 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1887 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1888 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1889 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1890 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1891 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1892 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1893 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1894 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0x41, 0xcc},
1895 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1896 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1897 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1898 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1899 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1900 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1901 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1902 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1903 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1904 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
1905 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
1906 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
1907 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
1908 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
1909 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
1910 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
1911 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
1912 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
1913 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
1914 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
1915 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
1916 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
1917 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
1918 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001919 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1920 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001921 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
1922 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
1923 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
1924 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
1925 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
1926 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
1927 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
1928 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
1929 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
1930 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
1931 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
1932 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
1933 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
1934 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
1935 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
1936 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
1937 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
1938 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
1939 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
1940 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
1941 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
1942 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
1943 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
1944 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
1945 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
1946 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
1947 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
1948 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
1949 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1950 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
1951 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1952 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
1953 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1954 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
1955 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1956 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
1957 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
1958 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
1959 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
1960 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
1961 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
1962 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
1963 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
1964 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
1965 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
1966 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
1967 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
1968 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
1969 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
1970 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
1971 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
1972 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
1973 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
1974 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
1975 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
1976 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1977 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
1978 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
1979 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
1980 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
1981 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
1982 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
1983 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
1984 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001985 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
1986 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001987 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
1988 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
1989 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
1990 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1991 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
1992 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1993 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
1994 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1995 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
1996 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1997 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
1998 {0xb6, 0x03, 0x02, 0xcc}, {0xb6, 0x02, 0x80, 0xcc},
1999 {0xb6, 0x05, 0x01, 0xcc}, {0xb6, 0x04, 0xe0, 0xcc},
2000 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x13, 0xcc},
2001 {0xb6, 0x18, 0x02, 0xcc}, {0xb6, 0x17, 0x58, 0xcc},
2002 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
2003 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
2004 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
2005 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
2006 {0x00, 0x77, 0x05, 0xaa},
2007 {},
2008};
2009
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002010static const u8 ov7670_initQVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002011 {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd},
2012 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
2013 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
2014 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
2015 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
2016 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
2017 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
2018 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
2019 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
2020 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
2021 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
2022 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
2023 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
2024 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
2025 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
2026 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
2027 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
2028 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
2029 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
2030 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
2031 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
2032 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
2033 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
2034 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
2035 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
2036 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
2037 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
2038 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
2039 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
2040 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
2041 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
2042 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
2043 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
2044 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
2045 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
2046 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
2047 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002048 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
2049 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002050 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
2051 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
2052 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
2053 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
2054 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
2055 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
2056 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
2057 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
2058 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
2059 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
2060 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
2061 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
2062 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
2063 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
2064 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
2065 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
2066 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
2067 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
2068 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
2069 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
2070 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
2071 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
2072 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
2073 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
2074 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
2075 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
2076 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
2077 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
2078 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2079 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
2080 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2081 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
2082 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2083 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
2084 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2085 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
2086 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
2087 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
2088 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
2089 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
2090 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
2091 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
2092 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
2093 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
2094 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
2095 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
2096 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
2097 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
2098 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
2099 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
2100 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
2101 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
2102 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
2103 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
2104 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
2105 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
2106 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
2107 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
2108 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
2109 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
2110 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
2111 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
2112 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
2113 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002114 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
2115 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002116 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
2117 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
2118 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
2119 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2120 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
2121 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2122 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
2123 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2124 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
2125 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2126 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
2127 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
2128 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
2129 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x21, 0xcc},
2130 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
2131 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
2132 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
2133 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
2134 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
2135 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
2136 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
2137 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
2138 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
2139 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
2140 {0x00, 0x77, 0x05, 0xaa },
2141 {},
2142};
Jean-Francois Moine88521532008-12-10 05:06:13 -03002143
2144/* PO1200 - values from usbvm326.inf and ms-win trace */
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002145static const u8 po1200_gamma[17] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002146 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
2147 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
2148};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002149static const u8 po1200_matrix[9] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002150 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
2151};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002152static const u8 po1200_initVGA_data[][4] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002153 {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
2154 {0xb0, 0x03, 0x19, 0xcc},
2155/* {0x00, 0x00, 0x33, 0xdd}, */
2156 {0xb0, 0x04, 0x02, 0xcc},
2157 {0xb0, 0x02, 0x02, 0xcc},
2158 {0xb3, 0x5d, 0x00, 0xcc},
2159 {0xb3, 0x01, 0x01, 0xcc},
2160 {0xb3, 0x00, 0x64, 0xcc},
2161 {0xb3, 0x00, 0x65, 0xcc},
2162 {0xb3, 0x05, 0x01, 0xcc},
2163 {0xb3, 0x06, 0x01, 0xcc},
2164 {0xb3, 0x5c, 0x01, 0xcc},
2165 {0xb3, 0x08, 0x01, 0xcc},
2166 {0xb3, 0x09, 0x0c, 0xcc},
2167 {0xb3, 0x00, 0x67, 0xcc},
2168 {0xb3, 0x02, 0xb2, 0xcc},
2169 {0xb3, 0x03, 0x18, 0xcc},
2170 {0xb3, 0x04, 0x15, 0xcc},
2171 {0xb3, 0x20, 0x00, 0xcc},
2172 {0xb3, 0x21, 0x00, 0xcc},
2173 {0xb3, 0x22, 0x02, 0xcc},
2174 {0xb3, 0x23, 0x58, 0xcc},
2175 {0xb3, 0x14, 0x00, 0xcc},
2176 {0xb3, 0x15, 0x00, 0xcc},
2177 {0xb3, 0x16, 0x03, 0xcc},
2178 {0xb3, 0x17, 0x1f, 0xcc},
2179 {0xbc, 0x00, 0x71, 0xcc},
2180 {0xbc, 0x01, 0x01, 0xcc},
2181 {0xb0, 0x54, 0x13, 0xcc},
2182 {0xb3, 0x00, 0x67, 0xcc},
2183 {0xb3, 0x34, 0x01, 0xcc},
2184 {0xb3, 0x35, 0xdc, 0xcc},
2185 {0x00, 0x03, 0x00, 0xaa},
2186 {0x00, 0x12, 0x05, 0xaa},
2187 {0x00, 0x13, 0x02, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002188 {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002189 {0x00, 0x21, 0x00, 0xaa},
2190 {0x00, 0x25, 0x02, 0xaa},
2191 {0x00, 0x3c, 0x4f, 0xaa},
2192 {0x00, 0x3f, 0xe0, 0xaa},
2193 {0x00, 0x42, 0xff, 0xaa},
2194 {0x00, 0x45, 0x34, 0xaa},
2195 {0x00, 0x55, 0xfe, 0xaa},
2196 {0x00, 0x59, 0xd3, 0xaa},
2197 {0x00, 0x5e, 0x04, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002198 {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002199 {0x00, 0x62, 0x02, 0xaa},
2200 {0x00, 0xa7, 0x31, 0xaa},
2201 {0x00, 0xa9, 0x66, 0xaa},
2202 {0x00, 0xb0, 0x00, 0xaa},
2203 {0x00, 0xb1, 0x00, 0xaa},
2204 {0x00, 0xb3, 0x11, 0xaa},
2205 {0x00, 0xb6, 0x26, 0xaa},
2206 {0x00, 0xb7, 0x20, 0xaa},
2207 {0x00, 0xba, 0x04, 0xaa},
2208 {0x00, 0x88, 0x42, 0xaa},
2209 {0x00, 0x89, 0x9a, 0xaa},
2210 {0x00, 0x8a, 0x88, 0xaa},
2211 {0x00, 0x8b, 0x8e, 0xaa},
2212 {0x00, 0x8c, 0x3e, 0xaa},
2213 {0x00, 0x8d, 0x90, 0xaa},
2214 {0x00, 0x8e, 0x87, 0xaa},
2215 {0x00, 0x8f, 0x96, 0xaa},
2216 {0x00, 0x90, 0x3d, 0xaa},
2217 {0x00, 0x64, 0x00, 0xaa},
2218 {0x00, 0x65, 0x10, 0xaa},
2219 {0x00, 0x66, 0x20, 0xaa},
2220 {0x00, 0x67, 0x2b, 0xaa},
2221 {0x00, 0x68, 0x36, 0xaa},
2222 {0x00, 0x69, 0x49, 0xaa},
2223 {0x00, 0x6a, 0x5a, 0xaa},
2224 {0x00, 0x6b, 0x7f, 0xaa},
2225 {0x00, 0x6c, 0x9b, 0xaa},
2226 {0x00, 0x6d, 0xba, 0xaa},
2227 {0x00, 0x6e, 0xd4, 0xaa},
2228 {0x00, 0x6f, 0xea, 0xaa},
2229 {0x00, 0x70, 0x00, 0xaa},
2230 {0x00, 0x71, 0x10, 0xaa},
2231 {0x00, 0x72, 0x20, 0xaa},
2232 {0x00, 0x73, 0x2b, 0xaa},
2233 {0x00, 0x74, 0x36, 0xaa},
2234 {0x00, 0x75, 0x49, 0xaa},
2235 {0x00, 0x76, 0x5a, 0xaa},
2236 {0x00, 0x77, 0x7f, 0xaa},
2237 {0x00, 0x78, 0x9b, 0xaa},
2238 {0x00, 0x79, 0xba, 0xaa},
2239 {0x00, 0x7a, 0xd4, 0xaa},
2240 {0x00, 0x7b, 0xea, 0xaa},
2241 {0x00, 0x7c, 0x00, 0xaa},
2242 {0x00, 0x7d, 0x10, 0xaa},
2243 {0x00, 0x7e, 0x20, 0xaa},
2244 {0x00, 0x7f, 0x2b, 0xaa},
2245 {0x00, 0x80, 0x36, 0xaa},
2246 {0x00, 0x81, 0x49, 0xaa},
2247 {0x00, 0x82, 0x5a, 0xaa},
2248 {0x00, 0x83, 0x7f, 0xaa},
2249 {0x00, 0x84, 0x9b, 0xaa},
2250 {0x00, 0x85, 0xba, 0xaa},
2251 {0x00, 0x86, 0xd4, 0xaa},
2252 {0x00, 0x87, 0xea, 0xaa},
2253 {0x00, 0x57, 0x2a, 0xaa},
2254 {0x00, 0x03, 0x01, 0xaa},
2255 {0x00, 0x04, 0x10, 0xaa},
2256 {0x00, 0x05, 0x10, 0xaa},
2257 {0x00, 0x06, 0x10, 0xaa},
2258 {0x00, 0x07, 0x10, 0xaa},
2259 {0x00, 0x08, 0x13, 0xaa},
2260 {0x00, 0x0a, 0x00, 0xaa},
2261 {0x00, 0x0b, 0x10, 0xaa},
2262 {0x00, 0x0c, 0x20, 0xaa},
2263 {0x00, 0x0d, 0x18, 0xaa},
2264 {0x00, 0x22, 0x01, 0xaa},
2265 {0x00, 0x23, 0x60, 0xaa},
2266 {0x00, 0x25, 0x08, 0xaa},
2267 {0x00, 0x26, 0x82, 0xaa},
2268 {0x00, 0x2e, 0x0f, 0xaa},
2269 {0x00, 0x2f, 0x1e, 0xaa},
2270 {0x00, 0x30, 0x2d, 0xaa},
2271 {0x00, 0x31, 0x3c, 0xaa},
2272 {0x00, 0x32, 0x4b, 0xaa},
2273 {0x00, 0x33, 0x5a, 0xaa},
2274 {0x00, 0x34, 0x69, 0xaa},
2275 {0x00, 0x35, 0x78, 0xaa},
2276 {0x00, 0x36, 0x87, 0xaa},
2277 {0x00, 0x37, 0x96, 0xaa},
2278 {0x00, 0x38, 0xa5, 0xaa},
2279 {0x00, 0x39, 0xb4, 0xaa},
2280 {0x00, 0x3a, 0xc3, 0xaa},
2281 {0x00, 0x3b, 0xd2, 0xaa},
2282 {0x00, 0x3c, 0xe1, 0xaa},
2283 {0x00, 0x3e, 0xff, 0xaa},
2284 {0x00, 0x3f, 0xff, 0xaa},
2285 {0x00, 0x40, 0xff, 0xaa},
2286 {0x00, 0x41, 0xff, 0xaa},
2287 {0x00, 0x42, 0xff, 0xaa},
2288 {0x00, 0x43, 0xff, 0xaa},
2289 {0x00, 0x03, 0x00, 0xaa},
2290 {0x00, 0x03, 0x00, 0xaa},
2291 {0x00, 0x20, 0xc4, 0xaa},
2292 {0x00, 0x13, 0x03, 0xaa},
2293 {0x00, 0x3c, 0x50, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002294 {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002295 {0x00, 0x51, 0x5b, 0xaa},
2296 {0x00, 0x52, 0x91, 0xaa},
2297 {0x00, 0x53, 0x4c, 0xaa},
2298 {0x00, 0x54, 0x50, 0xaa},
2299 {0x00, 0x56, 0x02, 0xaa},
2300 {0xb6, 0x00, 0x00, 0xcc},
2301 {0xb6, 0x03, 0x03, 0xcc},
2302 {0xb6, 0x02, 0x20, 0xcc},
2303 {0xb6, 0x05, 0x02, 0xcc},
2304 {0xb6, 0x04, 0x58, 0xcc},
2305 {0xb6, 0x12, 0xf8, 0xcc},
2306 {0xb6, 0x13, 0x21, 0xcc},
2307 {0xb6, 0x18, 0x03, 0xcc},
2308 {0xb6, 0x17, 0xa9, 0xcc},
2309 {0xb6, 0x16, 0x80, 0xcc},
2310 {0xb6, 0x22, 0x12, 0xcc},
2311 {0xb6, 0x23, 0x0b, 0xcc},
2312 {0xbf, 0xc0, 0x39, 0xcc},
2313 {0xbf, 0xc1, 0x04, 0xcc},
2314 {0xbf, 0xcc, 0x00, 0xcc},
2315 {0xb8, 0x06, 0x20, 0xcc},
2316 {0xb8, 0x07, 0x03, 0xcc},
2317 {0xb8, 0x08, 0x58, 0xcc},
2318 {0xb8, 0x09, 0x02, 0xcc},
2319 {0xb3, 0x01, 0x41, 0xcc},
2320 {0x00, 0x03, 0x00, 0xaa},
2321 {0x00, 0xd9, 0x0f, 0xaa},
2322 {0x00, 0xda, 0xaa, 0xaa},
2323 {0x00, 0xd9, 0x10, 0xaa},
2324 {0x00, 0xda, 0xaa, 0xaa},
2325 {0x00, 0xd9, 0x11, 0xaa},
2326 {0x00, 0xda, 0x00, 0xaa},
2327 {0x00, 0xd9, 0x12, 0xaa},
2328 {0x00, 0xda, 0xff, 0xaa},
2329 {0x00, 0xd9, 0x13, 0xaa},
2330 {0x00, 0xda, 0xff, 0xaa},
2331 {0x00, 0xe8, 0x11, 0xaa},
2332 {0x00, 0xe9, 0x12, 0xaa},
2333 {0x00, 0xea, 0x5c, 0xaa},
2334 {0x00, 0xeb, 0xff, 0xaa},
2335 {0x00, 0xd8, 0x80, 0xaa},
2336 {0x00, 0xe6, 0x02, 0xaa},
2337 {0x00, 0xd6, 0x40, 0xaa},
2338 {0x00, 0xe3, 0x05, 0xaa},
2339 {0x00, 0xe0, 0x40, 0xaa},
2340 {0x00, 0xde, 0x03, 0xaa},
2341 {0x00, 0xdf, 0x03, 0xaa},
2342 {0x00, 0xdb, 0x02, 0xaa},
2343 {0x00, 0xdc, 0x00, 0xaa},
2344 {0x00, 0xdd, 0x03, 0xaa},
2345 {0x00, 0xe1, 0x08, 0xaa},
2346 {0x00, 0xe2, 0x01, 0xaa},
2347 {0x00, 0xd6, 0x40, 0xaa},
2348 {0x00, 0xe4, 0x40, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002349 {0x00, 0xa8, 0x8f, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002350 {0x00, 0xb4, 0x16, 0xaa},
2351 {0xb0, 0x02, 0x06, 0xcc},
2352 {0xb0, 0x18, 0x06, 0xcc},
2353 {0xb0, 0x19, 0x06, 0xcc},
2354 {0xb3, 0x5d, 0x18, 0xcc},
2355 {0xb3, 0x05, 0x00, 0xcc},
2356 {0xb3, 0x06, 0x00, 0xcc},
2357 {0x00, 0xb4, 0x0e, 0xaa},
2358 {0x00, 0xb5, 0x49, 0xaa},
2359 {0x00, 0xb6, 0x1c, 0xaa},
2360 {0x00, 0xb7, 0x96, 0xaa},
2361/* end of usbvm326.inf - start of ms-win trace */
2362 {0xb6, 0x12, 0xf8, 0xcc},
2363 {0xb6, 0x13, 0x3d, 0xcc},
2364/*read b306*/
2365 {0x00, 0x03, 0x00, 0xaa},
2366 {0x00, 0x1a, 0x09, 0xaa},
2367 {0x00, 0x1b, 0x8a, 0xaa},
2368/*read b827*/
2369 {0xb8, 0x27, 0x00, 0xcc},
2370 {0xb8, 0x26, 0x60, 0xcc},
2371 {0xb8, 0x26, 0x60, 0xcc},
2372/*gamma - to do?*/
2373 {0x00, 0x03, 0x00, 0xaa},
2374 {0x00, 0xae, 0x84, 0xaa},
2375/*gamma again*/
2376 {0x00, 0x03, 0x00, 0xaa},
2377 {0x00, 0x96, 0xa0, 0xaa},
2378/*matrix*/
2379 {0x00, 0x03, 0x00, 0xaa},
2380 {0x00, 0x91, 0x35, 0xaa},
2381 {0x00, 0x92, 0x22, 0xaa},
2382/*gamma*/
2383 {0x00, 0x03, 0x00, 0xaa},
2384 {0x00, 0x95, 0x85, 0xaa},
2385/*matrix*/
2386 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002387 {0x00, 0x4d, 0x20, 0xaa},
2388 {0xb8, 0x22, 0x40, 0xcc},
2389 {0xb8, 0x23, 0x40, 0xcc},
2390 {0xb8, 0x24, 0x40, 0xcc},
2391 {0xb8, 0x81, 0x09, 0xcc},
2392 {0x00, 0x00, 0x64, 0xdd},
2393 {0x00, 0x03, 0x01, 0xaa},
2394/*read 46*/
2395 {0x00, 0x46, 0x3c, 0xaa},
2396 {0x00, 0x03, 0x00, 0xaa},
2397 {0x00, 0x16, 0x40, 0xaa},
2398 {0x00, 0x17, 0x40, 0xaa},
2399 {0x00, 0x18, 0x40, 0xaa},
2400 {0x00, 0x19, 0x41, 0xaa},
2401 {0x00, 0x03, 0x01, 0xaa},
2402 {0x00, 0x46, 0x3c, 0xaa},
2403 {0x00, 0x00, 0x18, 0xdd},
2404/*read bfff*/
2405 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002406 {0x00, 0xb4, 0x1c, 0xaa},
2407 {0x00, 0xb5, 0x92, 0xaa},
2408 {0x00, 0xb6, 0x39, 0xaa},
2409 {0x00, 0xb7, 0x24, 0xaa},
2410/*write 89 0400 1415*/
2411};
2412
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002413struct sensor_info {
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002414 s8 sensorId;
2415 u8 I2cAdd;
2416 u8 IdAdd;
2417 u16 VpId;
2418 u8 m1;
2419 u8 m2;
2420 u8 op;
2421};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002422
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002423static const struct sensor_info sensor_info_data[] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002424/* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002425 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2426 {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2427/* (tested in vc032x_probe_sensor) */
2428/* {-1, 0x80 | 0x20, 0x83, 0x0000, 0x24, 0x25, 0x01}, */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002429 {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002430 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002431/* (tested in vc032x_probe_sensor) */
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002432/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002433 {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2434 {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2435 {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2436 {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2437/* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01}, */
2438 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2439/* {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01}, */
2440/* {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05}, */
2441 {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002442 {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002443 {-1, 0x80 | 0x2d, 0x00, 0x0000, 0x65, 0x67, 0x01},
2444 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2445 {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002446 {SENSOR_MI1320_SOC, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x67, 0x01},
2447/*fixme: previously detected?*/
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002448 {SENSOR_MI1320, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x65, 0x01},
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002449/*fixme: not in the ms-win probe - may be found before?*/
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002450 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002451};
2452
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002453/* read 'len' bytes in gspca_dev->usb_buf */
2454static void reg_r(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002455 u16 req,
2456 u16 index,
2457 u16 len)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002458{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002459 usb_control_msg(gspca_dev->dev,
2460 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002461 req,
2462 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2463 1, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002464 index, gspca_dev->usb_buf, len,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002465 500);
2466}
2467
2468static void reg_w(struct usb_device *dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002469 u16 req,
2470 u16 value,
2471 u16 index)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002472{
2473 usb_control_msg(dev,
2474 usb_sndctrlpipe(dev, 0),
2475 req,
2476 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2477 value, index, NULL, 0,
2478 500);
2479}
2480
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002481static u16 read_sensor_register(struct gspca_dev *gspca_dev,
2482 u16 address)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002483{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002484 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002485 u8 ldata, mdata, hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002486 int retry = 50;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002487
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002488 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002489 if (!(gspca_dev->usb_buf[0] & 0x02)) {
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002490 PDEBUG(D_ERR, "I2c Bus Busy Wait %02x",
2491 gspca_dev->usb_buf[0]);
2492 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002493 }
2494 reg_w(dev, 0xa0, address, 0xb33a);
2495 reg_w(dev, 0xa0, 0x02, 0xb339);
2496
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002497 do {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002498 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002499 if (gspca_dev->usb_buf[0] == 0x00)
2500 break;
2501 msleep(40);
2502 } while (--retry >= 0);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002503
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002504 reg_r(gspca_dev, 0xa1, 0xb33e, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002505 ldata = gspca_dev->usb_buf[0];
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002506 reg_r(gspca_dev, 0xa1, 0xb33d, 1);
2507 mdata = gspca_dev->usb_buf[0];
2508 reg_r(gspca_dev, 0xa1, 0xb33c, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002509 hdata = gspca_dev->usb_buf[0];
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002510 if (hdata != 0 && mdata != 0 && ldata != 0)
2511 PDEBUG(D_PROBE, "Read Sensor %02x%02x %02x",
2512 hdata, mdata, ldata);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002513 reg_r(gspca_dev, 0xa1, 0xb334, 1);
2514 if (gspca_dev->usb_buf[0] == 0x02)
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002515 return (hdata << 8) + mdata;
2516 return hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002517}
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002518
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002519static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
2520{
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002521 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002522 struct usb_device *dev = gspca_dev->dev;
2523 int i;
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002524 u16 value;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002525 const struct sensor_info *ptsensor_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002526
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002527/*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002528 if (sd->flags & FL_SAMSUNG) {
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002529 reg_w(dev, 0xa0, 0x01, 0xb301);
2530 reg_w(dev, 0x89, 0xf0ff, 0xffff); /* select the back sensor */
2531 }
2532
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002533 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002534 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002535 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
2536 ptsensor_info = &sensor_info_data[i];
2537 reg_w(dev, 0xa0, 0x02, 0xb334);
2538 reg_w(dev, 0xa0, ptsensor_info->m1, 0xb300);
2539 reg_w(dev, 0xa0, ptsensor_info->m2, 0xb300);
2540 reg_w(dev, 0xa0, 0x01, 0xb308);
2541 reg_w(dev, 0xa0, 0x0c, 0xb309);
2542 reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002543 reg_w(dev, 0xa0, ptsensor_info->op, 0xb301);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002544 value = read_sensor_register(gspca_dev, ptsensor_info->IdAdd);
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002545 if (value == 0 && ptsensor_info->IdAdd == 0x82)
2546 value = read_sensor_register(gspca_dev, 0x83);
2547 if (value != 0) {
2548 PDEBUG(D_ERR|D_PROBE, "Sensor ID %04x (%d)",
2549 value, i);
2550 if (value == ptsensor_info->VpId)
2551 return ptsensor_info->sensorId;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002552
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002553 switch (value) {
2554 case 0x7673:
2555 return SENSOR_OV7670;
2556 case 0x8243:
2557 return SENSOR_MI0360;
2558 }
2559/*fixme: should return here*/
2560 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002561 }
2562 return -1;
2563}
2564
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002565static void i2c_write(struct gspca_dev *gspca_dev,
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03002566 u8 reg, const u8 *val,
2567 u8 size) /* 1 or 2 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002568{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002569 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002570 int retry;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002571
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002572 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03002573/*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002574 reg_w(dev, 0xa0, size, 0xb334);
2575 reg_w(dev, 0xa0, reg, 0xb33a);
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03002576 reg_w(dev, 0xa0, val[0], 0xb336);
2577 if (size > 1)
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002578 reg_w(dev, 0xa0, val[1], 0xb337);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002579 reg_w(dev, 0xa0, 0x01, 0xb339);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002580 retry = 4;
2581 do {
2582 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
2583 if (gspca_dev->usb_buf[0] == 0)
2584 break;
2585 msleep(20);
2586 } while (--retry > 0);
2587 if (retry <= 0)
2588 PDEBUG(D_ERR, "i2c_write failed");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002589}
2590
2591static void put_tab_to_reg(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002592 const u8 *tab, u8 tabsize, u16 addr)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002593{
2594 int j;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002595 u16 ad = addr;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002596
2597 for (j = 0; j < tabsize; j++)
2598 reg_w(gspca_dev->dev, 0xa0, tab[j], ad++);
2599}
2600
2601static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002602 const u8 data[][4])
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002603{
2604 struct usb_device *dev = gspca_dev->dev;
2605 int i = 0;
2606
2607 for (;;) {
2608 switch (data[i][3]) {
2609 default:
2610 return;
2611 case 0xcc: /* normal write */
2612 reg_w(dev, 0xa0, data[i][2],
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002613 (data[i][0]) << 8 | data[i][1]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002614 break;
2615 case 0xaa: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002616 i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002617 break;
2618 case 0xbb: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002619 i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002620 break;
2621 case 0xdd:
2622 msleep(data[i][2] + 10);
2623 break;
2624 }
2625 i++;
2626 }
2627 /*not reached*/
2628}
2629
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002630
2631/* this function is called at probe time */
2632static int sd_config(struct gspca_dev *gspca_dev,
2633 const struct usb_device_id *id)
2634{
2635 struct sd *sd = (struct sd *) gspca_dev;
2636 struct usb_device *dev = gspca_dev->dev;
2637 struct cam *cam;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002638 int sensor;
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -03002639 static u8 npkt[] = { /* number of packets per ISOC message */
2640 64, /* HV7131R 0 */
2641 32, /* MI0360 1 */
2642 32, /* MI1310_SOC 2 */
2643 64, /* MI1320 3 */
2644 128, /* MI1320_SOC 4 */
2645 32, /* OV7660 5 */
2646 64, /* OV7670 6 */
2647 128, /* PO1200 7 */
2648 128, /* PO3130NC 8 */
2649 };
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002650
2651 cam = &gspca_dev->cam;
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002652 sd->bridge = id->driver_info >> 8;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002653 sd->flags = id->driver_info & 0xff;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002654 sensor = vc032x_probe_sensor(gspca_dev);
2655 switch (sensor) {
2656 case -1:
2657 PDEBUG(D_PROBE, "Unknown sensor...");
2658 return -EINVAL;
2659 case SENSOR_HV7131R:
2660 PDEBUG(D_PROBE, "Find Sensor HV7131R");
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002661 break;
2662 case SENSOR_MI0360:
2663 PDEBUG(D_PROBE, "Find Sensor MI0360");
2664 sd->bridge = BRIDGE_VC0323;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002665 break;
2666 case SENSOR_MI1310_SOC:
2667 PDEBUG(D_PROBE, "Find Sensor MI1310_SOC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002668 break;
2669 case SENSOR_MI1320:
2670 PDEBUG(D_PROBE, "Find Sensor MI1320");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002671 break;
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002672 case SENSOR_MI1320_SOC:
2673 PDEBUG(D_PROBE, "Find Sensor MI1320_SOC");
2674 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002675 case SENSOR_OV7660:
2676 PDEBUG(D_PROBE, "Find Sensor OV7660");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002677 break;
2678 case SENSOR_OV7670:
2679 PDEBUG(D_PROBE, "Find Sensor OV7670");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002680 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002681 case SENSOR_PO1200:
2682 PDEBUG(D_PROBE, "Find Sensor PO1200");
2683 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002684 case SENSOR_PO3130NC:
2685 PDEBUG(D_PROBE, "Find Sensor PO3130NC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002686 break;
2687 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002688 sd->sensor = sensor;
2689
2690 if (sd->bridge == BRIDGE_VC0321) {
2691 cam->cam_mode = vc0321_mode;
2692 cam->nmodes = ARRAY_SIZE(vc0321_mode);
2693 } else {
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002694 switch (sensor) {
2695 case SENSOR_PO1200:
Jean-Francois Moine88521532008-12-10 05:06:13 -03002696 cam->cam_mode = svga_mode;
2697 cam->nmodes = ARRAY_SIZE(svga_mode);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002698 break;
2699 case SENSOR_MI1310_SOC:
2700 cam->cam_mode = vc0323_mode;
Jean-Francois Moine111815e2009-07-27 05:52:27 -03002701 cam->nmodes = ARRAY_SIZE(vc0323_mode);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002702 break;
2703 case SENSOR_MI1320_SOC:
2704 cam->cam_mode = bi_mode;
2705 cam->nmodes = ARRAY_SIZE(bi_mode);
2706 break;
2707 default:
2708 cam->cam_mode = vc0323_mode;
2709 cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
2710 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002711 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002712 }
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -03002713 cam->npkt = npkt[sd->sensor];
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002714
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002715 sd->hflip = HFLIP_DEF;
2716 sd->vflip = VFLIP_DEF;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002717 if (sd->sensor == SENSOR_OV7670)
2718 sd->flags |= FL_HFLIP | FL_VFLIP;
Jean-Francois Moined0d0e392008-07-10 07:06:44 -03002719 sd->lightfreq = FREQ_DEF;
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03002720 if (sd->sensor != SENSOR_OV7670)
2721 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002722 switch (sd->sensor) {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002723 case SENSOR_MI1310_SOC:
2724 case SENSOR_MI1320_SOC:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002725 case SENSOR_OV7660:
2726 case SENSOR_OV7670:
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002727 case SENSOR_PO1200:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002728 break;
2729 default:
2730 gspca_dev->ctrl_dis = (1 << HFLIP_IDX)
2731 | (1 << VFLIP_IDX);
2732 break;
2733 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002734
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002735 sd->sharpness = SHARPNESS_DEF;
2736
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002737 if (sd->bridge == BRIDGE_VC0321) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002738 reg_r(gspca_dev, 0x8a, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002739 reg_w(dev, 0x87, 0x00, 0x0f0f);
2740
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002741 reg_r(gspca_dev, 0x8b, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002742 reg_w(dev, 0x88, 0x00, 0x0202);
2743 }
2744 return 0;
2745}
2746
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002747/* this function is called at probe and resume time */
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03002748static int sd_init(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002749{
2750 return 0;
2751}
2752
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002753/* some sensors only */
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002754static void sethvflip(struct gspca_dev *gspca_dev)
2755{
2756 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002757 u8 data[2], hflip, vflip;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002758
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002759 hflip = sd->hflip;
2760 if (sd->flags & FL_HFLIP)
Jean-Francois Moinebb2c8182009-08-02 06:56:47 -03002761 hflip = !hflip;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002762 vflip = sd->vflip;
2763 if (sd->flags & FL_VFLIP)
Jean-Francois Moinebb2c8182009-08-02 06:56:47 -03002764 vflip = !vflip;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002765 switch (sd->sensor) {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002766 case SENSOR_MI1310_SOC:
2767 case SENSOR_MI1320_SOC:
2768 data[0] = data[1] = 0; /* select page 0 */
2769 i2c_write(gspca_dev, 0xf0, data, 2);
2770 data[0] = sd->sensor == SENSOR_MI1310_SOC ? 0x03 : 0x01;
2771 data[1] = 0x02 * hflip
2772 | 0x01 * vflip;
2773 i2c_write(gspca_dev, 0x20, data, 2);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002774 break;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002775 case SENSOR_OV7660:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002776 case SENSOR_OV7670:
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002777 data[0] = sd->sensor == SENSOR_OV7660 ? 0x01 : 0x07;
2778 data[0] |= OV7660_MVFP_MIRROR * hflip
2779 | OV7660_MVFP_VFLIP * vflip;
2780 i2c_write(gspca_dev, OV7660_REG_MVFP, data, 1);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002781 break;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002782 case SENSOR_PO1200:
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002783 data[0] = 0;
2784 i2c_write(gspca_dev, 0x03, data, 1);
2785 data[0] = 0x80 * hflip
2786 | 0x40 * vflip
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002787 | 0x06;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002788 i2c_write(gspca_dev, 0x1e, data, 1);
2789 break;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002790 }
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002791}
2792
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002793static void setlightfreq(struct gspca_dev *gspca_dev)
2794{
2795 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002796 static const u8 (*ov7660_freq_tb[3])[4] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002797 {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
2798
2799 if (sd->sensor != SENSOR_OV7660)
2800 return;
2801 usb_exchange(gspca_dev, ov7660_freq_tb[sd->lightfreq]);
2802}
2803
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002804/* po1200 only */
2805static void setsharpness(struct gspca_dev *gspca_dev)
2806{
2807 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002808 u8 data;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002809
2810 if (sd->sensor != SENSOR_PO1200)
2811 return;
2812 data = 0;
2813 i2c_write(gspca_dev, 0x03, &data, 1);
2814 data = 0xb5 + sd->sharpness * 3;
2815 i2c_write(gspca_dev, 0x61, &data, 1);
2816}
2817
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002818static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002819{
2820 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002821 const u8 (*init)[4];
2822 const u8 *GammaT = NULL;
2823 const u8 *MatrixT = NULL;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002824 int mode;
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002825 static const u8 (*mi1320_soc_init[])[4] = {
2826 mi1320_soc_InitSXGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002827 mi1320_soc_InitVGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002828 mi1320_soc_InitQVGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002829 };
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002830
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002831/*fixme: back sensor only*/
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03002832 if (sd->flags & FL_SAMSUNG) {
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002833 reg_w(gspca_dev->dev, 0x89, 0xf0ff, 0xffff);
2834 reg_w(gspca_dev->dev, 0xa9, 0x8348, 0x000e);
2835 reg_w(gspca_dev->dev, 0xa9, 0x0000, 0x001a);
2836 }
2837
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002838 /* Assume start use the good resolution from gspca_dev->mode */
2839 if (sd->bridge == BRIDGE_VC0321) {
2840 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfec);
2841 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfed);
2842 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfee);
2843 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002844 sd->image_offset = 46;
2845 } else {
2846 if (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].pixelformat
2847 == V4L2_PIX_FMT_JPEG)
2848 sd->image_offset = 0;
2849 else
2850 sd->image_offset = 32;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002851 }
2852
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03002853 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002854 switch (sd->sensor) {
2855 case SENSOR_HV7131R:
2856 GammaT = hv7131r_gamma;
2857 MatrixT = hv7131r_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002858 if (mode)
2859 init = hv7131r_initQVGA_data; /* 320x240 */
2860 else
2861 init = hv7131r_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002862 break;
2863 case SENSOR_OV7660:
2864 GammaT = ov7660_gamma;
2865 MatrixT = ov7660_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002866 if (mode)
2867 init = ov7660_initQVGA_data; /* 320x240 */
2868 else
2869 init = ov7660_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002870 break;
2871 case SENSOR_OV7670:
2872 /*GammaT = ov7660_gamma; */
2873 /*MatrixT = ov7660_matrix; */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002874 if (mode)
2875 init = ov7670_initQVGA_JPG; /* 320x240 */
2876 else
2877 init = ov7670_initVGA_JPG; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002878 break;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002879 case SENSOR_MI0360:
2880 GammaT = mi1320_gamma;
2881 MatrixT = mi0360_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002882 if (mode)
2883 init = mi0360_initQVGA_JPG; /* 320x240 */
2884 else
2885 init = mi0360_initVGA_JPG; /* 640x480 */
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002886 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002887 case SENSOR_MI1310_SOC:
Jean-Francois Moinea92e9062009-01-29 05:32:23 -03002888 GammaT = mi1320_gamma;
Jean-Francois Moinef985c702009-02-28 08:23:25 -03002889 MatrixT = mi1320_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002890 switch (mode) {
2891 case 1:
2892 init = mi1310_socinitQVGA_JPG; /* 320x240 */
2893 break;
2894 case 0:
2895 init = mi1310_socinitVGA_JPG; /* 640x480 */
2896 break;
2897 default:
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002898 init = mi1310_soc_InitSXGA_JPG; /* 1280x1024 */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002899 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002900 }
2901 break;
2902 case SENSOR_MI1320:
2903 GammaT = mi1320_gamma;
2904 MatrixT = mi1320_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002905 if (mode)
2906 init = mi1320_initQVGA_data; /* 320x240 */
2907 else
2908 init = mi1320_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002909 break;
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002910 case SENSOR_MI1320_SOC:
2911 GammaT = mi1320_gamma;
2912 MatrixT = mi1320_matrix;
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002913 init = mi1320_soc_init[mode];
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002914 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002915 case SENSOR_PO3130NC:
2916 GammaT = po3130_gamma;
2917 MatrixT = po3130_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002918 if (mode)
2919 init = po3130_initQVGA_data; /* 320x240 */
2920 else
2921 init = po3130_initVGA_data; /* 640x480 */
2922 usb_exchange(gspca_dev, init);
2923 init = po3130_rundata;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002924 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002925 default:
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002926/* case SENSOR_PO1200: */
2927 GammaT = po1200_gamma;
2928 MatrixT = po1200_matrix;
2929 init = po1200_initVGA_data;
2930 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002931 }
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002932 usb_exchange(gspca_dev, init);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002933 if (GammaT && MatrixT) {
2934 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
2935 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
2936 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
2937 put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002938
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002939 /* set the led on 0x0892 0x0896 */
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03002940 switch (sd->sensor) {
2941 case SENSOR_PO1200:
2942 case SENSOR_HV7131R:
AceLan Kao4041f6b2009-07-27 05:43:55 -03002943 reg_w(gspca_dev->dev, 0x89, 0x0400, 0x1415);
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03002944 break;
2945 case SENSOR_MI1310_SOC:
AceLan Kao4041f6b2009-07-27 05:43:55 -03002946 reg_w(gspca_dev->dev, 0x89, 0x058c, 0x0000);
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03002947 break;
2948 default:
Jean-Francois Moineba624ce2009-09-03 13:46:59 -03002949 if (!(sd->flags & FL_SAMSUNG))
2950 reg_w(gspca_dev->dev, 0x89, 0xffff, 0xfdff);
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03002951 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002952 }
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03002953 msleep(100);
2954 setsharpness(gspca_dev);
2955 sethvflip(gspca_dev);
2956 setlightfreq(gspca_dev);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002957 }
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002958 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002959}
2960
2961static void sd_stopN(struct gspca_dev *gspca_dev)
2962{
2963 struct usb_device *dev = gspca_dev->dev;
AceLan Kao4041f6b2009-07-27 05:43:55 -03002964 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002965
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002966 if (sd->sensor == SENSOR_MI1310_SOC)
AceLan Kao4041f6b2009-07-27 05:43:55 -03002967 reg_w(dev, 0x89, 0x058c, 0x00ff);
Jean-Francois Moineba624ce2009-09-03 13:46:59 -03002968 else if (!(sd->flags & FL_SAMSUNG))
AceLan Kao4041f6b2009-07-27 05:43:55 -03002969 reg_w(dev, 0x89, 0xffff, 0xffff);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002970 reg_w(dev, 0xa0, 0x01, 0xb301);
2971 reg_w(dev, 0xa0, 0x09, 0xb003);
2972}
2973
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002974/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002975static void sd_stop0(struct gspca_dev *gspca_dev)
2976{
2977 struct usb_device *dev = gspca_dev->dev;
AceLan Kao4041f6b2009-07-27 05:43:55 -03002978 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002979
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002980 if (!gspca_dev->present)
2981 return;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002982/*fixme: is this useful?*/
2983 if (sd->sensor == SENSOR_MI1310_SOC)
AceLan Kao4041f6b2009-07-27 05:43:55 -03002984 reg_w(dev, 0x89, 0x058c, 0x00ff);
Jean-Francois Moineba624ce2009-09-03 13:46:59 -03002985 else if (!(sd->flags & FL_SAMSUNG))
AceLan Kao4041f6b2009-07-27 05:43:55 -03002986 reg_w(dev, 0x89, 0xffff, 0xffff);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002987}
2988
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002989static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002990 u8 *data, /* isoc packet */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002991 int len) /* iso pkt length */
2992{
2993 struct sd *sd = (struct sd *) gspca_dev;
2994
2995 if (data[0] == 0xff && data[1] == 0xd8) {
2996 PDEBUG(D_PACK,
2997 "vc032x header packet found len %d", len);
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03002998 gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03002999 data += sd->image_offset;
3000 len -= sd->image_offset;
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003001 gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003002 return;
3003 }
Hans de Goeded473a002008-12-11 05:02:18 -03003004
3005 /* The vc0321 sends some additional data after sending the complete
3006 * frame, we ignore this. */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003007 if (sd->bridge == BRIDGE_VC0321) {
3008 struct gspca_frame *frame;
3009 int l;
3010
3011 frame = gspca_get_i_frame(gspca_dev);
Jean-Francois Moine95018432009-12-26 08:41:17 -03003012 if (frame == NULL) {
3013 gspca_dev->last_packet_type = DISCARD_PACKET;
3014 return;
3015 }
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003016 l = frame->data_end - frame->data;
3017 if (len > frame->v4l2_buf.length - l)
3018 len = frame->v4l2_buf.length - l;
3019 }
3020 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003021}
3022
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003023static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val)
3024{
3025 struct sd *sd = (struct sd *) gspca_dev;
3026
3027 sd->hflip = val;
3028 if (gspca_dev->streaming)
3029 sethvflip(gspca_dev);
3030 return 0;
3031}
3032
3033static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val)
3034{
3035 struct sd *sd = (struct sd *) gspca_dev;
3036
3037 *val = sd->hflip;
3038 return 0;
3039}
3040
3041static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val)
3042{
3043 struct sd *sd = (struct sd *) gspca_dev;
3044
3045 sd->vflip = val;
3046 if (gspca_dev->streaming)
3047 sethvflip(gspca_dev);
3048 return 0;
3049}
3050
3051static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val)
3052{
3053 struct sd *sd = (struct sd *) gspca_dev;
3054
3055 *val = sd->vflip;
3056 return 0;
3057}
3058
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003059static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
3060{
3061 struct sd *sd = (struct sd *) gspca_dev;
3062
3063 sd->lightfreq = val;
3064 if (gspca_dev->streaming)
3065 setlightfreq(gspca_dev);
3066 return 0;
3067}
3068
3069static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
3070{
3071 struct sd *sd = (struct sd *) gspca_dev;
3072
3073 *val = sd->lightfreq;
3074 return 0;
3075}
3076
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003077static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
3078{
3079 struct sd *sd = (struct sd *) gspca_dev;
3080
3081 sd->sharpness = val;
3082 if (gspca_dev->streaming)
3083 setsharpness(gspca_dev);
3084 return 0;
3085}
3086
3087static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
3088{
3089 struct sd *sd = (struct sd *) gspca_dev;
3090
3091 *val = sd->sharpness;
3092 return 0;
3093}
3094
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003095static int sd_querymenu(struct gspca_dev *gspca_dev,
3096 struct v4l2_querymenu *menu)
3097{
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003098 static const char *freq_nm[3] = {"NoFliker", "50 Hz", "60 Hz"};
3099
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003100 switch (menu->id) {
3101 case V4L2_CID_POWER_LINE_FREQUENCY:
Jean-Francois Moine6afd2aa2009-11-24 06:13:28 -03003102 if (menu->index >= ARRAY_SIZE(freq_nm))
3103 break;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003104 strcpy((char *) menu->name, freq_nm[menu->index]);
3105 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003106 }
3107 return -EINVAL;
3108}
3109
3110/* sub-driver description */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003111static const struct sd_desc sd_desc = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003112 .name = MODULE_NAME,
3113 .ctrls = sd_ctrls,
3114 .nctrls = ARRAY_SIZE(sd_ctrls),
3115 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03003116 .init = sd_init,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003117 .start = sd_start,
3118 .stopN = sd_stopN,
3119 .stop0 = sd_stop0,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003120 .pkt_scan = sd_pkt_scan,
3121 .querymenu = sd_querymenu,
3122};
3123
3124/* -- module initialisation -- */
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003125#define BF(bridge, flags) \
3126 .driver_info = (BRIDGE_ ## bridge << 8) \
3127 | (flags)
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003128static const __devinitdata struct usb_device_id device_table[] = {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003129 {USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)},
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003130 {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
3131 {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
3132 {USB_DEVICE(0x046d, 0x0897), BF(VC0321, 0)},
3133 {USB_DEVICE(0x0ac8, 0x0321), BF(VC0321, 0)},
3134 {USB_DEVICE(0x0ac8, 0x0323), BF(VC0323, 0)},
3135 {USB_DEVICE(0x0ac8, 0x0328), BF(VC0321, 0)},
3136 {USB_DEVICE(0x0ac8, 0xc001), BF(VC0321, 0)},
3137 {USB_DEVICE(0x0ac8, 0xc002), BF(VC0321, 0)},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003138 {USB_DEVICE(0x0ac8, 0xc301), BF(VC0323, FL_SAMSUNG)},
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003139 {USB_DEVICE(0x15b8, 0x6001), BF(VC0323, 0)},
3140 {USB_DEVICE(0x15b8, 0x6002), BF(VC0323, 0)},
3141 {USB_DEVICE(0x17ef, 0x4802), BF(VC0323, 0)},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003142 {}
3143};
3144MODULE_DEVICE_TABLE(usb, device_table);
3145
3146/* -- device connect -- */
3147static int sd_probe(struct usb_interface *intf,
3148 const struct usb_device_id *id)
3149{
3150 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
3151 THIS_MODULE);
3152}
3153
3154static struct usb_driver sd_driver = {
3155 .name = MODULE_NAME,
3156 .id_table = device_table,
3157 .probe = sd_probe,
3158 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03003159#ifdef CONFIG_PM
3160 .suspend = gspca_suspend,
3161 .resume = gspca_resume,
3162#endif
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003163};
3164
3165/* -- module insert / remove -- */
3166static int __init sd_mod_init(void)
3167{
Alexey Klimovf69e9522009-01-01 13:02:07 -03003168 int ret;
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003169
Alexey Klimovf69e9522009-01-01 13:02:07 -03003170 ret = usb_register(&sd_driver);
3171 if (ret < 0)
Alexey Klimove6b14842009-01-01 13:04:58 -03003172 return ret;
Jean-Francois Moine10b0e962008-07-22 05:35:10 -03003173 PDEBUG(D_PROBE, "registered");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003174 return 0;
3175}
3176static void __exit sd_mod_exit(void)
3177{
3178 usb_deregister(&sd_driver);
3179 PDEBUG(D_PROBE, "deregistered");
3180}
3181
3182module_init(sd_mod_init);
3183module_exit(sd_mod_exit);