blob: 588a847ea483450864268041bb67a1f50126abdf [file] [log] [blame]
Thomas Gleixnerfd9871f2019-05-19 15:51:54 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002/*
Jean-François Moine27c6f9e2010-04-02 06:59:13 -03003 * Z-star vc0321 library
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03004 *
Jean-François Moine27c6f9e2010-04-02 06:59:13 -03005 * Copyright (C) 2009-2010 Jean-François Moine <http://moinejf.free.fr>
6 * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
7 * Copyright (C) 2006 Michel Xhaard
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03008 */
9
Joe Perches133a9fe2011-08-21 19:56:57 -030010#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030012#define MODULE_NAME "vc032x"
13
14#include "gspca.h"
15
Jean-François Moine27c6f9e2010-04-02 06:59:13 -030016MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030017MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
18MODULE_LICENSE("GPL");
19
20/* specific webcam descriptor */
21struct sd {
22 struct gspca_dev gspca_dev; /* !! must be the first item */
Hans Verkuil930806c2012-05-18 06:45:30 -030023 struct { /* hvflip cluster */
24 struct v4l2_ctrl *hflip;
25 struct v4l2_ctrl *vflip;
26 };
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030027
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030028 u8 image_offset;
29
Jean-Francois Moine8b605f12009-07-27 06:28:37 -030030 u8 bridge;
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -030031 u8 sensor;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -030032 u8 flags;
33#define FL_SAMSUNG 0x01 /* SamsungQ1 (2 sensors) */
34#define FL_HFLIP 0x02 /* mirrored by default */
35#define FL_VFLIP 0x04 /* vertical flipped by default */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030036};
Jean-François Moine7e5f9052010-12-28 07:24:18 -030037enum bridges {
38 BRIDGE_VC0321,
39 BRIDGE_VC0323,
40};
41enum sensors {
42 SENSOR_HV7131R,
43 SENSOR_MI0360,
44 SENSOR_MI1310_SOC,
45 SENSOR_MI1320,
46 SENSOR_MI1320_SOC,
47 SENSOR_OV7660,
48 SENSOR_OV7670,
49 SENSOR_PO1200,
50 SENSOR_PO3130NC,
51 SENSOR_POxxxx,
52 NSENSORS
53};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030054
Jean-Francois Moine83c94a12009-12-26 16:07:24 -030055
Jean-Francois Moinecc611b82008-12-29 07:49:41 -030056static const struct v4l2_pix_format vc0321_mode[] = {
Jean-Francois Moine20122542008-09-03 17:12:20 -030057 {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Luca Bonissi91de062f2015-01-26 07:38:17 -030058 .bytesperline = 320 * 2,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -030059 .sizeimage = 320 * 240 * 2,
60 .colorspace = V4L2_COLORSPACE_SRGB,
61 .priv = 1},
Jean-Francois Moine20122542008-09-03 17:12:20 -030062 {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Luca Bonissi91de062f2015-01-26 07:38:17 -030063 .bytesperline = 640 * 2,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -030064 .sizeimage = 640 * 480 * 2,
65 .colorspace = V4L2_COLORSPACE_SRGB,
66 .priv = 0},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030067};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -030068static const struct v4l2_pix_format vc0323_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -030069 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
70 .bytesperline = 320,
71 .sizeimage = 320 * 240 * 3 / 8 + 590,
72 .colorspace = V4L2_COLORSPACE_JPEG,
73 .priv = 1},
74 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
75 .bytesperline = 640,
76 .sizeimage = 640 * 480 * 3 / 8 + 590,
77 .colorspace = V4L2_COLORSPACE_JPEG,
78 .priv = 0},
Jean-Francois Moine111815e2009-07-27 05:52:27 -030079 {1280, 960, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -030080 .bytesperline = 1280,
Jean-Francois Moine111815e2009-07-27 05:52:27 -030081 .sizeimage = 1280 * 960 * 3 / 8 + 590,
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -030082 .colorspace = V4L2_COLORSPACE_JPEG,
83 .priv = 2},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030084};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030085static const struct v4l2_pix_format bi_mode[] = {
Jean-Francois Moine2c956102009-05-05 04:59:45 -030086 {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Luca Bonissi91de062f2015-01-26 07:38:17 -030087 .bytesperline = 320 * 2,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030088 .sizeimage = 320 * 240 * 2,
89 .colorspace = V4L2_COLORSPACE_SRGB,
Jean-Francois Moine51412aa2009-03-26 06:03:28 -030090 .priv = 2},
Jean-Francois Moine2c956102009-05-05 04:59:45 -030091 {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Luca Bonissi91de062f2015-01-26 07:38:17 -030092 .bytesperline = 640 * 2,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030093 .sizeimage = 640 * 480 * 2,
94 .colorspace = V4L2_COLORSPACE_SRGB,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030095 .priv = 1},
Jean-Francois Moine2c956102009-05-05 04:59:45 -030096 {1280, 1024, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
Luca Bonissi91de062f2015-01-26 07:38:17 -030097 .bytesperline = 1280 * 2,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -030098 .sizeimage = 1280 * 1024 * 2,
99 .colorspace = V4L2_COLORSPACE_SRGB,
100 .priv = 0},
101};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300102static const struct v4l2_pix_format svga_mode[] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -0300103 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
104 .bytesperline = 800,
105 .sizeimage = 800 * 600 * 1 / 4 + 590,
106 .colorspace = V4L2_COLORSPACE_JPEG,
107 .priv = 0},
108};
109
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -0300110/* OV7660/7670 registers */
111#define OV7660_REG_MVFP 0x1e
112#define OV7660_MVFP_MIRROR 0x20
113#define OV7660_MVFP_VFLIP 0x10
114
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300115static const u8 mi0360_matrix[9] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300116 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
117};
118
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300119static const u8 mi0360_initVGA_JPG[][4] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300120 {0xb0, 0x03, 0x19, 0xcc},
121 {0xb0, 0x04, 0x02, 0xcc},
122 {0xb3, 0x00, 0x24, 0xcc},
123 {0xb3, 0x00, 0x25, 0xcc},
124 {0xb3, 0x08, 0x01, 0xcc},
125 {0xb3, 0x09, 0x0c, 0xcc},
126 {0xb3, 0x05, 0x01, 0xcc},
127 {0xb3, 0x06, 0x03, 0xcc},
128 {0xb3, 0x03, 0x0a, 0xcc},
129 {0xb3, 0x20, 0x00, 0xcc},
130 {0xb3, 0x21, 0x00, 0xcc},
131 {0xb3, 0x22, 0x01, 0xcc},
132 {0xb3, 0x23, 0xe0, 0xcc},
133 {0xb3, 0x04, 0x05, 0xcc},
134 {0xb3, 0x14, 0x00, 0xcc},
135 {0xb3, 0x15, 0x00, 0xcc},
136 {0xb3, 0x16, 0x02, 0xcc},
137 {0xb3, 0x17, 0x7f, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -0300138 {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300139 {0xb3, 0x34, 0x02, 0xcc},
140 {0xb3, 0x00, 0x25, 0xcc},
141 {0xbc, 0x00, 0x71, 0xcc},
142 {0xb8, 0x00, 0x13, 0xcc},
143 {0xb8, 0x27, 0x20, 0xcc},
144 {0xb8, 0x2c, 0x50, 0xcc},
145 {0xb8, 0x2d, 0xf8, 0xcc},
146 {0xb8, 0x2e, 0xf8, 0xcc},
147 {0xb8, 0x2f, 0xf8, 0xcc},
148 {0xb8, 0x30, 0x50, 0xcc},
149 {0xb8, 0x31, 0xf8, 0xcc},
150 {0xb8, 0x32, 0xf8, 0xcc},
151 {0xb8, 0x33, 0xf8, 0xcc},
152 {0xb8, 0x34, 0x50, 0xcc},
153 {0xb8, 0x35, 0x00, 0xcc},
154 {0xb8, 0x36, 0x00, 0xcc},
155 {0xb8, 0x37, 0x00, 0xcc},
156 {0xb8, 0x01, 0x79, 0xcc},
157 {0xb8, 0x08, 0xe0, 0xcc},
158 {0xb3, 0x01, 0x41, 0xcc},
159 {0xb8, 0x01, 0x79, 0xcc},
160 {0xb8, 0x14, 0x18, 0xcc},
161 {0xb8, 0xb2, 0x0a, 0xcc},
162 {0xb8, 0xb4, 0x0a, 0xcc},
163 {0xb8, 0xb5, 0x0a, 0xcc},
164 {0xb8, 0xfe, 0x00, 0xcc},
165 {0xb8, 0xff, 0x28, 0xcc},
166 {0xb9, 0x00, 0x28, 0xcc},
167 {0xb9, 0x01, 0x28, 0xcc},
168 {0xb9, 0x02, 0x28, 0xcc},
169 {0xb9, 0x03, 0x00, 0xcc},
170 {0xb9, 0x04, 0x00, 0xcc},
171 {0xb9, 0x05, 0x3c, 0xcc},
172 {0xb9, 0x06, 0x3c, 0xcc},
173 {0xb9, 0x07, 0x3c, 0xcc},
174 {0xb9, 0x08, 0x3c, 0xcc},
175 {0xb8, 0x8e, 0x00, 0xcc},
176 {0xb8, 0x8f, 0xff, 0xcc},
177 {0xb8, 0x81, 0x09, 0xcc},
178 {0x31, 0x00, 0x00, 0xbb},
179 {0x09, 0x01, 0xc7, 0xbb},
180 {0x34, 0x01, 0x00, 0xbb},
181 {0x2b, 0x00, 0x28, 0xbb},
182 {0x2c, 0x00, 0x30, 0xbb},
183 {0x2d, 0x00, 0x30, 0xbb},
184 {0x2e, 0x00, 0x28, 0xbb},
185 {0x62, 0x04, 0x11, 0xbb},
186 {0x03, 0x01, 0xe0, 0xbb},
187 {0x2c, 0x00, 0x2c, 0xbb},
188 {0x20, 0xd0, 0x00, 0xbb},
189 {0x01, 0x00, 0x08, 0xbb},
190 {0x06, 0x00, 0x10, 0xbb},
191 {0x05, 0x00, 0x20, 0xbb},
192 {0x20, 0x00, 0x00, 0xbb},
193 {0xb6, 0x00, 0x00, 0xcc},
194 {0xb6, 0x03, 0x02, 0xcc},
195 {0xb6, 0x02, 0x80, 0xcc},
196 {0xb6, 0x05, 0x01, 0xcc},
197 {0xb6, 0x04, 0xe0, 0xcc},
198 {0xb6, 0x12, 0x78, 0xcc},
199 {0xb6, 0x18, 0x02, 0xcc},
200 {0xb6, 0x17, 0x58, 0xcc},
201 {0xb6, 0x16, 0x00, 0xcc},
202 {0xb6, 0x22, 0x12, 0xcc},
203 {0xb6, 0x23, 0x0b, 0xcc},
204 {0xb3, 0x02, 0x02, 0xcc},
205 {0xbf, 0xc0, 0x39, 0xcc},
206 {0xbf, 0xc1, 0x04, 0xcc},
207 {0xbf, 0xcc, 0x10, 0xcc},
208 {0xb9, 0x12, 0x00, 0xcc},
209 {0xb9, 0x13, 0x0a, 0xcc},
210 {0xb9, 0x14, 0x0a, 0xcc},
211 {0xb9, 0x15, 0x0a, 0xcc},
212 {0xb9, 0x16, 0x0a, 0xcc},
213 {0xb9, 0x18, 0x00, 0xcc},
214 {0xb9, 0x19, 0x0f, 0xcc},
215 {0xb9, 0x1a, 0x0f, 0xcc},
216 {0xb9, 0x1b, 0x0f, 0xcc},
217 {0xb9, 0x1c, 0x0f, 0xcc},
218 {0xb8, 0x8e, 0x00, 0xcc},
219 {0xb8, 0x8f, 0xff, 0xcc},
220 {0xb6, 0x12, 0xf8, 0xcc},
221 {0xb8, 0x0c, 0x20, 0xcc},
222 {0xb8, 0x0d, 0x70, 0xcc},
223 {0xb6, 0x13, 0x13, 0xcc},
224 {0x35, 0x00, 0x60, 0xbb},
225 {0xb3, 0x5c, 0x01, 0xcc},
226 {}
227};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300228static const u8 mi0360_initQVGA_JPG[][4] = {
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300229 {0xb0, 0x03, 0x19, 0xcc},
230 {0xb0, 0x04, 0x02, 0xcc},
231 {0xb3, 0x00, 0x24, 0xcc},
232 {0xb3, 0x00, 0x25, 0xcc},
233 {0xb3, 0x08, 0x01, 0xcc},
234 {0xb3, 0x09, 0x0c, 0xcc},
235 {0xb3, 0x05, 0x01, 0xcc},
236 {0xb3, 0x06, 0x03, 0xcc},
237 {0xb3, 0x03, 0x0a, 0xcc},
238 {0xb3, 0x20, 0x00, 0xcc},
239 {0xb3, 0x21, 0x00, 0xcc},
240 {0xb3, 0x22, 0x01, 0xcc},
241 {0xb3, 0x23, 0xe0, 0xcc},
242 {0xb3, 0x04, 0x05, 0xcc},
243 {0xb3, 0x14, 0x00, 0xcc},
244 {0xb3, 0x15, 0x00, 0xcc},
245 {0xb3, 0x16, 0x02, 0xcc},
246 {0xb3, 0x17, 0x7f, 0xcc},
247 {0xb3, 0x35, 0xdd, 0xcc},
248 {0xb3, 0x34, 0x02, 0xcc},
249 {0xb3, 0x00, 0x25, 0xcc},
250 {0xbc, 0x00, 0xd1, 0xcc},
251 {0xb8, 0x00, 0x13, 0xcc},
252 {0xb8, 0x27, 0x20, 0xcc},
253 {0xb8, 0x2c, 0x50, 0xcc},
254 {0xb8, 0x2d, 0xf8, 0xcc},
255 {0xb8, 0x2e, 0xf8, 0xcc},
256 {0xb8, 0x2f, 0xf8, 0xcc},
257 {0xb8, 0x30, 0x50, 0xcc},
258 {0xb8, 0x31, 0xf8, 0xcc},
259 {0xb8, 0x32, 0xf8, 0xcc},
260 {0xb8, 0x33, 0xf8, 0xcc},
261 {0xb8, 0x34, 0x50, 0xcc},
262 {0xb8, 0x35, 0x00, 0xcc},
263 {0xb8, 0x36, 0x00, 0xcc},
264 {0xb8, 0x37, 0x00, 0xcc},
265 {0xb8, 0x01, 0x79, 0xcc},
266 {0xb8, 0x08, 0xe0, 0xcc},
267 {0xb3, 0x01, 0x41, 0xcc},
268 {0xb8, 0x01, 0x79, 0xcc},
269 {0xb8, 0x14, 0x18, 0xcc},
270 {0xb8, 0xb2, 0x0a, 0xcc},
271 {0xb8, 0xb4, 0x0a, 0xcc},
272 {0xb8, 0xb5, 0x0a, 0xcc},
273 {0xb8, 0xfe, 0x00, 0xcc},
274 {0xb8, 0xff, 0x28, 0xcc},
275 {0xb9, 0x00, 0x28, 0xcc},
276 {0xb9, 0x01, 0x28, 0xcc},
277 {0xb9, 0x02, 0x28, 0xcc},
278 {0xb9, 0x03, 0x00, 0xcc},
279 {0xb9, 0x04, 0x00, 0xcc},
280 {0xb9, 0x05, 0x3c, 0xcc},
281 {0xb9, 0x06, 0x3c, 0xcc},
282 {0xb9, 0x07, 0x3c, 0xcc},
283 {0xb9, 0x08, 0x3c, 0xcc},
284 {0xb8, 0x8e, 0x00, 0xcc},
285 {0xb8, 0x8f, 0xff, 0xcc},
286 {0xb8, 0x81, 0x09, 0xcc},
287 {0x31, 0x00, 0x00, 0xbb},
288 {0x09, 0x01, 0xc7, 0xbb},
289 {0x34, 0x01, 0x00, 0xbb},
290 {0x2b, 0x00, 0x28, 0xbb},
291 {0x2c, 0x00, 0x30, 0xbb},
292 {0x2d, 0x00, 0x30, 0xbb},
293 {0x2e, 0x00, 0x28, 0xbb},
294 {0x62, 0x04, 0x11, 0xbb},
295 {0x03, 0x01, 0xe0, 0xbb},
296 {0x2c, 0x00, 0x2c, 0xbb},
297 {0x20, 0xd0, 0x00, 0xbb},
298 {0x01, 0x00, 0x08, 0xbb},
299 {0x06, 0x00, 0x10, 0xbb},
300 {0x05, 0x00, 0x20, 0xbb},
301 {0x20, 0x00, 0x00, 0xbb},
302 {0xb6, 0x00, 0x00, 0xcc},
303 {0xb6, 0x03, 0x01, 0xcc},
304 {0xb6, 0x02, 0x40, 0xcc},
305 {0xb6, 0x05, 0x00, 0xcc},
306 {0xb6, 0x04, 0xf0, 0xcc},
307 {0xb6, 0x12, 0x78, 0xcc},
308 {0xb6, 0x18, 0x00, 0xcc},
309 {0xb6, 0x17, 0x96, 0xcc},
310 {0xb6, 0x16, 0x00, 0xcc},
311 {0xb6, 0x22, 0x12, 0xcc},
312 {0xb6, 0x23, 0x0b, 0xcc},
313 {0xb3, 0x02, 0x02, 0xcc},
314 {0xbf, 0xc0, 0x39, 0xcc},
315 {0xbf, 0xc1, 0x04, 0xcc},
316 {0xbf, 0xcc, 0x10, 0xcc},
317 {0xb9, 0x12, 0x00, 0xcc},
318 {0xb9, 0x13, 0x0a, 0xcc},
319 {0xb9, 0x14, 0x0a, 0xcc},
320 {0xb9, 0x15, 0x0a, 0xcc},
321 {0xb9, 0x16, 0x0a, 0xcc},
322 {0xb9, 0x18, 0x00, 0xcc},
323 {0xb9, 0x19, 0x0f, 0xcc},
324 {0xb9, 0x1a, 0x0f, 0xcc},
325 {0xb9, 0x1b, 0x0f, 0xcc},
326 {0xb9, 0x1c, 0x0f, 0xcc},
327 {0xb8, 0x8e, 0x00, 0xcc},
328 {0xb8, 0x8f, 0xff, 0xcc},
329 {0xb6, 0x12, 0xf8, 0xcc},
330 {0xb6, 0x13, 0x13, 0xcc},
331 {0xbc, 0x02, 0x18, 0xcc},
332 {0xbc, 0x03, 0x50, 0xcc},
333 {0xbc, 0x04, 0x18, 0xcc},
334 {0xbc, 0x05, 0x00, 0xcc},
335 {0xbc, 0x06, 0x00, 0xcc},
336 {0xbc, 0x08, 0x30, 0xcc},
337 {0xbc, 0x09, 0x40, 0xcc},
338 {0xbc, 0x0a, 0x10, 0xcc},
339 {0xb8, 0x0c, 0x20, 0xcc},
340 {0xb8, 0x0d, 0x70, 0xcc},
341 {0xbc, 0x0b, 0x00, 0xcc},
342 {0xbc, 0x0c, 0x00, 0xcc},
343 {0x35, 0x00, 0xef, 0xbb},
344 {0xb3, 0x5c, 0x01, 0xcc},
345 {}
346};
347
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300348static const u8 mi1310_socinitVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300349 {0xb0, 0x03, 0x19, 0xcc},
350 {0xb0, 0x04, 0x02, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300351 {0xb3, 0x00, 0x64, 0xcc},
352 {0xb3, 0x00, 0x65, 0xcc},
353 {0xb3, 0x05, 0x00, 0xcc},
354 {0xb3, 0x06, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300355 {0xb3, 0x08, 0x01, 0xcc},
356 {0xb3, 0x09, 0x0c, 0xcc},
357 {0xb3, 0x34, 0x02, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -0300358 {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
AceLan Kao4041f6b2009-07-27 05:43:55 -0300359 {0xb3, 0x02, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300360 {0xb3, 0x03, 0x0a, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300361 {0xb3, 0x04, 0x05, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300362 {0xb3, 0x20, 0x00, 0xcc},
363 {0xb3, 0x21, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300364 {0xb3, 0x22, 0x03, 0xcc},
365 {0xb3, 0x23, 0xc0, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300366 {0xb3, 0x14, 0x00, 0xcc},
367 {0xb3, 0x15, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300368 {0xb3, 0x16, 0x04, 0xcc},
369 {0xb3, 0x17, 0xff, 0xcc},
370 {0xb3, 0x00, 0x65, 0xcc},
371 {0xb8, 0x00, 0x00, 0xcc},
372 {0xbc, 0x00, 0xd0, 0xcc},
373 {0xbc, 0x01, 0x01, 0xcc},
374 {0xf0, 0x00, 0x02, 0xbb},
375 {0xc8, 0x9f, 0x0b, 0xbb},
376 {0x5b, 0x00, 0x01, 0xbb},
377 {0x2f, 0xde, 0x20, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300378 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300379 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300380 {0xf0, 0x00, 0x01, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300381 {0x05, 0x00, 0x07, 0xbb},
382 {0x34, 0x00, 0x00, 0xbb},
383 {0x35, 0xff, 0x00, 0xbb},
384 {0xdc, 0x07, 0x02, 0xbb},
385 {0xdd, 0x3c, 0x18, 0xbb},
386 {0xde, 0x92, 0x6d, 0xbb},
387 {0xdf, 0xcd, 0xb1, 0xbb},
388 {0xe0, 0xff, 0xe7, 0xbb},
389 {0x06, 0xf0, 0x0d, 0xbb},
390 {0x06, 0x70, 0x0e, 0xbb},
391 {0x4c, 0x00, 0x01, 0xbb},
392 {0x4d, 0x00, 0x01, 0xbb},
393 {0xf0, 0x00, 0x02, 0xbb},
394 {0x2e, 0x0c, 0x55, 0xbb},
395 {0x21, 0xb6, 0x6e, 0xbb},
396 {0x36, 0x30, 0x10, 0xbb},
397 {0x37, 0x00, 0xc1, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300398 {0xf0, 0x00, 0x00, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300399 {0x07, 0x00, 0x84, 0xbb},
400 {0x08, 0x02, 0x4a, 0xbb},
401 {0x05, 0x01, 0x10, 0xbb},
402 {0x06, 0x00, 0x39, 0xbb},
403 {0xf0, 0x00, 0x02, 0xbb},
404 {0x58, 0x02, 0x67, 0xbb},
405 {0x57, 0x02, 0x00, 0xbb},
406 {0x5a, 0x02, 0x67, 0xbb},
407 {0x59, 0x02, 0x00, 0xbb},
408 {0x5c, 0x12, 0x0d, 0xbb},
409 {0x5d, 0x16, 0x11, 0xbb},
410 {0x39, 0x06, 0x18, 0xbb},
411 {0x3a, 0x06, 0x18, 0xbb},
412 {0x3b, 0x06, 0x18, 0xbb},
413 {0x3c, 0x06, 0x18, 0xbb},
414 {0x64, 0x7b, 0x5b, 0xbb},
415 {0xf0, 0x00, 0x02, 0xbb},
416 {0x36, 0x30, 0x10, 0xbb},
417 {0x37, 0x00, 0xc0, 0xbb},
418 {0xbc, 0x0e, 0x00, 0xcc},
419 {0xbc, 0x0f, 0x05, 0xcc},
420 {0xbc, 0x10, 0xc0, 0xcc},
421 {0xbc, 0x11, 0x03, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300422 {0xb6, 0x00, 0x00, 0xcc},
423 {0xb6, 0x03, 0x02, 0xcc},
424 {0xb6, 0x02, 0x80, 0xcc},
425 {0xb6, 0x05, 0x01, 0xcc},
426 {0xb6, 0x04, 0xe0, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300427 {0xb6, 0x12, 0xf8, 0xcc},
428 {0xb6, 0x13, 0x25, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300429 {0xb6, 0x18, 0x02, 0xcc},
430 {0xb6, 0x17, 0x58, 0xcc},
431 {0xb6, 0x16, 0x00, 0xcc},
432 {0xb6, 0x22, 0x12, 0xcc},
433 {0xb6, 0x23, 0x0b, 0xcc},
434 {0xbf, 0xc0, 0x39, 0xcc},
435 {0xbf, 0xc1, 0x04, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300436 {0xbf, 0xcc, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300437 {0xbc, 0x02, 0x18, 0xcc},
438 {0xbc, 0x03, 0x50, 0xcc},
439 {0xbc, 0x04, 0x18, 0xcc},
440 {0xbc, 0x05, 0x00, 0xcc},
441 {0xbc, 0x06, 0x00, 0xcc},
442 {0xbc, 0x08, 0x30, 0xcc},
443 {0xbc, 0x09, 0x40, 0xcc},
444 {0xbc, 0x0a, 0x10, 0xcc},
445 {0xbc, 0x0b, 0x00, 0xcc},
446 {0xbc, 0x0c, 0x00, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300447 {0xb3, 0x5c, 0x01, 0xcc},
448 {0xf0, 0x00, 0x01, 0xbb},
449 {0x80, 0x00, 0x03, 0xbb},
450 {0x81, 0xc7, 0x14, 0xbb},
451 {0x82, 0xeb, 0xe8, 0xbb},
452 {0x83, 0xfe, 0xf4, 0xbb},
453 {0x84, 0xcd, 0x10, 0xbb},
454 {0x85, 0xf3, 0xee, 0xbb},
455 {0x86, 0xff, 0xf1, 0xbb},
456 {0x87, 0xcd, 0x10, 0xbb},
457 {0x88, 0xf3, 0xee, 0xbb},
458 {0x89, 0x01, 0xf1, 0xbb},
459 {0x8a, 0xe5, 0x17, 0xbb},
460 {0x8b, 0xe8, 0xe2, 0xbb},
461 {0x8c, 0xf7, 0xed, 0xbb},
462 {0x8d, 0x00, 0xff, 0xbb},
463 {0x8e, 0xec, 0x10, 0xbb},
464 {0x8f, 0xf0, 0xed, 0xbb},
465 {0x90, 0xf9, 0xf2, 0xbb},
466 {0x91, 0x00, 0x00, 0xbb},
467 {0x92, 0xe9, 0x0d, 0xbb},
468 {0x93, 0xf4, 0xf2, 0xbb},
469 {0x94, 0xfb, 0xf5, 0xbb},
470 {0x95, 0x00, 0xff, 0xbb},
471 {0xb6, 0x0f, 0x08, 0xbb},
472 {0xb7, 0x3d, 0x16, 0xbb},
473 {0xb8, 0x0c, 0x04, 0xbb},
474 {0xb9, 0x1c, 0x07, 0xbb},
475 {0xba, 0x0a, 0x03, 0xbb},
476 {0xbb, 0x1b, 0x09, 0xbb},
477 {0xbc, 0x17, 0x0d, 0xbb},
478 {0xbd, 0x23, 0x1d, 0xbb},
479 {0xbe, 0x00, 0x28, 0xbb},
480 {0xbf, 0x11, 0x09, 0xbb},
481 {0xc0, 0x16, 0x15, 0xbb},
482 {0xc1, 0x00, 0x1b, 0xbb},
483 {0xc2, 0x0e, 0x07, 0xbb},
484 {0xc3, 0x14, 0x10, 0xbb},
485 {0xc4, 0x00, 0x17, 0xbb},
486 {0x06, 0x74, 0x8e, 0xbb},
487 {0xf0, 0x00, 0x01, 0xbb},
488 {0x06, 0xf4, 0x8e, 0xbb},
489 {0x00, 0x00, 0x50, 0xdd},
490 {0x06, 0x74, 0x8e, 0xbb},
491 {0xf0, 0x00, 0x02, 0xbb},
492 {0x24, 0x50, 0x20, 0xbb},
493 {0xf0, 0x00, 0x02, 0xbb},
494 {0x34, 0x0c, 0x50, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300495 {0xb3, 0x01, 0x41, 0xcc},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300496 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300497 {0x03, 0x03, 0xc0, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300498 {},
499};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300500static const u8 mi1310_socinitQVGA_JPG[][4] = {
AceLan Kao4041f6b2009-07-27 05:43:55 -0300501 {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc},
502 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
503 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc},
504 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
505 {0xb3, 0x34, 0x02, 0xcc}, {0xb3, 0x35, 0xdd, 0xcc},
506 {0xb3, 0x02, 0x00, 0xcc}, {0xb3, 0x03, 0x0a, 0xcc},
507 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
508 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x03, 0xcc},
509 {0xb3, 0x23, 0xc0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
510 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x04, 0xcc},
511 {0xb3, 0x17, 0xff, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
512 {0xb8, 0x00, 0x00, 0xcc}, {0xbc, 0x00, 0xf0, 0xcc},
513 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x02, 0xbb},
514 {0xc8, 0x9f, 0x0b, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
515 {0x2f, 0xde, 0x20, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300516 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
517 {0xf0, 0x00, 0x01, 0xbb},
AceLan Kao4041f6b2009-07-27 05:43:55 -0300518 {0x05, 0x00, 0x07, 0xbb}, {0x34, 0x00, 0x00, 0xbb},
519 {0x35, 0xff, 0x00, 0xbb}, {0xdc, 0x07, 0x02, 0xbb},
520 {0xdd, 0x3c, 0x18, 0xbb}, {0xde, 0x92, 0x6d, 0xbb},
521 {0xdf, 0xcd, 0xb1, 0xbb}, {0xe0, 0xff, 0xe7, 0xbb},
522 {0x06, 0xf0, 0x0d, 0xbb}, {0x06, 0x70, 0x0e, 0xbb},
523 {0x4c, 0x00, 0x01, 0xbb}, {0x4d, 0x00, 0x01, 0xbb},
524 {0xf0, 0x00, 0x02, 0xbb}, {0x2e, 0x0c, 0x55, 0xbb},
525 {0x21, 0xb6, 0x6e, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
526 {0x37, 0x00, 0xc1, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
527 {0x07, 0x00, 0x84, 0xbb}, {0x08, 0x02, 0x4a, 0xbb},
528 {0x05, 0x01, 0x10, 0xbb}, {0x06, 0x00, 0x39, 0xbb},
529 {0xf0, 0x00, 0x02, 0xbb}, {0x58, 0x02, 0x67, 0xbb},
530 {0x57, 0x02, 0x00, 0xbb}, {0x5a, 0x02, 0x67, 0xbb},
531 {0x59, 0x02, 0x00, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
532 {0x5d, 0x16, 0x11, 0xbb}, {0x39, 0x06, 0x18, 0xbb},
533 {0x3a, 0x06, 0x18, 0xbb}, {0x3b, 0x06, 0x18, 0xbb},
534 {0x3c, 0x06, 0x18, 0xbb}, {0x64, 0x7b, 0x5b, 0xbb},
535 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
536 {0x37, 0x00, 0xc0, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
537 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
538 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
539 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
540 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
541 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x25, 0xcc},
542 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
543 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
544 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
545 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
546 {0xb3, 0x5c, 0x01, 0xcc}, {0xf0, 0x00, 0x01, 0xbb},
547 {0x80, 0x00, 0x03, 0xbb}, {0x81, 0xc7, 0x14, 0xbb},
548 {0x82, 0xeb, 0xe8, 0xbb}, {0x83, 0xfe, 0xf4, 0xbb},
549 {0x84, 0xcd, 0x10, 0xbb}, {0x85, 0xf3, 0xee, 0xbb},
550 {0x86, 0xff, 0xf1, 0xbb}, {0x87, 0xcd, 0x10, 0xbb},
551 {0x88, 0xf3, 0xee, 0xbb}, {0x89, 0x01, 0xf1, 0xbb},
552 {0x8a, 0xe5, 0x17, 0xbb}, {0x8b, 0xe8, 0xe2, 0xbb},
553 {0x8c, 0xf7, 0xed, 0xbb}, {0x8d, 0x00, 0xff, 0xbb},
554 {0x8e, 0xec, 0x10, 0xbb}, {0x8f, 0xf0, 0xed, 0xbb},
555 {0x90, 0xf9, 0xf2, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
556 {0x92, 0xe9, 0x0d, 0xbb}, {0x93, 0xf4, 0xf2, 0xbb},
557 {0x94, 0xfb, 0xf5, 0xbb}, {0x95, 0x00, 0xff, 0xbb},
558 {0xb6, 0x0f, 0x08, 0xbb}, {0xb7, 0x3d, 0x16, 0xbb},
559 {0xb8, 0x0c, 0x04, 0xbb}, {0xb9, 0x1c, 0x07, 0xbb},
560 {0xba, 0x0a, 0x03, 0xbb}, {0xbb, 0x1b, 0x09, 0xbb},
561 {0xbc, 0x17, 0x0d, 0xbb}, {0xbd, 0x23, 0x1d, 0xbb},
562 {0xbe, 0x00, 0x28, 0xbb}, {0xbf, 0x11, 0x09, 0xbb},
563 {0xc0, 0x16, 0x15, 0xbb}, {0xc1, 0x00, 0x1b, 0xbb},
564 {0xc2, 0x0e, 0x07, 0xbb}, {0xc3, 0x14, 0x10, 0xbb},
565 {0xc4, 0x00, 0x17, 0xbb}, {0x06, 0x74, 0x8e, 0xbb},
566 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0xf4, 0x8e, 0xbb},
567 {0x00, 0x00, 0x50, 0xdd}, {0x06, 0x74, 0x8e, 0xbb},
568 {0xf0, 0x00, 0x02, 0xbb}, {0x24, 0x50, 0x20, 0xbb},
569 {0xf0, 0x00, 0x02, 0xbb}, {0x34, 0x0c, 0x50, 0xbb},
570 {0xb3, 0x01, 0x41, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
571 {0x03, 0x03, 0xc0, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300572 {},
573};
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300574static const u8 mi1310_soc_InitSXGA_JPG[][4] = {
575 {0xb0, 0x03, 0x19, 0xcc},
576 {0xb0, 0x04, 0x02, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300577 {0xb3, 0x00, 0x64, 0xcc},
578 {0xb3, 0x00, 0x65, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300579 {0xb3, 0x05, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300580 {0xb3, 0x06, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300581 {0xb3, 0x08, 0x01, 0xcc},
582 {0xb3, 0x09, 0x0c, 0xcc},
583 {0xb3, 0x34, 0x02, 0xcc},
584 {0xb3, 0x35, 0xdd, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300585 {0xb3, 0x02, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300586 {0xb3, 0x03, 0x0a, 0xcc},
587 {0xb3, 0x04, 0x0d, 0xcc},
588 {0xb3, 0x20, 0x00, 0xcc},
589 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300590 {0xb3, 0x22, 0x03, 0xcc},
591 {0xb3, 0x23, 0xc0, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300592 {0xb3, 0x14, 0x00, 0xcc},
593 {0xb3, 0x15, 0x00, 0xcc},
594 {0xb3, 0x16, 0x04, 0xcc},
595 {0xb3, 0x17, 0xff, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300596 {0xb3, 0x00, 0x65, 0xcc},
597 {0xb8, 0x00, 0x00, 0xcc},
598 {0xbc, 0x00, 0x70, 0xcc},
599 {0xbc, 0x01, 0x01, 0xcc},
600 {0xf0, 0x00, 0x02, 0xbb},
601 {0xc8, 0x9f, 0x0b, 0xbb},
602 {0x5b, 0x00, 0x01, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300603 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300604 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300605 {0xf0, 0x00, 0x01, 0xbb},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300606 {0x05, 0x00, 0x07, 0xbb},
607 {0x34, 0x00, 0x00, 0xbb},
608 {0x35, 0xff, 0x00, 0xbb},
609 {0xdc, 0x07, 0x02, 0xbb},
610 {0xdd, 0x3c, 0x18, 0xbb},
611 {0xde, 0x92, 0x6d, 0xbb},
612 {0xdf, 0xcd, 0xb1, 0xbb},
613 {0xe0, 0xff, 0xe7, 0xbb},
614 {0x06, 0xf0, 0x0d, 0xbb},
615 {0x06, 0x70, 0x0e, 0xbb},
616 {0x4c, 0x00, 0x01, 0xbb},
617 {0x4d, 0x00, 0x01, 0xbb},
618 {0xf0, 0x00, 0x02, 0xbb},
619 {0x2e, 0x0c, 0x60, 0xbb},
620 {0x21, 0xb6, 0x6e, 0xbb},
621 {0x37, 0x01, 0x40, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300622 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300623 {0x07, 0x00, 0x84, 0xbb},
624 {0x08, 0x02, 0x4a, 0xbb},
625 {0x05, 0x01, 0x10, 0xbb},
626 {0x06, 0x00, 0x39, 0xbb},
627 {0xf0, 0x00, 0x02, 0xbb},
628 {0x58, 0x02, 0x67, 0xbb},
629 {0x57, 0x02, 0x00, 0xbb},
630 {0x5a, 0x02, 0x67, 0xbb},
631 {0x59, 0x02, 0x00, 0xbb},
632 {0x5c, 0x12, 0x0d, 0xbb},
633 {0x5d, 0x16, 0x11, 0xbb},
634 {0x39, 0x06, 0x18, 0xbb},
635 {0x3a, 0x06, 0x18, 0xbb},
636 {0x3b, 0x06, 0x18, 0xbb},
637 {0x3c, 0x06, 0x18, 0xbb},
638 {0x64, 0x7b, 0x5b, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300639 {0xb6, 0x00, 0x00, 0xcc},
640 {0xb6, 0x03, 0x05, 0xcc},
641 {0xb6, 0x02, 0x00, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300642 {0xb6, 0x05, 0x03, 0xcc},
643 {0xb6, 0x04, 0xc0, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300644 {0xb6, 0x12, 0xf8, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300645 {0xb6, 0x13, 0x29, 0xcc},
646 {0xb6, 0x18, 0x09, 0xcc},
647 {0xb6, 0x17, 0x60, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300648 {0xb6, 0x16, 0x00, 0xcc},
649 {0xb6, 0x22, 0x12, 0xcc},
650 {0xb6, 0x23, 0x0b, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300651 {0xbf, 0xc0, 0x39, 0xcc},
652 {0xbf, 0xc1, 0x04, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300653 {0xbf, 0xcc, 0x00, 0xcc},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300654 {0xb3, 0x01, 0x41, 0xcc},
Jean-Francois Moine111815e2009-07-27 05:52:27 -0300655 {0x00, 0x00, 0x80, 0xdd},
656 {0xf0, 0x00, 0x02, 0xbb},
657 {0x00, 0x00, 0x10, 0xdd},
658 {0x22, 0xa0, 0x78, 0xbb},
659 {0x23, 0xa0, 0x78, 0xbb},
660 {0x24, 0x7f, 0x00, 0xbb},
661 {0x28, 0xea, 0x02, 0xbb},
662 {0x29, 0x86, 0x7a, 0xbb},
663 {0x5e, 0x52, 0x4c, 0xbb},
664 {0x5f, 0x20, 0x24, 0xbb},
665 {0x60, 0x00, 0x02, 0xbb},
666 {0x02, 0x00, 0xee, 0xbb},
667 {0x03, 0x39, 0x23, 0xbb},
668 {0x04, 0x07, 0x24, 0xbb},
669 {0x09, 0x00, 0xc0, 0xbb},
670 {0x0a, 0x00, 0x79, 0xbb},
671 {0x0b, 0x00, 0x04, 0xbb},
672 {0x0c, 0x00, 0x5c, 0xbb},
673 {0x0d, 0x00, 0xd9, 0xbb},
674 {0x0e, 0x00, 0x53, 0xbb},
675 {0x0f, 0x00, 0x21, 0xbb},
676 {0x10, 0x00, 0xa4, 0xbb},
677 {0x11, 0x00, 0xe5, 0xbb},
678 {0x15, 0x00, 0x00, 0xbb},
679 {0x16, 0x00, 0x00, 0xbb},
680 {0x17, 0x00, 0x00, 0xbb},
681 {0x18, 0x00, 0x00, 0xbb},
682 {0x19, 0x00, 0x00, 0xbb},
683 {0x1a, 0x00, 0x00, 0xbb},
684 {0x1b, 0x00, 0x00, 0xbb},
685 {0x1c, 0x00, 0x00, 0xbb},
686 {0x1d, 0x00, 0x00, 0xbb},
687 {0x1e, 0x00, 0x00, 0xbb},
688 {0xf0, 0x00, 0x01, 0xbb},
689 {0x00, 0x00, 0x20, 0xdd},
690 {0x06, 0xf0, 0x8e, 0xbb},
691 {0x00, 0x00, 0x80, 0xdd},
692 {0x06, 0x70, 0x8e, 0xbb},
693 {0xf0, 0x00, 0x02, 0xbb},
694 {0x00, 0x00, 0x20, 0xdd},
695 {0x5e, 0x6a, 0x53, 0xbb},
696 {0x5f, 0x40, 0x2c, 0xbb},
697 {0xf0, 0x00, 0x01, 0xbb},
698 {0x00, 0x00, 0x20, 0xdd},
699 {0x58, 0x00, 0x00, 0xbb},
700 {0x53, 0x09, 0x03, 0xbb},
701 {0x54, 0x31, 0x18, 0xbb},
702 {0x55, 0x8b, 0x5f, 0xbb},
703 {0x56, 0xc0, 0xa9, 0xbb},
704 {0x57, 0xe0, 0xd2, 0xbb},
705 {0xe1, 0x00, 0x00, 0xbb},
706 {0xdc, 0x09, 0x03, 0xbb},
707 {0xdd, 0x31, 0x18, 0xbb},
708 {0xde, 0x8b, 0x5f, 0xbb},
709 {0xdf, 0xc0, 0xa9, 0xbb},
710 {0xe0, 0xe0, 0xd2, 0xbb},
711 {0xb3, 0x5c, 0x01, 0xcc},
712 {0xf0, 0x00, 0x01, 0xbb},
713 {0x06, 0xf0, 0x8e, 0xbb},
714 {0xf0, 0x00, 0x02, 0xbb},
715 {0x2f, 0xde, 0x20, 0xbb},
716 {0xf0, 0x00, 0x02, 0xbb},
717 {0x24, 0x50, 0x20, 0xbb},
718 {0xbc, 0x0e, 0x00, 0xcc},
719 {0xbc, 0x0f, 0x05, 0xcc},
720 {0xbc, 0x10, 0xc0, 0xcc},
721 {0xf0, 0x00, 0x02, 0xbb},
722 {0x34, 0x0c, 0x50, 0xbb},
723 {0xbc, 0x11, 0x03, 0xcc},
724 {0xf0, 0x00, 0x01, 0xbb},
725 {0x80, 0x00, 0x03, 0xbb},
726 {0x81, 0xc7, 0x14, 0xbb},
727 {0x82, 0xeb, 0xe8, 0xbb},
728 {0x83, 0xfe, 0xf4, 0xbb},
729 {0x84, 0xcd, 0x10, 0xbb},
730 {0x85, 0xf3, 0xee, 0xbb},
731 {0x86, 0xff, 0xf1, 0xbb},
732 {0x87, 0xcd, 0x10, 0xbb},
733 {0x88, 0xf3, 0xee, 0xbb},
734 {0x89, 0x01, 0xf1, 0xbb},
735 {0x8a, 0xe5, 0x17, 0xbb},
736 {0x8b, 0xe8, 0xe2, 0xbb},
737 {0x8c, 0xf7, 0xed, 0xbb},
738 {0x8d, 0x00, 0xff, 0xbb},
739 {0x8e, 0xec, 0x10, 0xbb},
740 {0x8f, 0xf0, 0xed, 0xbb},
741 {0x90, 0xf9, 0xf2, 0xbb},
742 {0x91, 0x00, 0x00, 0xbb},
743 {0x92, 0xe9, 0x0d, 0xbb},
744 {0x93, 0xf4, 0xf2, 0xbb},
745 {0x94, 0xfb, 0xf5, 0xbb},
746 {0x95, 0x00, 0xff, 0xbb},
747 {0xb6, 0x0f, 0x08, 0xbb},
748 {0xb7, 0x3d, 0x16, 0xbb},
749 {0xb8, 0x0c, 0x04, 0xbb},
750 {0xb9, 0x1c, 0x07, 0xbb},
751 {0xba, 0x0a, 0x03, 0xbb},
752 {0xbb, 0x1b, 0x09, 0xbb},
753 {0xbc, 0x17, 0x0d, 0xbb},
754 {0xbd, 0x23, 0x1d, 0xbb},
755 {0xbe, 0x00, 0x28, 0xbb},
756 {0xbf, 0x11, 0x09, 0xbb},
757 {0xc0, 0x16, 0x15, 0xbb},
758 {0xc1, 0x00, 0x1b, 0xbb},
759 {0xc2, 0x0e, 0x07, 0xbb},
760 {0xc3, 0x14, 0x10, 0xbb},
761 {0xc4, 0x00, 0x17, 0xbb},
762 {0x06, 0x74, 0x8e, 0xbb},
763 {0xf0, 0x00, 0x00, 0xbb},
764 {0x03, 0x03, 0xc0, 0xbb},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300765 {}
766};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300767
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300768static const u8 mi1320_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300769 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
770 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
771};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300772static const u8 mi1320_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300773 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
774};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300775static const u8 mi1320_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300776 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
777 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
778 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
779 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
780 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
781 {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
782 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -0300783 {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
784 {0xb3, 0x02, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300785 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
786 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
787 {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
788 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
789 {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
790 {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
791 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
792 {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
793 {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
794 {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
795 {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
796 {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
797 {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
798 {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
799 {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
800 {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
801 {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
802 {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
803 {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
804 {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
805 {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
806 {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
807 {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
808 {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
809 {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
810 {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
811 {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
812 {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
813 {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
814 {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
815 {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
816 {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
817 {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
818 {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
819 {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
820 {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
821 {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
822 {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
823 {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
824 {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -0300825 {0x08, 0x00, 0x27, 0xbb},
826 {0x20, 0x01, 0x00, 0xbb}, /* h/v flips - was 03 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300827 {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
828 {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
829 {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
830 {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
831 {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
832 {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
833 {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
834 {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
835 {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
836 {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
837 {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
838 {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
839 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
840 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
841 {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
842 {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
843 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
844 {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
845 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
846 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
847 {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
848 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
849 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
850 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
851 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
852 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
853 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
854 {}
855};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -0300856static const u8 mi1320_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300857 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
858 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
859 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
860 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
861 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
862 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
863 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
864 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
865 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
866 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
867 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
868 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
869 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
870 {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
871 {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
872 {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
873 {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
874 {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
875 {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
876 {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
877 {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
878 {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
879 {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
880 {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
881 {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
882 {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
883 {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
884 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
885 {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
886 {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
887 {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
888 {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
889 {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
890 {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
891 {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
892 {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
893 {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
894 {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
895 {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
896 {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
897 {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
898 {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
899 {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
900 {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
901 {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
902 {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
903 {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
904 {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
905 {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
906 {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
907 {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
908 {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
909 {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
910 {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
911 {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
912 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
913 {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
914 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
915 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
916 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
917 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
918 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
919 {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
920 {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
921 {0xb3, 0x01, 0x41, 0xcc},
922 {}
923};
924
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300925static const u8 mi1320_soc_InitVGA[][4] = {
926 {0xb3, 0x01, 0x01, 0xcc},
927 {0xb0, 0x03, 0x19, 0xcc},
928 {0xb0, 0x04, 0x02, 0xcc},
929 {0x00, 0x00, 0x30, 0xdd},
930 {0xb3, 0x00, 0x64, 0xcc},
931 {0xb3, 0x00, 0x67, 0xcc},
932 {0xb3, 0x05, 0x01, 0xcc},
933 {0xb3, 0x06, 0x01, 0xcc},
934 {0xb3, 0x08, 0x01, 0xcc},
935 {0xb3, 0x09, 0x0c, 0xcc},
936 {0xb3, 0x34, 0x02, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -0300937 {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300938 {0xb3, 0x02, 0x00, 0xcc},
939 {0xb3, 0x03, 0x0a, 0xcc},
940 {0xb3, 0x04, 0x05, 0xcc},
941 {0xb3, 0x20, 0x00, 0xcc},
942 {0xb3, 0x21, 0x00, 0xcc},
943 {0xb3, 0x22, 0x01, 0xcc},
944 {0xb3, 0x23, 0xe0, 0xcc},
945 {0xb3, 0x14, 0x00, 0xcc},
946 {0xb3, 0x15, 0x00, 0xcc},
947 {0xb3, 0x16, 0x02, 0xcc},
948 {0xb3, 0x17, 0x7f, 0xcc},
949 {0xb3, 0x00, 0x67, 0xcc},
950 {0xb8, 0x00, 0x00, 0xcc},
951 {0xbc, 0x00, 0x71, 0xcc},
952 {0xbc, 0x01, 0x01, 0xcc},
953 {0xb3, 0x5c, 0x01, 0xcc},
954 {0xf0, 0x00, 0x02, 0xbb},
955 {0x00, 0x00, 0x10, 0xdd},
956 {0xc8, 0x00, 0x00, 0xbb},
957 {0x00, 0x00, 0x30, 0xdd},
958 {0xf0, 0x00, 0x00, 0xbb},
959 {0x00, 0x00, 0x10, 0xdd},
960 {0x07, 0x00, 0xe0, 0xbb},
961 {0x08, 0x00, 0x0b, 0xbb},
962 {0x21, 0x00, 0x0c, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300963 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300964 {0xbf, 0xc0, 0x26, 0xcc},
965 {0xbf, 0xc1, 0x02, 0xcc},
966 {0xbf, 0xcc, 0x04, 0xcc},
967 {0xb3, 0x01, 0x41, 0xcc},
968 {0xf0, 0x00, 0x00, 0xbb},
969 {0x05, 0x01, 0x78, 0xbb},
970 {0x06, 0x00, 0x11, 0xbb},
971 {0x07, 0x01, 0x42, 0xbb},
972 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -0300973 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -0300974 {0x21, 0x80, 0x00, 0xbb},
975 {0x22, 0x0d, 0x0f, 0xbb},
976 {0x24, 0x80, 0x00, 0xbb},
977 {0x59, 0x00, 0xff, 0xbb},
978 {0xf0, 0x00, 0x02, 0xbb},
979 {0x39, 0x03, 0xca, 0xbb},
980 {0x3a, 0x06, 0x80, 0xbb},
981 {0x3b, 0x01, 0x52, 0xbb},
982 {0x3c, 0x05, 0x40, 0xbb},
983 {0x57, 0x01, 0x9c, 0xbb},
984 {0x58, 0x01, 0xee, 0xbb},
985 {0x59, 0x00, 0xf0, 0xbb},
986 {0x5a, 0x01, 0x20, 0xbb},
987 {0x5c, 0x1d, 0x17, 0xbb},
988 {0x5d, 0x22, 0x1c, 0xbb},
989 {0x64, 0x1e, 0x1c, 0xbb},
990 {0x5b, 0x00, 0x00, 0xbb},
991 {0xf0, 0x00, 0x02, 0xbb},
992 {0x22, 0xa0, 0x78, 0xbb},
993 {0x23, 0xa0, 0x78, 0xbb},
994 {0x24, 0x7f, 0x00, 0xbb},
995 {0x28, 0xea, 0x02, 0xbb},
996 {0x29, 0x86, 0x7a, 0xbb},
997 {0x5e, 0x52, 0x4c, 0xbb},
998 {0x5f, 0x20, 0x24, 0xbb},
999 {0x60, 0x00, 0x02, 0xbb},
1000 {0x02, 0x00, 0xee, 0xbb},
1001 {0x03, 0x39, 0x23, 0xbb},
1002 {0x04, 0x07, 0x24, 0xbb},
1003 {0x09, 0x00, 0xc0, 0xbb},
1004 {0x0a, 0x00, 0x79, 0xbb},
1005 {0x0b, 0x00, 0x04, 0xbb},
1006 {0x0c, 0x00, 0x5c, 0xbb},
1007 {0x0d, 0x00, 0xd9, 0xbb},
1008 {0x0e, 0x00, 0x53, 0xbb},
1009 {0x0f, 0x00, 0x21, 0xbb},
1010 {0x10, 0x00, 0xa4, 0xbb},
1011 {0x11, 0x00, 0xe5, 0xbb},
1012 {0x15, 0x00, 0x00, 0xbb},
1013 {0x16, 0x00, 0x00, 0xbb},
1014 {0x17, 0x00, 0x00, 0xbb},
1015 {0x18, 0x00, 0x00, 0xbb},
1016 {0x19, 0x00, 0x00, 0xbb},
1017 {0x1a, 0x00, 0x00, 0xbb},
1018 {0x1b, 0x00, 0x00, 0xbb},
1019 {0x1c, 0x00, 0x00, 0xbb},
1020 {0x1d, 0x00, 0x00, 0xbb},
1021 {0x1e, 0x00, 0x00, 0xbb},
1022 {0xf0, 0x00, 0x01, 0xbb},
1023 {0x06, 0xe0, 0x0e, 0xbb},
1024 {0x06, 0x60, 0x0e, 0xbb},
1025 {0xb3, 0x5c, 0x01, 0xcc},
1026 {}
1027};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001028static const u8 mi1320_soc_InitQVGA[][4] = {
1029 {0xb3, 0x01, 0x01, 0xcc},
1030 {0xb0, 0x03, 0x19, 0xcc},
1031 {0xb0, 0x04, 0x02, 0xcc},
1032 {0x00, 0x00, 0x30, 0xdd},
1033 {0xb3, 0x00, 0x64, 0xcc},
1034 {0xb3, 0x00, 0x67, 0xcc},
1035 {0xb3, 0x05, 0x01, 0xcc},
1036 {0xb3, 0x06, 0x01, 0xcc},
1037 {0xb3, 0x08, 0x01, 0xcc},
1038 {0xb3, 0x09, 0x0c, 0xcc},
1039 {0xb3, 0x34, 0x02, 0xcc},
1040 {0xb3, 0x35, 0xc8, 0xcc},
1041 {0xb3, 0x02, 0x00, 0xcc},
1042 {0xb3, 0x03, 0x0a, 0xcc},
1043 {0xb3, 0x04, 0x05, 0xcc},
1044 {0xb3, 0x20, 0x00, 0xcc},
1045 {0xb3, 0x21, 0x00, 0xcc},
1046 {0xb3, 0x22, 0x01, 0xcc},
1047 {0xb3, 0x23, 0xe0, 0xcc},
1048 {0xb3, 0x14, 0x00, 0xcc},
1049 {0xb3, 0x15, 0x00, 0xcc},
1050 {0xb3, 0x16, 0x02, 0xcc},
1051 {0xb3, 0x17, 0x7f, 0xcc},
1052 {0xb3, 0x00, 0x67, 0xcc},
1053 {0xb8, 0x00, 0x00, 0xcc},
1054 {0xbc, 0x00, 0xd1, 0xcc},
1055 {0xbc, 0x01, 0x01, 0xcc},
1056 {0xb3, 0x5c, 0x01, 0xcc},
1057 {0xf0, 0x00, 0x02, 0xbb},
1058 {0x00, 0x00, 0x10, 0xdd},
1059 {0xc8, 0x00, 0x00, 0xbb},
1060 {0x00, 0x00, 0x30, 0xdd},
1061 {0xf0, 0x00, 0x00, 0xbb},
1062 {0x00, 0x00, 0x10, 0xdd},
1063 {0x07, 0x00, 0xe0, 0xbb},
1064 {0x08, 0x00, 0x0b, 0xbb},
1065 {0x21, 0x00, 0x0c, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001066 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001067 {0xbf, 0xc0, 0x26, 0xcc},
1068 {0xbf, 0xc1, 0x02, 0xcc},
1069 {0xbf, 0xcc, 0x04, 0xcc},
1070 {0xbc, 0x02, 0x18, 0xcc},
1071 {0xbc, 0x03, 0x50, 0xcc},
1072 {0xbc, 0x04, 0x18, 0xcc},
1073 {0xbc, 0x05, 0x00, 0xcc},
1074 {0xbc, 0x06, 0x00, 0xcc},
1075 {0xbc, 0x08, 0x30, 0xcc},
1076 {0xbc, 0x09, 0x40, 0xcc},
1077 {0xbc, 0x0a, 0x10, 0xcc},
1078 {0xbc, 0x0b, 0x00, 0xcc},
1079 {0xbc, 0x0c, 0x00, 0xcc},
1080 {0xb3, 0x01, 0x41, 0xcc},
1081 {0xf0, 0x00, 0x00, 0xbb},
1082 {0x05, 0x01, 0x78, 0xbb},
1083 {0x06, 0x00, 0x11, 0xbb},
1084 {0x07, 0x01, 0x42, 0xbb},
1085 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001086 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001087 {0x21, 0x80, 0x00, 0xbb},
1088 {0x22, 0x0d, 0x0f, 0xbb},
1089 {0x24, 0x80, 0x00, 0xbb},
1090 {0x59, 0x00, 0xff, 0xbb},
1091 {0xf0, 0x00, 0x02, 0xbb},
1092 {0x39, 0x03, 0xca, 0xbb},
1093 {0x3a, 0x06, 0x80, 0xbb},
1094 {0x3b, 0x01, 0x52, 0xbb},
1095 {0x3c, 0x05, 0x40, 0xbb},
1096 {0x57, 0x01, 0x9c, 0xbb},
1097 {0x58, 0x01, 0xee, 0xbb},
1098 {0x59, 0x00, 0xf0, 0xbb},
1099 {0x5a, 0x01, 0x20, 0xbb},
1100 {0x5c, 0x1d, 0x17, 0xbb},
1101 {0x5d, 0x22, 0x1c, 0xbb},
1102 {0x64, 0x1e, 0x1c, 0xbb},
1103 {0x5b, 0x00, 0x00, 0xbb},
1104 {0xf0, 0x00, 0x02, 0xbb},
1105 {0x22, 0xa0, 0x78, 0xbb},
1106 {0x23, 0xa0, 0x78, 0xbb},
1107 {0x24, 0x7f, 0x00, 0xbb},
1108 {0x28, 0xea, 0x02, 0xbb},
1109 {0x29, 0x86, 0x7a, 0xbb},
1110 {0x5e, 0x52, 0x4c, 0xbb},
1111 {0x5f, 0x20, 0x24, 0xbb},
1112 {0x60, 0x00, 0x02, 0xbb},
1113 {0x02, 0x00, 0xee, 0xbb},
1114 {0x03, 0x39, 0x23, 0xbb},
1115 {0x04, 0x07, 0x24, 0xbb},
1116 {0x09, 0x00, 0xc0, 0xbb},
1117 {0x0a, 0x00, 0x79, 0xbb},
1118 {0x0b, 0x00, 0x04, 0xbb},
1119 {0x0c, 0x00, 0x5c, 0xbb},
1120 {0x0d, 0x00, 0xd9, 0xbb},
1121 {0x0e, 0x00, 0x53, 0xbb},
1122 {0x0f, 0x00, 0x21, 0xbb},
1123 {0x10, 0x00, 0xa4, 0xbb},
1124 {0x11, 0x00, 0xe5, 0xbb},
1125 {0x15, 0x00, 0x00, 0xbb},
1126 {0x16, 0x00, 0x00, 0xbb},
1127 {0x17, 0x00, 0x00, 0xbb},
1128 {0x18, 0x00, 0x00, 0xbb},
1129 {0x19, 0x00, 0x00, 0xbb},
1130 {0x1a, 0x00, 0x00, 0xbb},
1131 {0x1b, 0x00, 0x00, 0xbb},
1132 {0x1c, 0x00, 0x00, 0xbb},
1133 {0x1d, 0x00, 0x00, 0xbb},
1134 {0x1e, 0x00, 0x00, 0xbb},
1135 {0xf0, 0x00, 0x01, 0xbb},
1136 {0x06, 0xe0, 0x0e, 0xbb},
1137 {0x06, 0x60, 0x0e, 0xbb},
1138 {0xb3, 0x5c, 0x01, 0xcc},
1139 {}
1140};
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001141static const u8 mi1320_soc_InitSXGA[][4] = {
1142 {0xb3, 0x01, 0x01, 0xcc},
1143 {0xb0, 0x03, 0x19, 0xcc},
1144 {0x00, 0x00, 0x30, 0xdd},
1145 {0xb3, 0x00, 0x64, 0xcc},
1146 {0xb3, 0x00, 0x67, 0xcc},
1147 {0xb3, 0x05, 0x01, 0xcc},
1148 {0xb3, 0x06, 0x01, 0xcc},
1149 {0xb3, 0x08, 0x01, 0xcc},
1150 {0xb3, 0x09, 0x0c, 0xcc},
1151 {0xb3, 0x34, 0x02, 0xcc},
1152 {0xb3, 0x35, 0xc8, 0xcc},
1153 {0xb3, 0x02, 0x00, 0xcc},
1154 {0xb3, 0x03, 0x0a, 0xcc},
1155 {0xb3, 0x04, 0x05, 0xcc},
1156 {0xb3, 0x20, 0x00, 0xcc},
1157 {0xb3, 0x21, 0x00, 0xcc},
1158 {0xb3, 0x22, 0x04, 0xcc},
1159 {0xb3, 0x23, 0x00, 0xcc},
1160 {0xb3, 0x14, 0x00, 0xcc},
1161 {0xb3, 0x15, 0x00, 0xcc},
1162 {0xb3, 0x16, 0x04, 0xcc},
1163 {0xb3, 0x17, 0xff, 0xcc},
1164 {0xb3, 0x00, 0x67, 0xcc},
1165 {0xbc, 0x00, 0x71, 0xcc},
1166 {0xbc, 0x01, 0x01, 0xcc},
1167 {0xb3, 0x5c, 0x01, 0xcc},
1168 {0xf0, 0x00, 0x02, 0xbb},
1169 {0x00, 0x00, 0x30, 0xdd},
1170 {0xc8, 0x9f, 0x0b, 0xbb},
1171 {0x00, 0x00, 0x20, 0xdd},
1172 {0x5b, 0x00, 0x01, 0xbb},
1173 {0x00, 0x00, 0x20, 0xdd},
1174 {0xf0, 0x00, 0x00, 0xbb},
1175 {0x00, 0x00, 0x30, 0xdd},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001176 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001177 {0x00, 0x00, 0x20, 0xdd},
1178 {0xbf, 0xc0, 0x26, 0xcc},
1179 {0xbf, 0xc1, 0x02, 0xcc},
1180 {0xbf, 0xcc, 0x04, 0xcc},
1181 {0xb3, 0x01, 0x41, 0xcc},
1182 {0xf0, 0x00, 0x00, 0xbb},
1183 {0x05, 0x01, 0x78, 0xbb},
1184 {0x06, 0x00, 0x11, 0xbb},
1185 {0x07, 0x01, 0x42, 0xbb},
1186 {0x08, 0x00, 0x11, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001187 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001188 {0x21, 0x80, 0x00, 0xbb},
1189 {0x22, 0x0d, 0x0f, 0xbb},
1190 {0x24, 0x80, 0x00, 0xbb},
1191 {0x59, 0x00, 0xff, 0xbb},
1192 {0xf0, 0x00, 0x02, 0xbb},
1193 {0x39, 0x03, 0xca, 0xbb},
1194 {0x3a, 0x06, 0x80, 0xbb},
1195 {0x3b, 0x01, 0x52, 0xbb},
1196 {0x3c, 0x05, 0x40, 0xbb},
1197 {0x57, 0x01, 0x9c, 0xbb},
1198 {0x58, 0x01, 0xee, 0xbb},
1199 {0x59, 0x00, 0xf0, 0xbb},
1200 {0x5a, 0x01, 0x20, 0xbb},
1201 {0x5c, 0x1d, 0x17, 0xbb},
1202 {0x5d, 0x22, 0x1c, 0xbb},
1203 {0x64, 0x1e, 0x1c, 0xbb},
1204 {0x5b, 0x00, 0x00, 0xbb},
1205 {0xf0, 0x00, 0x02, 0xbb},
1206 {0x22, 0xa0, 0x78, 0xbb},
1207 {0x23, 0xa0, 0x78, 0xbb},
1208 {0x24, 0x7f, 0x00, 0xbb},
1209 {0x28, 0xea, 0x02, 0xbb},
1210 {0x29, 0x86, 0x7a, 0xbb},
1211 {0x5e, 0x52, 0x4c, 0xbb},
1212 {0x5f, 0x20, 0x24, 0xbb},
1213 {0x60, 0x00, 0x02, 0xbb},
1214 {0x02, 0x00, 0xee, 0xbb},
1215 {0x03, 0x39, 0x23, 0xbb},
1216 {0x04, 0x07, 0x24, 0xbb},
1217 {0x09, 0x00, 0xc0, 0xbb},
1218 {0x0a, 0x00, 0x79, 0xbb},
1219 {0x0b, 0x00, 0x04, 0xbb},
1220 {0x0c, 0x00, 0x5c, 0xbb},
1221 {0x0d, 0x00, 0xd9, 0xbb},
1222 {0x0e, 0x00, 0x53, 0xbb},
1223 {0x0f, 0x00, 0x21, 0xbb},
1224 {0x10, 0x00, 0xa4, 0xbb},
1225 {0x11, 0x00, 0xe5, 0xbb},
1226 {0x15, 0x00, 0x00, 0xbb},
1227 {0x16, 0x00, 0x00, 0xbb},
1228 {0x17, 0x00, 0x00, 0xbb},
1229 {0x18, 0x00, 0x00, 0xbb},
1230 {0x19, 0x00, 0x00, 0xbb},
1231 {0x1a, 0x00, 0x00, 0xbb},
1232 {0x1b, 0x00, 0x00, 0xbb},
1233 {0x1c, 0x00, 0x00, 0xbb},
1234 {0x1d, 0x00, 0x00, 0xbb},
1235 {0x1e, 0x00, 0x00, 0xbb},
1236 {0xf0, 0x00, 0x01, 0xbb},
1237 {0x06, 0xe0, 0x0e, 0xbb},
1238 {0x06, 0x60, 0x0e, 0xbb},
1239 {0xb3, 0x5c, 0x01, 0xcc},
1240 {0xf0, 0x00, 0x00, 0xbb},
1241 {0x05, 0x01, 0x13, 0xbb},
1242 {0x06, 0x00, 0x11, 0xbb},
1243 {0x07, 0x00, 0x85, 0xbb},
1244 {0x08, 0x00, 0x27, 0xbb},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03001245 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03001246 {0x21, 0x80, 0x00, 0xbb},
1247 {0x22, 0x0d, 0x0f, 0xbb},
1248 {0x24, 0x80, 0x00, 0xbb},
1249 {0x59, 0x00, 0xff, 0xbb},
1250 {0xf0, 0x00, 0x02, 0xbb},
1251 {0x39, 0x03, 0x0d, 0xbb},
1252 {0x3a, 0x06, 0x1b, 0xbb},
1253 {0x3b, 0x00, 0x95, 0xbb},
1254 {0x3c, 0x04, 0xdb, 0xbb},
1255 {0x57, 0x02, 0x00, 0xbb},
1256 {0x58, 0x02, 0x66, 0xbb},
1257 {0x59, 0x00, 0xff, 0xbb},
1258 {0x5a, 0x01, 0x33, 0xbb},
1259 {0x5c, 0x12, 0x0d, 0xbb},
1260 {0x5d, 0x16, 0x11, 0xbb},
1261 {0x64, 0x5e, 0x1c, 0xbb},
1262 {}
1263};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001264static const u8 po3130_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001265 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1266 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1267};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001268static const u8 po3130_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001269 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1270};
1271
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001272static const u8 po3130_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001273 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1274 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1275 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1276 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1277 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1278 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1279 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1280 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1281 {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
1282 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1283 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03001284 {0xb3, 0x34, 0x01, 0xcc},
1285 {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001286 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
1287 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1288 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1289 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1290 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1291 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1292 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1293 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1294 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1295 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1296 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1297 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1298 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1299 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1300 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1301 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1302 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1303 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1304 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1305 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1306 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1307 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1308 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1309 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1310 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1311 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1312 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1313 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1314 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1315 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1316 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1317 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1318 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1319 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1320 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1321 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1322 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1323 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1324 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1325 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1326 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1327 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1328 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1329 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1330 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1331 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1332 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1333 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1334 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1335 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1336 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1337 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1338 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1339 {0x00, 0x7e, 0xea, 0xaa},
1340 {0x00, 0x4c, 0x07, 0xaa},
1341 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1342 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1343/* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1344 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
1345 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1346 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1347 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1348 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1349 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1350 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1351 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1352 {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1353 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1354 {}
1355};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001356static const u8 po3130_rundata[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001357 {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
1358 {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
1359 {0x00, 0x44, 0x40, 0xaa},
1360/* {0x00, 0xd5, 0x7c, 0xaa}, */
1361 {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
1362 {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
1363 {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
1364 {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
1365 {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
1366 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
1367 {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1368 {}
1369};
1370
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001371static const u8 po3130_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001372 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1373 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
1374 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1375 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1376 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1377 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1378 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1379 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1380 {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
1381 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1382 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1383 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
1384 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1385 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1386 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1387 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1388 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1389 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1390 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1391 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1392 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1393 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1394 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1395 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1396 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1397 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1398 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1399 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1400 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1401 {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1402 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1403 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1404 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1405 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1406 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1407 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1408 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1409 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1410 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1411 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1412 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1413 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1414 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1415 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1416 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1417 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1418 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1419 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1420 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1421 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1422 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1423 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1424 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1425 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1426 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1427 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1428 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1429 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1430 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1431 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1432 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1433 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1434 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1435 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1436 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1437 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
1438 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1439 {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1440 {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1441 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1442 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1443 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1444 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1445 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1446 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1447 {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
1448 {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
1449 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1450 {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
1451 {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
1452 {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1453 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1454 {}
1455};
1456
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001457static const u8 hv7131r_gamma[17] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001458 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1459 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001460};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001461static const u8 hv7131r_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001462 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1463};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001464static const u8 hv7131r_initVGA_data[][4] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001465 {0xb3, 0x01, 0x01, 0xcc},
1466 {0xb0, 0x03, 0x19, 0xcc},
1467 {0xb0, 0x04, 0x02, 0xcc},
1468 {0x00, 0x00, 0x20, 0xdd},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001469 {0xb3, 0x00, 0x24, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001470 {0xb3, 0x00, 0x25, 0xcc},
1471 {0xb3, 0x08, 0x01, 0xcc},
1472 {0xb3, 0x09, 0x0c, 0xcc},
1473 {0xb3, 0x05, 0x01, 0xcc},
1474 {0xb3, 0x06, 0x03, 0xcc},
1475 {0xb3, 0x01, 0x45, 0xcc},
1476 {0xb3, 0x03, 0x0b, 0xcc},
1477 {0xb3, 0x04, 0x05, 0xcc},
1478 {0xb3, 0x20, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001479 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001480 {0xb3, 0x22, 0x01, 0xcc},
1481 {0xb3, 0x23, 0xe0, 0xcc},
1482 {0xb3, 0x14, 0x00, 0xcc},
1483 {0xb3, 0x15, 0x02, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001484 {0xb3, 0x16, 0x02, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001485 {0xb3, 0x17, 0x7f, 0xcc},
1486 {0xb3, 0x34, 0x01, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03001487 {0xb3, 0x35, 0x91, 0xcc}, /* i2c add: 11 */
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001488 {0xb3, 0x00, 0x27, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001489 {0xbc, 0x00, 0x73, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001490 {0xb8, 0x00, 0x23, 0xcc},
1491 {0xb8, 0x2c, 0x50, 0xcc},
1492 {0xb8, 0x2d, 0xf8, 0xcc},
1493 {0xb8, 0x2e, 0xf8, 0xcc},
1494 {0xb8, 0x2f, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001495 {0xb8, 0x30, 0x50, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001496 {0xb8, 0x31, 0xf8, 0xcc},
1497 {0xb8, 0x32, 0xf8, 0xcc},
1498 {0xb8, 0x33, 0xf8, 0xcc},
1499 {0xb8, 0x34, 0x58, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001500 {0xb8, 0x35, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001501 {0xb8, 0x36, 0x00, 0xcc},
1502 {0xb8, 0x37, 0x00, 0xcc},
1503 {0xb8, 0x27, 0x20, 0xcc},
1504 {0xb8, 0x01, 0x7d, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001505 {0xb8, 0x81, 0x09, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001506 {0xb3, 0x01, 0x41, 0xcc},
1507 {0xb8, 0x8e, 0x00, 0xcc},
1508 {0xb8, 0x8f, 0xff, 0xcc},
1509 {0x00, 0x01, 0x0c, 0xaa},
1510 {0x00, 0x14, 0x01, 0xaa},
1511 {0x00, 0x15, 0xe6, 0xaa},
1512 {0x00, 0x16, 0x02, 0xaa},
1513 {0x00, 0x17, 0x86, 0xaa},
1514 {0x00, 0x23, 0x00, 0xaa},
1515 {0x00, 0x25, 0x03, 0xaa},
1516 {0x00, 0x26, 0xa9, 0xaa},
1517 {0x00, 0x27, 0x80, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001518 {0x00, 0x30, 0x18, 0xaa},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001519 {0xb6, 0x00, 0x00, 0xcc},
1520 {0xb6, 0x03, 0x02, 0xcc},
1521 {0xb6, 0x02, 0x80, 0xcc},
1522 {0xb6, 0x05, 0x01, 0xcc},
1523 {0xb6, 0x04, 0xe0, 0xcc},
1524 {0xb6, 0x12, 0x78, 0xcc},
1525 {0xb6, 0x18, 0x02, 0xcc},
1526 {0xb6, 0x17, 0x58, 0xcc},
1527 {0xb6, 0x16, 0x00, 0xcc},
1528 {0xb6, 0x22, 0x12, 0xcc},
1529 {0xb6, 0x23, 0x0b, 0xcc},
1530 {0xb3, 0x02, 0x02, 0xcc},
1531 {0xbf, 0xc0, 0x39, 0xcc},
1532 {0xbf, 0xc1, 0x04, 0xcc},
1533 {0xbf, 0xcc, 0x10, 0xcc},
1534 {0xb6, 0x12, 0xf8, 0xcc},
1535 {0xb6, 0x13, 0x13, 0xcc},
1536 {0xb9, 0x12, 0x00, 0xcc},
1537 {0xb9, 0x13, 0x0a, 0xcc},
1538 {0xb9, 0x14, 0x0a, 0xcc},
1539 {0xb9, 0x15, 0x0a, 0xcc},
1540 {0xb9, 0x16, 0x0a, 0xcc},
1541 {0xb8, 0x0c, 0x20, 0xcc},
1542 {0xb8, 0x0d, 0x70, 0xcc},
1543 {0xb9, 0x18, 0x00, 0xcc},
1544 {0xb9, 0x19, 0x0f, 0xcc},
1545 {0xb9, 0x1a, 0x0f, 0xcc},
1546 {0xb9, 0x1b, 0x0f, 0xcc},
1547 {0xb9, 0x1c, 0x0f, 0xcc},
1548 {0xb3, 0x5c, 0x01, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001549 {}
1550};
1551
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001552static const u8 hv7131r_initQVGA_data[][4] = {
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001553 {0xb3, 0x01, 0x01, 0xcc},
1554 {0xb0, 0x03, 0x19, 0xcc},
1555 {0xb0, 0x04, 0x02, 0xcc},
1556 {0x00, 0x00, 0x20, 0xdd},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001557 {0xb3, 0x00, 0x24, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001558 {0xb3, 0x00, 0x25, 0xcc},
1559 {0xb3, 0x08, 0x01, 0xcc},
1560 {0xb3, 0x09, 0x0c, 0xcc},
1561 {0xb3, 0x05, 0x01, 0xcc},
1562 {0xb3, 0x06, 0x03, 0xcc},
1563 {0xb3, 0x01, 0x45, 0xcc},
1564 {0xb3, 0x03, 0x0b, 0xcc},
1565 {0xb3, 0x04, 0x05, 0xcc},
1566 {0xb3, 0x20, 0x00, 0xcc},
1567 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001568 {0xb3, 0x22, 0x01, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001569 {0xb3, 0x23, 0xe0, 0xcc},
1570 {0xb3, 0x14, 0x00, 0xcc},
1571 {0xb3, 0x15, 0x02, 0xcc},
1572 {0xb3, 0x16, 0x02, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001573 {0xb3, 0x17, 0x7f, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001574 {0xb3, 0x34, 0x01, 0xcc},
1575 {0xb3, 0x35, 0x91, 0xcc},
1576 {0xb3, 0x00, 0x27, 0xcc},
1577 {0xbc, 0x00, 0xd3, 0xcc},
1578 {0xb8, 0x00, 0x23, 0xcc},
1579 {0xb8, 0x2c, 0x50, 0xcc},
1580 {0xb8, 0x2d, 0xf8, 0xcc},
1581 {0xb8, 0x2e, 0xf8, 0xcc},
1582 {0xb8, 0x2f, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001583 {0xb8, 0x30, 0x50, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001584 {0xb8, 0x31, 0xf8, 0xcc},
1585 {0xb8, 0x32, 0xf8, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001586 {0xb8, 0x33, 0xf8, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001587 {0xb8, 0x34, 0x58, 0xcc},
1588 {0xb8, 0x35, 0x00, 0xcc},
1589 {0xb8, 0x36, 0x00, 0xcc},
1590 {0xb8, 0x37, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001591 {0xb8, 0x27, 0x20, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001592 {0xb8, 0x01, 0x7d, 0xcc},
1593 {0xb8, 0x81, 0x09, 0xcc},
1594 {0xb3, 0x01, 0x41, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001595 {0xb8, 0x8e, 0x00, 0xcc},
Jean-Francois Moine0ee7e4d2009-09-01 13:49:05 -03001596 {0xb8, 0x8f, 0xff, 0xcc},
1597 {0x00, 0x01, 0x0c, 0xaa},
1598 {0x00, 0x14, 0x01, 0xaa},
1599 {0x00, 0x15, 0xe6, 0xaa},
1600 {0x00, 0x16, 0x02, 0xaa},
1601 {0x00, 0x17, 0x86, 0xaa},
1602 {0x00, 0x23, 0x00, 0xaa},
1603 {0x00, 0x25, 0x03, 0xaa},
1604 {0x00, 0x26, 0xa9, 0xaa},
1605 {0x00, 0x27, 0x80, 0xaa},
1606 {0x00, 0x30, 0x18, 0xaa},
1607 {0xb6, 0x00, 0x00, 0xcc},
1608 {0xb6, 0x03, 0x01, 0xcc},
1609 {0xb6, 0x02, 0x40, 0xcc},
1610 {0xb6, 0x05, 0x00, 0xcc},
1611 {0xb6, 0x04, 0xf0, 0xcc},
1612 {0xb6, 0x12, 0x78, 0xcc},
1613 {0xb6, 0x18, 0x00, 0xcc},
1614 {0xb6, 0x17, 0x96, 0xcc},
1615 {0xb6, 0x16, 0x00, 0xcc},
1616 {0xb6, 0x22, 0x12, 0xcc},
1617 {0xb6, 0x23, 0x0b, 0xcc},
1618 {0xb3, 0x02, 0x02, 0xcc},
1619 {0xbf, 0xc0, 0x39, 0xcc},
1620 {0xbf, 0xc1, 0x04, 0xcc},
1621 {0xbf, 0xcc, 0x10, 0xcc},
1622 {0xbc, 0x02, 0x18, 0xcc},
1623 {0xbc, 0x03, 0x50, 0xcc},
1624 {0xbc, 0x04, 0x18, 0xcc},
1625 {0xbc, 0x05, 0x00, 0xcc},
1626 {0xbc, 0x06, 0x00, 0xcc},
1627 {0xbc, 0x08, 0x30, 0xcc},
1628 {0xbc, 0x09, 0x40, 0xcc},
1629 {0xbc, 0x0a, 0x10, 0xcc},
1630 {0xbc, 0x0b, 0x00, 0xcc},
1631 {0xbc, 0x0c, 0x00, 0xcc},
1632 {0xb9, 0x12, 0x00, 0xcc},
1633 {0xb9, 0x13, 0x0a, 0xcc},
1634 {0xb9, 0x14, 0x0a, 0xcc},
1635 {0xb9, 0x15, 0x0a, 0xcc},
1636 {0xb9, 0x16, 0x0a, 0xcc},
1637 {0xb9, 0x18, 0x00, 0xcc},
1638 {0xb9, 0x19, 0x0f, 0xcc},
1639 {0xb8, 0x0c, 0x20, 0xcc},
1640 {0xb8, 0x0d, 0x70, 0xcc},
1641 {0xb9, 0x1a, 0x0f, 0xcc},
1642 {0xb9, 0x1b, 0x0f, 0xcc},
1643 {0xb9, 0x1c, 0x0f, 0xcc},
1644 {0xb6, 0x12, 0xf8, 0xcc},
1645 {0xb6, 0x13, 0x13, 0xcc},
1646 {0xb3, 0x5c, 0x01, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001647 {}
1648};
1649
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001650static const u8 ov7660_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001651 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1652 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1653};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001654static const u8 ov7660_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001655 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1656};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001657static const u8 ov7660_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001658 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1659 {0x00, 0x00, 0x50, 0xdd},
1660 {0xb0, 0x03, 0x01, 0xcc},
1661 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1662 {0xb3, 0x05, 0x01, 0xcc},
1663 {0xb3, 0x06, 0x03, 0xcc},
1664 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1665 {0xb3, 0x05, 0x00, 0xcc},
1666 {0xb3, 0x06, 0x01, 0xcc},
1667 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1668 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1669 {0xb3, 0x21, 0x00, 0xcc},
1670 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1671 {0xb3, 0x1f, 0x02, 0xcc},
1672 {0xb3, 0x34, 0x01, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03001673 {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
1674 {0xb3, 0x00, 0x26, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001675 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1676 {0xb8, 0x01, 0x7d, 0xcc},
1677 {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1678 {0xb8, 0x27, 0x20, 0xcc},
1679 {0xb8, 0x8f, 0x50, 0xcc},
1680 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1681 {0x00, 0x12, 0x80, 0xaa},
1682 {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001683 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001684 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1685 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1686 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1687 {0x00, 0x13, 0xa7, 0xaa},
1688 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1689 {0x00, 0x36, 0x00, 0xaa},
1690 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1691 {0x00, 0x39, 0x43, 0xaa},
1692 {0x00, 0x8d, 0xcf, 0xaa},
1693 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1694 {0x00, 0x0f, 0x62, 0xaa},
1695 {0x00, 0x35, 0x84, 0xaa},
1696 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1697 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1698 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1699 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1700 {0x00, 0x01, 0x80, 0xaa},
1701 {0x00, 0x02, 0x80, 0xaa},
1702 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1703 {0xb9, 0x00, 0x28, 0xcc},
1704 {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
1705 {0xb9, 0x03, 0x00, 0xcc},
1706 {0xb9, 0x04, 0x00, 0xcc},
1707 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1708 {0xb9, 0x07, 0x3c, 0xcc},
1709 {0xb9, 0x08, 0x3c, 0xcc},
1710
1711 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1712
1713 {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
1714 {}
1715};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001716static const u8 ov7660_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001717 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1718 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1719 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1720 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
1721 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1722 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1723 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1724 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1725 {0xb3, 0x21, 0x00, 0xcc},
1726 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1727 {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1728 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1729 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1730 {0xb8, 0x01, 0x7d, 0xcc},
1731/* sizer */
1732 {0xbc, 0x00, 0xd3, 0xcc},
1733 {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1734 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
1735 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1736 {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001737 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001738 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1739 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1740 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1741 {0x00, 0x13, 0xa7, 0xaa},
1742 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1743 {0x00, 0x36, 0x00, 0xaa},
1744 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1745 {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
1746 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1747 {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
1748 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1749 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1750 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1751 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1752 {0x00, 0x01, 0x80, 0xaa},
1753 {0x00, 0x02, 0x80, 0xaa},
1754/* sizer filters */
1755 {0xbc, 0x02, 0x08, 0xcc},
1756 {0xbc, 0x03, 0x70, 0xcc},
1757 {0xb8, 0x35, 0x00, 0xcc},
1758 {0xb8, 0x36, 0x00, 0xcc},
1759 {0xb8, 0x37, 0x00, 0xcc},
1760 {0xbc, 0x04, 0x08, 0xcc},
1761 {0xbc, 0x05, 0x00, 0xcc},
1762 {0xbc, 0x06, 0x00, 0xcc},
1763 {0xbc, 0x08, 0x3c, 0xcc},
1764 {0xbc, 0x09, 0x40, 0xcc},
1765 {0xbc, 0x0a, 0x04, 0xcc},
1766 {0xbc, 0x0b, 0x00, 0xcc},
1767 {0xbc, 0x0c, 0x00, 0xcc},
1768/* */
1769 {0xb8, 0xfe, 0x00, 0xcc},
1770 {0xb8, 0xff, 0x28, 0xcc},
1771/* */
1772 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1773 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1774 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1775 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1776 {0xb9, 0x08, 0x3c, 0xcc},
1777/* */
1778 {0xb8, 0x8e, 0x00, 0xcc},
1779 {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1780 {0x00, 0x29, 0x3c, 0xaa},
1781 {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001782 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001783};
1784
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001785static const u8 ov7660_50HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001786 {0x00, 0x3b, 0x08, 0xaa},
1787 {0x00, 0x9d, 0x40, 0xaa},
1788 {0x00, 0x13, 0xa7, 0xaa},
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001789 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001790};
1791
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001792static const u8 ov7660_60HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001793 {0x00, 0x3b, 0x00, 0xaa},
1794 {0x00, 0x9e, 0x40, 0xaa},
1795 {0x00, 0x13, 0xa7, 0xaa},
1796 {}
1797};
1798
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03001799static const u8 ov7660_NoFliker[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001800 {0x00, 0x13, 0x87, 0xaa},
1801 {}
1802};
1803
Jean-François Moine5624c642010-04-02 07:12:42 -03001804static const u8 ov7670_InitVGA[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001805 {0xb3, 0x01, 0x05, 0xcc},
Jean-François Moine5624c642010-04-02 07:12:42 -03001806 {0x00, 0x00, 0x30, 0xdd},
1807 {0xb0, 0x03, 0x19, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001808 {0x00, 0x00, 0x10, 0xdd},
Jean-François Moine5624c642010-04-02 07:12:42 -03001809 {0xb0, 0x04, 0x02, 0xcc},
1810 {0x00, 0x00, 0x10, 0xdd},
1811 {0xb3, 0x00, 0x66, 0xcc},
1812 {0xb3, 0x00, 0x67, 0xcc},
1813 {0xb0, 0x16, 0x01, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03001814 {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
1815 {0xb3, 0x34, 0x01, 0xcc},
Jean-François Moine5624c642010-04-02 07:12:42 -03001816 {0xb3, 0x05, 0x01, 0xcc},
1817 {0xb3, 0x06, 0x01, 0xcc},
1818 {0xb3, 0x08, 0x01, 0xcc},
1819 {0xb3, 0x09, 0x0c, 0xcc},
1820 {0xb3, 0x02, 0x02, 0xcc},
1821 {0xb3, 0x03, 0x1f, 0xcc},
1822 {0xb3, 0x14, 0x00, 0xcc},
1823 {0xb3, 0x15, 0x00, 0xcc},
1824 {0xb3, 0x16, 0x02, 0xcc},
1825 {0xb3, 0x17, 0x7f, 0xcc},
1826 {0xb3, 0x04, 0x05, 0xcc},
1827 {0xb3, 0x20, 0x00, 0xcc},
1828 {0xb3, 0x21, 0x00, 0xcc},
1829 {0xb3, 0x22, 0x01, 0xcc},
1830 {0xb3, 0x23, 0xe0, 0xcc},
1831 {0xbc, 0x00, 0x41, 0xcc},
1832 {0xbc, 0x01, 0x01, 0xcc},
1833 {0x00, 0x12, 0x80, 0xaa},
1834 {0x00, 0x00, 0x20, 0xdd},
1835 {0x00, 0x12, 0x00, 0xaa},
1836 {0x00, 0x11, 0x40, 0xaa},
1837 {0x00, 0x6b, 0x0a, 0xaa},
1838 {0x00, 0x3a, 0x04, 0xaa},
1839 {0x00, 0x40, 0xc0, 0xaa},
1840 {0x00, 0x8c, 0x00, 0xaa},
1841 {0x00, 0x7a, 0x29, 0xaa},
1842 {0x00, 0x7b, 0x0e, 0xaa},
1843 {0x00, 0x7c, 0x1a, 0xaa},
1844 {0x00, 0x7d, 0x31, 0xaa},
1845 {0x00, 0x7e, 0x53, 0xaa},
1846 {0x00, 0x7f, 0x60, 0xaa},
1847 {0x00, 0x80, 0x6b, 0xaa},
1848 {0x00, 0x81, 0x73, 0xaa},
1849 {0x00, 0x82, 0x7b, 0xaa},
1850 {0x00, 0x83, 0x82, 0xaa},
1851 {0x00, 0x84, 0x89, 0xaa},
1852 {0x00, 0x85, 0x96, 0xaa},
1853 {0x00, 0x86, 0xa1, 0xaa},
1854 {0x00, 0x87, 0xb7, 0xaa},
1855 {0x00, 0x88, 0xcc, 0xaa},
1856 {0x00, 0x89, 0xe1, 0xaa},
1857 {0x00, 0x13, 0xe0, 0xaa},
1858 {0x00, 0x00, 0x00, 0xaa},
1859 {0x00, 0x10, 0x00, 0xaa},
1860 {0x00, 0x0d, 0x40, 0xaa},
1861 {0x00, 0x14, 0x28, 0xaa},
1862 {0x00, 0xa5, 0x05, 0xaa},
1863 {0x00, 0xab, 0x07, 0xaa},
1864 {0x00, 0x24, 0x95, 0xaa},
1865 {0x00, 0x25, 0x33, 0xaa},
1866 {0x00, 0x26, 0xe3, 0xaa},
1867 {0x00, 0x9f, 0x88, 0xaa},
1868 {0x00, 0xa0, 0x78, 0xaa},
1869 {0x00, 0x55, 0x90, 0xaa},
1870 {0x00, 0xa1, 0x03, 0xaa},
1871 {0x00, 0xa6, 0xe0, 0xaa},
1872 {0x00, 0xa7, 0xd8, 0xaa},
1873 {0x00, 0xa8, 0xf0, 0xaa},
1874 {0x00, 0xa9, 0x90, 0xaa},
1875 {0x00, 0xaa, 0x14, 0xaa},
1876 {0x00, 0x13, 0xe5, 0xaa},
1877 {0x00, 0x0e, 0x61, 0xaa},
1878 {0x00, 0x0f, 0x4b, 0xaa},
1879 {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001880 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1881 {0x00, 0x21, 0x02, 0xaa},
Jean-François Moine5624c642010-04-02 07:12:42 -03001882 {0x00, 0x22, 0x91, 0xaa},
1883 {0x00, 0x29, 0x07, 0xaa},
1884 {0x00, 0x33, 0x0b, 0xaa},
1885 {0x00, 0x35, 0x0b, 0xaa},
1886 {0x00, 0x37, 0x1d, 0xaa},
1887 {0x00, 0x38, 0x71, 0xaa},
1888 {0x00, 0x39, 0x2a, 0xaa},
1889 {0x00, 0x3c, 0x78, 0xaa},
1890 {0x00, 0x4d, 0x40, 0xaa},
1891 {0x00, 0x4e, 0x20, 0xaa},
1892 {0x00, 0x74, 0x19, 0xaa},
1893 {0x00, 0x8d, 0x4f, 0xaa},
1894 {0x00, 0x8e, 0x00, 0xaa},
1895 {0x00, 0x8f, 0x00, 0xaa},
1896 {0x00, 0x90, 0x00, 0xaa},
1897 {0x00, 0x91, 0x00, 0xaa},
1898 {0x00, 0x96, 0x00, 0xaa},
1899 {0x00, 0x9a, 0x80, 0xaa},
1900 {0x00, 0xb0, 0x84, 0xaa},
1901 {0x00, 0xb1, 0x0c, 0xaa},
1902 {0x00, 0xb2, 0x0e, 0xaa},
1903 {0x00, 0xb3, 0x82, 0xaa},
1904 {0x00, 0xb8, 0x0a, 0xaa},
1905 {0x00, 0x43, 0x14, 0xaa},
1906 {0x00, 0x44, 0xf0, 0xaa},
1907 {0x00, 0x45, 0x45, 0xaa},
1908 {0x00, 0x46, 0x63, 0xaa},
1909 {0x00, 0x47, 0x2d, 0xaa},
1910 {0x00, 0x48, 0x46, 0xaa},
1911 {0x00, 0x59, 0x88, 0xaa},
1912 {0x00, 0x5a, 0xa0, 0xaa},
1913 {0x00, 0x5b, 0xc6, 0xaa},
1914 {0x00, 0x5c, 0x7d, 0xaa},
1915 {0x00, 0x5d, 0x5f, 0xaa},
1916 {0x00, 0x5e, 0x19, 0xaa},
1917 {0x00, 0x6c, 0x0a, 0xaa},
1918 {0x00, 0x6d, 0x55, 0xaa},
1919 {0x00, 0x6e, 0x11, 0xaa},
1920 {0x00, 0x6f, 0x9e, 0xaa},
1921 {0x00, 0x69, 0x00, 0xaa},
1922 {0x00, 0x6a, 0x40, 0xaa},
1923 {0x00, 0x01, 0x40, 0xaa},
1924 {0x00, 0x02, 0x40, 0xaa},
1925 {0x00, 0x13, 0xe7, 0xaa},
1926 {0x00, 0x5f, 0xf0, 0xaa},
1927 {0x00, 0x60, 0xf0, 0xaa},
1928 {0x00, 0x61, 0xf0, 0xaa},
1929 {0x00, 0x27, 0xa0, 0xaa},
1930 {0x00, 0x28, 0x80, 0xaa},
1931 {0x00, 0x2c, 0x90, 0xaa},
1932 {0x00, 0x4f, 0x66, 0xaa},
1933 {0x00, 0x50, 0x66, 0xaa},
1934 {0x00, 0x51, 0x00, 0xaa},
1935 {0x00, 0x52, 0x22, 0xaa},
1936 {0x00, 0x53, 0x5e, 0xaa},
1937 {0x00, 0x54, 0x80, 0xaa},
1938 {0x00, 0x58, 0x9e, 0xaa},
1939 {0x00, 0x41, 0x08, 0xaa},
1940 {0x00, 0x3f, 0x00, 0xaa},
1941 {0x00, 0x75, 0x85, 0xaa},
1942 {0x00, 0x76, 0xe1, 0xaa},
1943 {0x00, 0x4c, 0x00, 0xaa},
1944 {0x00, 0x77, 0x0a, 0xaa},
1945 {0x00, 0x3d, 0x88, 0xaa},
1946 {0x00, 0x4b, 0x09, 0xaa},
1947 {0x00, 0xc9, 0x60, 0xaa},
1948 {0x00, 0x41, 0x38, 0xaa},
1949 {0x00, 0x62, 0x30, 0xaa},
1950 {0x00, 0x63, 0x30, 0xaa},
1951 {0x00, 0x64, 0x08, 0xaa},
1952 {0x00, 0x94, 0x07, 0xaa},
1953 {0x00, 0x95, 0x0b, 0xaa},
1954 {0x00, 0x65, 0x00, 0xaa},
1955 {0x00, 0x66, 0x05, 0xaa},
1956 {0x00, 0x56, 0x50, 0xaa},
1957 {0x00, 0x34, 0x11, 0xaa},
1958 {0x00, 0xa4, 0x88, 0xaa},
1959 {0x00, 0x96, 0x00, 0xaa},
1960 {0x00, 0x97, 0x30, 0xaa},
1961 {0x00, 0x98, 0x20, 0xaa},
1962 {0x00, 0x99, 0x30, 0xaa},
1963 {0x00, 0x9a, 0x84, 0xaa},
1964 {0x00, 0x9b, 0x29, 0xaa},
1965 {0x00, 0x9c, 0x03, 0xaa},
1966 {0x00, 0x78, 0x04, 0xaa},
1967 {0x00, 0x79, 0x01, 0xaa},
1968 {0x00, 0xc8, 0xf0, 0xaa},
1969 {0x00, 0x79, 0x0f, 0xaa},
1970 {0x00, 0xc8, 0x00, 0xaa},
1971 {0x00, 0x79, 0x10, 0xaa},
1972 {0x00, 0xc8, 0x7e, 0xaa},
1973 {0x00, 0x79, 0x0a, 0xaa},
1974 {0x00, 0xc8, 0x80, 0xaa},
1975 {0x00, 0x79, 0x0b, 0xaa},
1976 {0x00, 0xc8, 0x01, 0xaa},
1977 {0x00, 0x79, 0x0c, 0xaa},
1978 {0x00, 0xc8, 0x0f, 0xaa},
1979 {0x00, 0x79, 0x0d, 0xaa},
1980 {0x00, 0xc8, 0x20, 0xaa},
1981 {0x00, 0x79, 0x09, 0xaa},
1982 {0x00, 0xc8, 0x80, 0xaa},
1983 {0x00, 0x79, 0x02, 0xaa},
1984 {0x00, 0xc8, 0xc0, 0xaa},
1985 {0x00, 0x79, 0x03, 0xaa},
1986 {0x00, 0xc8, 0x40, 0xaa},
1987 {0x00, 0x79, 0x05, 0xaa},
1988 {0x00, 0xc8, 0x30, 0xaa},
1989 {0x00, 0x79, 0x26, 0xaa},
1990 {0x00, 0x11, 0x40, 0xaa},
1991 {0x00, 0x3a, 0x04, 0xaa},
1992 {0x00, 0x12, 0x00, 0xaa},
1993 {0x00, 0x40, 0xc0, 0xaa},
1994 {0x00, 0x8c, 0x00, 0xaa},
1995 {0x00, 0x17, 0x14, 0xaa},
1996 {0x00, 0x18, 0x02, 0xaa},
1997 {0x00, 0x32, 0x92, 0xaa},
1998 {0x00, 0x19, 0x02, 0xaa},
1999 {0x00, 0x1a, 0x7a, 0xaa},
2000 {0x00, 0x03, 0x0a, 0xaa},
2001 {0x00, 0x0c, 0x00, 0xaa},
2002 {0x00, 0x3e, 0x00, 0xaa},
2003 {0x00, 0x70, 0x3a, 0xaa},
2004 {0x00, 0x71, 0x35, 0xaa},
2005 {0x00, 0x72, 0x11, 0xaa},
2006 {0x00, 0x73, 0xf0, 0xaa},
2007 {0x00, 0xa2, 0x02, 0xaa},
2008 {0x00, 0xb1, 0x00, 0xaa},
2009 {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002010 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
2011 {0x00, 0xaa, 0x14, 0xaa},
Jean-François Moine5624c642010-04-02 07:12:42 -03002012 {0x00, 0x24, 0x80, 0xaa},
2013 {0x00, 0x25, 0x74, 0xaa},
2014 {0x00, 0x26, 0xd3, 0xaa},
2015 {0x00, 0x0d, 0x00, 0xaa},
2016 {0x00, 0x14, 0x18, 0xaa},
2017 {0x00, 0x9d, 0x99, 0xaa},
2018 {0x00, 0x9e, 0x7f, 0xaa},
2019 {0x00, 0x64, 0x08, 0xaa},
2020 {0x00, 0x94, 0x07, 0xaa},
2021 {0x00, 0x95, 0x06, 0xaa},
2022 {0x00, 0x66, 0x05, 0xaa},
2023 {0x00, 0x41, 0x08, 0xaa},
2024 {0x00, 0x3f, 0x00, 0xaa},
2025 {0x00, 0x75, 0x07, 0xaa},
2026 {0x00, 0x76, 0xe1, 0xaa},
2027 {0x00, 0x4c, 0x00, 0xaa},
2028 {0x00, 0x77, 0x00, 0xaa},
2029 {0x00, 0x3d, 0xc2, 0xaa},
2030 {0x00, 0x4b, 0x09, 0xaa},
2031 {0x00, 0xc9, 0x60, 0xaa},
2032 {0x00, 0x41, 0x38, 0xaa},
2033 {0xbf, 0xc0, 0x26, 0xcc},
2034 {0xbf, 0xc1, 0x02, 0xcc},
2035 {0xbf, 0xcc, 0x04, 0xcc},
2036 {0xb3, 0x5c, 0x01, 0xcc},
2037 {0xb3, 0x01, 0x45, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002038 {0x00, 0x77, 0x05, 0xaa},
2039 {},
2040};
2041
Jean-François Moine5624c642010-04-02 07:12:42 -03002042static const u8 ov7670_InitQVGA[][4] = {
2043 {0xb3, 0x01, 0x05, 0xcc},
2044 {0x00, 0x00, 0x30, 0xdd},
2045 {0xb0, 0x03, 0x19, 0xcc},
2046 {0x00, 0x00, 0x10, 0xdd},
2047 {0xb0, 0x04, 0x02, 0xcc},
2048 {0x00, 0x00, 0x10, 0xdd},
2049 {0xb3, 0x00, 0x66, 0xcc},
2050 {0xb3, 0x00, 0x67, 0xcc},
2051 {0xb0, 0x16, 0x01, 0xcc},
2052 {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
2053 {0xb3, 0x34, 0x01, 0xcc},
2054 {0xb3, 0x05, 0x01, 0xcc},
2055 {0xb3, 0x06, 0x01, 0xcc},
2056 {0xb3, 0x08, 0x01, 0xcc},
2057 {0xb3, 0x09, 0x0c, 0xcc},
2058 {0xb3, 0x02, 0x02, 0xcc},
2059 {0xb3, 0x03, 0x1f, 0xcc},
2060 {0xb3, 0x14, 0x00, 0xcc},
2061 {0xb3, 0x15, 0x00, 0xcc},
2062 {0xb3, 0x16, 0x02, 0xcc},
2063 {0xb3, 0x17, 0x7f, 0xcc},
2064 {0xb3, 0x04, 0x05, 0xcc},
2065 {0xb3, 0x20, 0x00, 0xcc},
2066 {0xb3, 0x21, 0x00, 0xcc},
2067 {0xb3, 0x22, 0x01, 0xcc},
2068 {0xb3, 0x23, 0xe0, 0xcc},
2069 {0xbc, 0x00, 0xd1, 0xcc},
2070 {0xbc, 0x01, 0x01, 0xcc},
2071 {0x00, 0x12, 0x80, 0xaa},
2072 {0x00, 0x00, 0x20, 0xdd},
2073 {0x00, 0x12, 0x00, 0xaa},
2074 {0x00, 0x11, 0x40, 0xaa},
2075 {0x00, 0x6b, 0x0a, 0xaa},
2076 {0x00, 0x3a, 0x04, 0xaa},
2077 {0x00, 0x40, 0xc0, 0xaa},
2078 {0x00, 0x8c, 0x00, 0xaa},
2079 {0x00, 0x7a, 0x29, 0xaa},
2080 {0x00, 0x7b, 0x0e, 0xaa},
2081 {0x00, 0x7c, 0x1a, 0xaa},
2082 {0x00, 0x7d, 0x31, 0xaa},
2083 {0x00, 0x7e, 0x53, 0xaa},
2084 {0x00, 0x7f, 0x60, 0xaa},
2085 {0x00, 0x80, 0x6b, 0xaa},
2086 {0x00, 0x81, 0x73, 0xaa},
2087 {0x00, 0x82, 0x7b, 0xaa},
2088 {0x00, 0x83, 0x82, 0xaa},
2089 {0x00, 0x84, 0x89, 0xaa},
2090 {0x00, 0x85, 0x96, 0xaa},
2091 {0x00, 0x86, 0xa1, 0xaa},
2092 {0x00, 0x87, 0xb7, 0xaa},
2093 {0x00, 0x88, 0xcc, 0xaa},
2094 {0x00, 0x89, 0xe1, 0xaa},
2095 {0x00, 0x13, 0xe0, 0xaa},
2096 {0x00, 0x00, 0x00, 0xaa},
2097 {0x00, 0x10, 0x00, 0xaa},
2098 {0x00, 0x0d, 0x40, 0xaa},
2099 {0x00, 0x14, 0x28, 0xaa},
2100 {0x00, 0xa5, 0x05, 0xaa},
2101 {0x00, 0xab, 0x07, 0xaa},
2102 {0x00, 0x24, 0x95, 0xaa},
2103 {0x00, 0x25, 0x33, 0xaa},
2104 {0x00, 0x26, 0xe3, 0xaa},
2105 {0x00, 0x9f, 0x88, 0xaa},
2106 {0x00, 0xa0, 0x78, 0xaa},
2107 {0x00, 0x55, 0x90, 0xaa},
2108 {0x00, 0xa1, 0x03, 0xaa},
2109 {0x00, 0xa6, 0xe0, 0xaa},
2110 {0x00, 0xa7, 0xd8, 0xaa},
2111 {0x00, 0xa8, 0xf0, 0xaa},
2112 {0x00, 0xa9, 0x90, 0xaa},
2113 {0x00, 0xaa, 0x14, 0xaa},
2114 {0x00, 0x13, 0xe5, 0xaa},
2115 {0x00, 0x0e, 0x61, 0xaa},
2116 {0x00, 0x0f, 0x4b, 0xaa},
2117 {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002118 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
2119 {0x00, 0x21, 0x02, 0xaa},
Jean-François Moine5624c642010-04-02 07:12:42 -03002120 {0x00, 0x22, 0x91, 0xaa},
2121 {0x00, 0x29, 0x07, 0xaa},
2122 {0x00, 0x33, 0x0b, 0xaa},
2123 {0x00, 0x35, 0x0b, 0xaa},
2124 {0x00, 0x37, 0x1d, 0xaa},
2125 {0x00, 0x38, 0x71, 0xaa},
2126 {0x00, 0x39, 0x2a, 0xaa},
2127 {0x00, 0x3c, 0x78, 0xaa},
2128 {0x00, 0x4d, 0x40, 0xaa},
2129 {0x00, 0x4e, 0x20, 0xaa},
2130 {0x00, 0x74, 0x19, 0xaa},
2131 {0x00, 0x8d, 0x4f, 0xaa},
2132 {0x00, 0x8e, 0x00, 0xaa},
2133 {0x00, 0x8f, 0x00, 0xaa},
2134 {0x00, 0x90, 0x00, 0xaa},
2135 {0x00, 0x91, 0x00, 0xaa},
2136 {0x00, 0x96, 0x00, 0xaa},
2137 {0x00, 0x9a, 0x80, 0xaa},
2138 {0x00, 0xb0, 0x84, 0xaa},
2139 {0x00, 0xb1, 0x0c, 0xaa},
2140 {0x00, 0xb2, 0x0e, 0xaa},
2141 {0x00, 0xb3, 0x82, 0xaa},
2142 {0x00, 0xb8, 0x0a, 0xaa},
2143 {0x00, 0x43, 0x14, 0xaa},
2144 {0x00, 0x44, 0xf0, 0xaa},
2145 {0x00, 0x45, 0x45, 0xaa},
2146 {0x00, 0x46, 0x63, 0xaa},
2147 {0x00, 0x47, 0x2d, 0xaa},
2148 {0x00, 0x48, 0x46, 0xaa},
2149 {0x00, 0x59, 0x88, 0xaa},
2150 {0x00, 0x5a, 0xa0, 0xaa},
2151 {0x00, 0x5b, 0xc6, 0xaa},
2152 {0x00, 0x5c, 0x7d, 0xaa},
2153 {0x00, 0x5d, 0x5f, 0xaa},
2154 {0x00, 0x5e, 0x19, 0xaa},
2155 {0x00, 0x6c, 0x0a, 0xaa},
2156 {0x00, 0x6d, 0x55, 0xaa},
2157 {0x00, 0x6e, 0x11, 0xaa},
2158 {0x00, 0x6f, 0x9e, 0xaa},
2159 {0x00, 0x69, 0x00, 0xaa},
2160 {0x00, 0x6a, 0x40, 0xaa},
2161 {0x00, 0x01, 0x40, 0xaa},
2162 {0x00, 0x02, 0x40, 0xaa},
2163 {0x00, 0x13, 0xe7, 0xaa},
2164 {0x00, 0x5f, 0xf0, 0xaa},
2165 {0x00, 0x60, 0xf0, 0xaa},
2166 {0x00, 0x61, 0xf0, 0xaa},
2167 {0x00, 0x27, 0xa0, 0xaa},
2168 {0x00, 0x28, 0x80, 0xaa},
2169 {0x00, 0x2c, 0x90, 0xaa},
2170 {0x00, 0x4f, 0x66, 0xaa},
2171 {0x00, 0x50, 0x66, 0xaa},
2172 {0x00, 0x51, 0x00, 0xaa},
2173 {0x00, 0x52, 0x22, 0xaa},
2174 {0x00, 0x53, 0x5e, 0xaa},
2175 {0x00, 0x54, 0x80, 0xaa},
2176 {0x00, 0x58, 0x9e, 0xaa},
2177 {0x00, 0x41, 0x08, 0xaa},
2178 {0x00, 0x3f, 0x00, 0xaa},
2179 {0x00, 0x75, 0x85, 0xaa},
2180 {0x00, 0x76, 0xe1, 0xaa},
2181 {0x00, 0x4c, 0x00, 0xaa},
2182 {0x00, 0x77, 0x0a, 0xaa},
2183 {0x00, 0x3d, 0x88, 0xaa},
2184 {0x00, 0x4b, 0x09, 0xaa},
2185 {0x00, 0xc9, 0x60, 0xaa},
2186 {0x00, 0x41, 0x38, 0xaa},
2187 {0x00, 0x62, 0x30, 0xaa},
2188 {0x00, 0x63, 0x30, 0xaa},
2189 {0x00, 0x64, 0x08, 0xaa},
2190 {0x00, 0x94, 0x07, 0xaa},
2191 {0x00, 0x95, 0x0b, 0xaa},
2192 {0x00, 0x65, 0x00, 0xaa},
2193 {0x00, 0x66, 0x05, 0xaa},
2194 {0x00, 0x56, 0x50, 0xaa},
2195 {0x00, 0x34, 0x11, 0xaa},
2196 {0x00, 0xa4, 0x88, 0xaa},
2197 {0x00, 0x96, 0x00, 0xaa},
2198 {0x00, 0x97, 0x30, 0xaa},
2199 {0x00, 0x98, 0x20, 0xaa},
2200 {0x00, 0x99, 0x30, 0xaa},
2201 {0x00, 0x9a, 0x84, 0xaa},
2202 {0x00, 0x9b, 0x29, 0xaa},
2203 {0x00, 0x9c, 0x03, 0xaa},
2204 {0x00, 0x78, 0x04, 0xaa},
2205 {0x00, 0x79, 0x01, 0xaa},
2206 {0x00, 0xc8, 0xf0, 0xaa},
2207 {0x00, 0x79, 0x0f, 0xaa},
2208 {0x00, 0xc8, 0x00, 0xaa},
2209 {0x00, 0x79, 0x10, 0xaa},
2210 {0x00, 0xc8, 0x7e, 0xaa},
2211 {0x00, 0x79, 0x0a, 0xaa},
2212 {0x00, 0xc8, 0x80, 0xaa},
2213 {0x00, 0x79, 0x0b, 0xaa},
2214 {0x00, 0xc8, 0x01, 0xaa},
2215 {0x00, 0x79, 0x0c, 0xaa},
2216 {0x00, 0xc8, 0x0f, 0xaa},
2217 {0x00, 0x79, 0x0d, 0xaa},
2218 {0x00, 0xc8, 0x20, 0xaa},
2219 {0x00, 0x79, 0x09, 0xaa},
2220 {0x00, 0xc8, 0x80, 0xaa},
2221 {0x00, 0x79, 0x02, 0xaa},
2222 {0x00, 0xc8, 0xc0, 0xaa},
2223 {0x00, 0x79, 0x03, 0xaa},
2224 {0x00, 0xc8, 0x40, 0xaa},
2225 {0x00, 0x79, 0x05, 0xaa},
2226 {0x00, 0xc8, 0x30, 0xaa},
2227 {0x00, 0x79, 0x26, 0xaa},
2228 {0x00, 0x11, 0x40, 0xaa},
2229 {0x00, 0x3a, 0x04, 0xaa},
2230 {0x00, 0x12, 0x00, 0xaa},
2231 {0x00, 0x40, 0xc0, 0xaa},
2232 {0x00, 0x8c, 0x00, 0xaa},
2233 {0x00, 0x17, 0x14, 0xaa},
2234 {0x00, 0x18, 0x02, 0xaa},
2235 {0x00, 0x32, 0x92, 0xaa},
2236 {0x00, 0x19, 0x02, 0xaa},
2237 {0x00, 0x1a, 0x7a, 0xaa},
2238 {0x00, 0x03, 0x0a, 0xaa},
2239 {0x00, 0x0c, 0x00, 0xaa},
2240 {0x00, 0x3e, 0x00, 0xaa},
2241 {0x00, 0x70, 0x3a, 0xaa},
2242 {0x00, 0x71, 0x35, 0xaa},
2243 {0x00, 0x72, 0x11, 0xaa},
2244 {0x00, 0x73, 0xf0, 0xaa},
2245 {0x00, 0xa2, 0x02, 0xaa},
2246 {0x00, 0xb1, 0x00, 0xaa},
2247 {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002248 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
2249 {0x00, 0xaa, 0x14, 0xaa},
Jean-François Moine5624c642010-04-02 07:12:42 -03002250 {0x00, 0x24, 0x80, 0xaa},
2251 {0x00, 0x25, 0x74, 0xaa},
2252 {0x00, 0x26, 0xd3, 0xaa},
2253 {0x00, 0x0d, 0x00, 0xaa},
2254 {0x00, 0x14, 0x18, 0xaa},
2255 {0x00, 0x9d, 0x99, 0xaa},
2256 {0x00, 0x9e, 0x7f, 0xaa},
2257 {0x00, 0x64, 0x08, 0xaa},
2258 {0x00, 0x94, 0x07, 0xaa},
2259 {0x00, 0x95, 0x06, 0xaa},
2260 {0x00, 0x66, 0x05, 0xaa},
2261 {0x00, 0x41, 0x08, 0xaa},
2262 {0x00, 0x3f, 0x00, 0xaa},
2263 {0x00, 0x75, 0x07, 0xaa},
2264 {0x00, 0x76, 0xe1, 0xaa},
2265 {0x00, 0x4c, 0x00, 0xaa},
2266 {0x00, 0x77, 0x00, 0xaa},
2267 {0x00, 0x3d, 0xc2, 0xaa},
2268 {0x00, 0x4b, 0x09, 0xaa},
2269 {0x00, 0xc9, 0x60, 0xaa},
2270 {0x00, 0x41, 0x38, 0xaa},
2271 {0xbc, 0x02, 0x18, 0xcc},
2272 {0xbc, 0x03, 0x50, 0xcc},
2273 {0xbc, 0x04, 0x18, 0xcc},
2274 {0xbc, 0x05, 0x00, 0xcc},
2275 {0xbc, 0x06, 0x00, 0xcc},
2276 {0xbc, 0x08, 0x30, 0xcc},
2277 {0xbc, 0x09, 0x40, 0xcc},
2278 {0xbc, 0x0a, 0x10, 0xcc},
2279 {0xbc, 0x0b, 0x00, 0xcc},
2280 {0xbc, 0x0c, 0x00, 0xcc},
2281 {0xbf, 0xc0, 0x26, 0xcc},
2282 {0xbf, 0xc1, 0x02, 0xcc},
2283 {0xbf, 0xcc, 0x04, 0xcc},
2284 {0xb3, 0x5c, 0x01, 0xcc},
2285 {0xb3, 0x01, 0x45, 0xcc},
2286 {0x00, 0x77, 0x05, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002287 {},
2288};
Jean-Francois Moine88521532008-12-10 05:06:13 -03002289
2290/* PO1200 - values from usbvm326.inf and ms-win trace */
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002291static const u8 po1200_gamma[17] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002292 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
2293 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
2294};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002295static const u8 po1200_matrix[9] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002296 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
2297};
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002298static const u8 po1200_initVGA_data[][4] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002299 {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
2300 {0xb0, 0x03, 0x19, 0xcc},
2301/* {0x00, 0x00, 0x33, 0xdd}, */
2302 {0xb0, 0x04, 0x02, 0xcc},
2303 {0xb0, 0x02, 0x02, 0xcc},
2304 {0xb3, 0x5d, 0x00, 0xcc},
2305 {0xb3, 0x01, 0x01, 0xcc},
2306 {0xb3, 0x00, 0x64, 0xcc},
2307 {0xb3, 0x00, 0x65, 0xcc},
2308 {0xb3, 0x05, 0x01, 0xcc},
2309 {0xb3, 0x06, 0x01, 0xcc},
2310 {0xb3, 0x5c, 0x01, 0xcc},
2311 {0xb3, 0x08, 0x01, 0xcc},
2312 {0xb3, 0x09, 0x0c, 0xcc},
2313 {0xb3, 0x00, 0x67, 0xcc},
2314 {0xb3, 0x02, 0xb2, 0xcc},
2315 {0xb3, 0x03, 0x18, 0xcc},
2316 {0xb3, 0x04, 0x15, 0xcc},
2317 {0xb3, 0x20, 0x00, 0xcc},
2318 {0xb3, 0x21, 0x00, 0xcc},
2319 {0xb3, 0x22, 0x02, 0xcc},
2320 {0xb3, 0x23, 0x58, 0xcc},
2321 {0xb3, 0x14, 0x00, 0xcc},
2322 {0xb3, 0x15, 0x00, 0xcc},
2323 {0xb3, 0x16, 0x03, 0xcc},
2324 {0xb3, 0x17, 0x1f, 0xcc},
2325 {0xbc, 0x00, 0x71, 0xcc},
2326 {0xbc, 0x01, 0x01, 0xcc},
2327 {0xb0, 0x54, 0x13, 0xcc},
2328 {0xb3, 0x00, 0x67, 0xcc},
2329 {0xb3, 0x34, 0x01, 0xcc},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002330 {0xb3, 0x35, 0xdc, 0xcc}, /* i2c add: 5c */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002331 {0x00, 0x03, 0x00, 0xaa},
2332 {0x00, 0x12, 0x05, 0xaa},
2333 {0x00, 0x13, 0x02, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002334 {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002335 {0x00, 0x21, 0x00, 0xaa},
2336 {0x00, 0x25, 0x02, 0xaa},
2337 {0x00, 0x3c, 0x4f, 0xaa},
2338 {0x00, 0x3f, 0xe0, 0xaa},
2339 {0x00, 0x42, 0xff, 0xaa},
2340 {0x00, 0x45, 0x34, 0xaa},
2341 {0x00, 0x55, 0xfe, 0xaa},
2342 {0x00, 0x59, 0xd3, 0xaa},
2343 {0x00, 0x5e, 0x04, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002344 {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002345 {0x00, 0x62, 0x02, 0xaa},
2346 {0x00, 0xa7, 0x31, 0xaa},
2347 {0x00, 0xa9, 0x66, 0xaa},
2348 {0x00, 0xb0, 0x00, 0xaa},
2349 {0x00, 0xb1, 0x00, 0xaa},
2350 {0x00, 0xb3, 0x11, 0xaa},
2351 {0x00, 0xb6, 0x26, 0xaa},
2352 {0x00, 0xb7, 0x20, 0xaa},
2353 {0x00, 0xba, 0x04, 0xaa},
2354 {0x00, 0x88, 0x42, 0xaa},
2355 {0x00, 0x89, 0x9a, 0xaa},
2356 {0x00, 0x8a, 0x88, 0xaa},
2357 {0x00, 0x8b, 0x8e, 0xaa},
2358 {0x00, 0x8c, 0x3e, 0xaa},
2359 {0x00, 0x8d, 0x90, 0xaa},
2360 {0x00, 0x8e, 0x87, 0xaa},
2361 {0x00, 0x8f, 0x96, 0xaa},
2362 {0x00, 0x90, 0x3d, 0xaa},
2363 {0x00, 0x64, 0x00, 0xaa},
2364 {0x00, 0x65, 0x10, 0xaa},
2365 {0x00, 0x66, 0x20, 0xaa},
2366 {0x00, 0x67, 0x2b, 0xaa},
2367 {0x00, 0x68, 0x36, 0xaa},
2368 {0x00, 0x69, 0x49, 0xaa},
2369 {0x00, 0x6a, 0x5a, 0xaa},
2370 {0x00, 0x6b, 0x7f, 0xaa},
2371 {0x00, 0x6c, 0x9b, 0xaa},
2372 {0x00, 0x6d, 0xba, 0xaa},
2373 {0x00, 0x6e, 0xd4, 0xaa},
2374 {0x00, 0x6f, 0xea, 0xaa},
2375 {0x00, 0x70, 0x00, 0xaa},
2376 {0x00, 0x71, 0x10, 0xaa},
2377 {0x00, 0x72, 0x20, 0xaa},
2378 {0x00, 0x73, 0x2b, 0xaa},
2379 {0x00, 0x74, 0x36, 0xaa},
2380 {0x00, 0x75, 0x49, 0xaa},
2381 {0x00, 0x76, 0x5a, 0xaa},
2382 {0x00, 0x77, 0x7f, 0xaa},
2383 {0x00, 0x78, 0x9b, 0xaa},
2384 {0x00, 0x79, 0xba, 0xaa},
2385 {0x00, 0x7a, 0xd4, 0xaa},
2386 {0x00, 0x7b, 0xea, 0xaa},
2387 {0x00, 0x7c, 0x00, 0xaa},
2388 {0x00, 0x7d, 0x10, 0xaa},
2389 {0x00, 0x7e, 0x20, 0xaa},
2390 {0x00, 0x7f, 0x2b, 0xaa},
2391 {0x00, 0x80, 0x36, 0xaa},
2392 {0x00, 0x81, 0x49, 0xaa},
2393 {0x00, 0x82, 0x5a, 0xaa},
2394 {0x00, 0x83, 0x7f, 0xaa},
2395 {0x00, 0x84, 0x9b, 0xaa},
2396 {0x00, 0x85, 0xba, 0xaa},
2397 {0x00, 0x86, 0xd4, 0xaa},
2398 {0x00, 0x87, 0xea, 0xaa},
2399 {0x00, 0x57, 0x2a, 0xaa},
2400 {0x00, 0x03, 0x01, 0xaa},
2401 {0x00, 0x04, 0x10, 0xaa},
2402 {0x00, 0x05, 0x10, 0xaa},
2403 {0x00, 0x06, 0x10, 0xaa},
2404 {0x00, 0x07, 0x10, 0xaa},
2405 {0x00, 0x08, 0x13, 0xaa},
2406 {0x00, 0x0a, 0x00, 0xaa},
2407 {0x00, 0x0b, 0x10, 0xaa},
2408 {0x00, 0x0c, 0x20, 0xaa},
2409 {0x00, 0x0d, 0x18, 0xaa},
2410 {0x00, 0x22, 0x01, 0xaa},
2411 {0x00, 0x23, 0x60, 0xaa},
2412 {0x00, 0x25, 0x08, 0xaa},
2413 {0x00, 0x26, 0x82, 0xaa},
2414 {0x00, 0x2e, 0x0f, 0xaa},
2415 {0x00, 0x2f, 0x1e, 0xaa},
2416 {0x00, 0x30, 0x2d, 0xaa},
2417 {0x00, 0x31, 0x3c, 0xaa},
2418 {0x00, 0x32, 0x4b, 0xaa},
2419 {0x00, 0x33, 0x5a, 0xaa},
2420 {0x00, 0x34, 0x69, 0xaa},
2421 {0x00, 0x35, 0x78, 0xaa},
2422 {0x00, 0x36, 0x87, 0xaa},
2423 {0x00, 0x37, 0x96, 0xaa},
2424 {0x00, 0x38, 0xa5, 0xaa},
2425 {0x00, 0x39, 0xb4, 0xaa},
2426 {0x00, 0x3a, 0xc3, 0xaa},
2427 {0x00, 0x3b, 0xd2, 0xaa},
2428 {0x00, 0x3c, 0xe1, 0xaa},
2429 {0x00, 0x3e, 0xff, 0xaa},
2430 {0x00, 0x3f, 0xff, 0xaa},
2431 {0x00, 0x40, 0xff, 0xaa},
2432 {0x00, 0x41, 0xff, 0xaa},
2433 {0x00, 0x42, 0xff, 0xaa},
2434 {0x00, 0x43, 0xff, 0xaa},
2435 {0x00, 0x03, 0x00, 0xaa},
2436 {0x00, 0x03, 0x00, 0xaa},
2437 {0x00, 0x20, 0xc4, 0xaa},
2438 {0x00, 0x13, 0x03, 0xaa},
2439 {0x00, 0x3c, 0x50, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002440 {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002441 {0x00, 0x51, 0x5b, 0xaa},
2442 {0x00, 0x52, 0x91, 0xaa},
2443 {0x00, 0x53, 0x4c, 0xaa},
2444 {0x00, 0x54, 0x50, 0xaa},
2445 {0x00, 0x56, 0x02, 0xaa},
2446 {0xb6, 0x00, 0x00, 0xcc},
2447 {0xb6, 0x03, 0x03, 0xcc},
2448 {0xb6, 0x02, 0x20, 0xcc},
2449 {0xb6, 0x05, 0x02, 0xcc},
2450 {0xb6, 0x04, 0x58, 0xcc},
2451 {0xb6, 0x12, 0xf8, 0xcc},
2452 {0xb6, 0x13, 0x21, 0xcc},
2453 {0xb6, 0x18, 0x03, 0xcc},
2454 {0xb6, 0x17, 0xa9, 0xcc},
2455 {0xb6, 0x16, 0x80, 0xcc},
2456 {0xb6, 0x22, 0x12, 0xcc},
2457 {0xb6, 0x23, 0x0b, 0xcc},
2458 {0xbf, 0xc0, 0x39, 0xcc},
2459 {0xbf, 0xc1, 0x04, 0xcc},
2460 {0xbf, 0xcc, 0x00, 0xcc},
2461 {0xb8, 0x06, 0x20, 0xcc},
2462 {0xb8, 0x07, 0x03, 0xcc},
2463 {0xb8, 0x08, 0x58, 0xcc},
2464 {0xb8, 0x09, 0x02, 0xcc},
2465 {0xb3, 0x01, 0x41, 0xcc},
2466 {0x00, 0x03, 0x00, 0xaa},
2467 {0x00, 0xd9, 0x0f, 0xaa},
2468 {0x00, 0xda, 0xaa, 0xaa},
2469 {0x00, 0xd9, 0x10, 0xaa},
2470 {0x00, 0xda, 0xaa, 0xaa},
2471 {0x00, 0xd9, 0x11, 0xaa},
2472 {0x00, 0xda, 0x00, 0xaa},
2473 {0x00, 0xd9, 0x12, 0xaa},
2474 {0x00, 0xda, 0xff, 0xaa},
2475 {0x00, 0xd9, 0x13, 0xaa},
2476 {0x00, 0xda, 0xff, 0xaa},
2477 {0x00, 0xe8, 0x11, 0xaa},
2478 {0x00, 0xe9, 0x12, 0xaa},
2479 {0x00, 0xea, 0x5c, 0xaa},
2480 {0x00, 0xeb, 0xff, 0xaa},
2481 {0x00, 0xd8, 0x80, 0xaa},
2482 {0x00, 0xe6, 0x02, 0xaa},
2483 {0x00, 0xd6, 0x40, 0xaa},
2484 {0x00, 0xe3, 0x05, 0xaa},
2485 {0x00, 0xe0, 0x40, 0xaa},
2486 {0x00, 0xde, 0x03, 0xaa},
2487 {0x00, 0xdf, 0x03, 0xaa},
2488 {0x00, 0xdb, 0x02, 0xaa},
2489 {0x00, 0xdc, 0x00, 0xaa},
2490 {0x00, 0xdd, 0x03, 0xaa},
2491 {0x00, 0xe1, 0x08, 0xaa},
2492 {0x00, 0xe2, 0x01, 0xaa},
2493 {0x00, 0xd6, 0x40, 0xaa},
2494 {0x00, 0xe4, 0x40, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002495 {0x00, 0xa8, 0x8f, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002496 {0x00, 0xb4, 0x16, 0xaa},
2497 {0xb0, 0x02, 0x06, 0xcc},
2498 {0xb0, 0x18, 0x06, 0xcc},
2499 {0xb0, 0x19, 0x06, 0xcc},
2500 {0xb3, 0x5d, 0x18, 0xcc},
2501 {0xb3, 0x05, 0x00, 0xcc},
2502 {0xb3, 0x06, 0x00, 0xcc},
2503 {0x00, 0xb4, 0x0e, 0xaa},
2504 {0x00, 0xb5, 0x49, 0xaa},
2505 {0x00, 0xb6, 0x1c, 0xaa},
2506 {0x00, 0xb7, 0x96, 0xaa},
2507/* end of usbvm326.inf - start of ms-win trace */
2508 {0xb6, 0x12, 0xf8, 0xcc},
2509 {0xb6, 0x13, 0x3d, 0xcc},
2510/*read b306*/
2511 {0x00, 0x03, 0x00, 0xaa},
2512 {0x00, 0x1a, 0x09, 0xaa},
2513 {0x00, 0x1b, 0x8a, 0xaa},
2514/*read b827*/
2515 {0xb8, 0x27, 0x00, 0xcc},
2516 {0xb8, 0x26, 0x60, 0xcc},
2517 {0xb8, 0x26, 0x60, 0xcc},
2518/*gamma - to do?*/
2519 {0x00, 0x03, 0x00, 0xaa},
2520 {0x00, 0xae, 0x84, 0xaa},
2521/*gamma again*/
2522 {0x00, 0x03, 0x00, 0xaa},
2523 {0x00, 0x96, 0xa0, 0xaa},
2524/*matrix*/
2525 {0x00, 0x03, 0x00, 0xaa},
2526 {0x00, 0x91, 0x35, 0xaa},
2527 {0x00, 0x92, 0x22, 0xaa},
2528/*gamma*/
2529 {0x00, 0x03, 0x00, 0xaa},
2530 {0x00, 0x95, 0x85, 0xaa},
2531/*matrix*/
2532 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002533 {0x00, 0x4d, 0x20, 0xaa},
2534 {0xb8, 0x22, 0x40, 0xcc},
2535 {0xb8, 0x23, 0x40, 0xcc},
2536 {0xb8, 0x24, 0x40, 0xcc},
2537 {0xb8, 0x81, 0x09, 0xcc},
2538 {0x00, 0x00, 0x64, 0xdd},
2539 {0x00, 0x03, 0x01, 0xaa},
2540/*read 46*/
2541 {0x00, 0x46, 0x3c, 0xaa},
2542 {0x00, 0x03, 0x00, 0xaa},
2543 {0x00, 0x16, 0x40, 0xaa},
2544 {0x00, 0x17, 0x40, 0xaa},
2545 {0x00, 0x18, 0x40, 0xaa},
2546 {0x00, 0x19, 0x41, 0xaa},
2547 {0x00, 0x03, 0x01, 0xaa},
2548 {0x00, 0x46, 0x3c, 0xaa},
2549 {0x00, 0x00, 0x18, 0xdd},
2550/*read bfff*/
2551 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002552 {0x00, 0xb4, 0x1c, 0xaa},
2553 {0x00, 0xb5, 0x92, 0xaa},
2554 {0x00, 0xb6, 0x39, 0xaa},
2555 {0x00, 0xb7, 0x24, 0xaa},
2556/*write 89 0400 1415*/
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002557 {}
2558};
2559
2560static const u8 poxxxx_init_common[][4] = {
2561 {0xb3, 0x00, 0x04, 0xcc},
2562 {0x00, 0x00, 0x10, 0xdd},
2563 {0xb3, 0x00, 0x64, 0xcc},
2564 {0x00, 0x00, 0x10, 0xdd},
2565 {0xb3, 0x00, 0x65, 0xcc},
2566 {0x00, 0x00, 0x10, 0xdd},
2567 {0xb3, 0x00, 0x67, 0xcc},
2568 {0xb0, 0x03, 0x09, 0xcc},
2569 {0xb3, 0x05, 0x00, 0xcc},
2570 {0xb3, 0x06, 0x00, 0xcc},
2571 {0xb3, 0x5c, 0x01, 0xcc},
2572 {0xb3, 0x08, 0x01, 0xcc},
2573 {0xb3, 0x09, 0x0c, 0xcc},
2574 {0xb3, 0x34, 0x01, 0xcc},
2575 {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
2576 {0xb3, 0x02, 0xb0, 0xcc},
2577 {0xb3, 0x03, 0x18, 0xcc},
2578 {0xb3, 0x04, 0x15, 0xcc},
2579 {0xb3, 0x20, 0x00, 0xcc},
2580 {0xb3, 0x21, 0x00, 0xcc},
Jean-François Moine98475cb2010-07-06 04:44:54 -03002581 {0xb3, 0x22, 0x04, 0xcc}, /* sensor height = 1024 */
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002582 {0xb3, 0x23, 0x00, 0xcc},
2583 {0xb3, 0x14, 0x00, 0xcc},
2584 {0xb3, 0x15, 0x00, 0xcc},
Jean-François Moine98475cb2010-07-06 04:44:54 -03002585 {0xb3, 0x16, 0x04, 0xcc}, /* sensor width = 1280 */
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002586 {0xb3, 0x17, 0xff, 0xcc},
2587 {0xb3, 0x2c, 0x03, 0xcc},
2588 {0xb3, 0x2d, 0x56, 0xcc},
2589 {0xb3, 0x2e, 0x02, 0xcc},
2590 {0xb3, 0x2f, 0x0a, 0xcc},
2591 {0xb3, 0x40, 0x00, 0xcc},
2592 {0xb3, 0x41, 0x34, 0xcc},
2593 {0xb3, 0x42, 0x01, 0xcc},
2594 {0xb3, 0x43, 0xe0, 0xcc},
2595 {0xbc, 0x00, 0x71, 0xcc},
2596 {0xbc, 0x01, 0x01, 0xcc},
2597 {0xb3, 0x01, 0x41, 0xcc},
2598 {0xb3, 0x4d, 0x00, 0xcc},
2599 {0x00, 0x0b, 0x2a, 0xaa},
2600 {0x00, 0x0e, 0x03, 0xaa},
2601 {0x00, 0x0f, 0xea, 0xaa},
2602 {0x00, 0x12, 0x08, 0xaa},
2603 {0x00, 0x1e, 0x06, 0xaa},
2604 {0x00, 0x21, 0x00, 0xaa},
2605 {0x00, 0x31, 0x1f, 0xaa},
2606 {0x00, 0x33, 0x38, 0xaa},
2607 {0x00, 0x36, 0xc0, 0xaa},
2608 {0x00, 0x37, 0xc8, 0xaa},
2609 {0x00, 0x3b, 0x36, 0xaa},
2610 {0x00, 0x4b, 0xfe, 0xaa},
2611 {0x00, 0x4d, 0x2e, 0xaa},
2612 {0x00, 0x51, 0x1c, 0xaa},
2613 {0x00, 0x52, 0x01, 0xaa},
2614 {0x00, 0x55, 0x0a, 0xaa},
2615 {0x00, 0x56, 0x0a, 0xaa},
2616 {0x00, 0x57, 0x07, 0xaa},
2617 {0x00, 0x58, 0x07, 0xaa},
2618 {0x00, 0x59, 0x04, 0xaa},
2619 {0x00, 0x70, 0x68, 0xaa},
2620 {0x00, 0x71, 0x04, 0xaa},
2621 {0x00, 0x72, 0x10, 0xaa},
2622 {0x00, 0x80, 0x71, 0xaa},
2623 {0x00, 0x81, 0x08, 0xaa},
2624 {0x00, 0x82, 0x00, 0xaa},
2625 {0x00, 0x83, 0x55, 0xaa},
2626 {0x00, 0x84, 0x06, 0xaa},
2627 {0x00, 0x85, 0x06, 0xaa},
2628 {0x00, 0x8b, 0x25, 0xaa},
2629 {0x00, 0x8c, 0x00, 0xaa},
2630 {0x00, 0x8d, 0x86, 0xaa},
2631 {0x00, 0x8e, 0x82, 0xaa},
2632 {0x00, 0x8f, 0x2d, 0xaa},
2633 {0x00, 0x90, 0x8b, 0xaa},
2634 {0x00, 0x91, 0x81, 0xaa},
2635 {0x00, 0x92, 0x81, 0xaa},
2636 {0x00, 0x93, 0x23, 0xaa},
2637 {0x00, 0xa3, 0x2a, 0xaa},
2638 {0x00, 0xa4, 0x03, 0xaa},
2639 {0x00, 0xa5, 0xea, 0xaa},
2640 {0x00, 0xb0, 0x68, 0xaa},
2641 {0x00, 0xbc, 0x04, 0xaa},
2642 {0x00, 0xbe, 0x3b, 0xaa},
2643 {0x00, 0x4e, 0x40, 0xaa},
2644 {0x00, 0x06, 0x04, 0xaa},
2645 {0x00, 0x07, 0x03, 0xaa},
2646 {0x00, 0xcd, 0x18, 0xaa},
2647 {0x00, 0x28, 0x03, 0xaa},
2648 {0x00, 0x29, 0xef, 0xaa},
2649/* reinit on alt 2 (qvga) or alt7 (vga) */
2650 {0xb3, 0x05, 0x00, 0xcc},
2651 {0xb3, 0x06, 0x00, 0xcc},
2652 {0xb8, 0x00, 0x01, 0xcc},
2653
2654 {0x00, 0x1d, 0x85, 0xaa},
2655 {0x00, 0x1e, 0xc6, 0xaa},
2656 {0x00, 0x00, 0x40, 0xdd},
2657 {0x00, 0x1d, 0x05, 0xaa},
Jean-François Moine486cb2d2010-07-26 07:53:57 -03002658 {}
2659};
2660static const u8 poxxxx_gamma[][4] = {
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002661 {0x00, 0xd6, 0x22, 0xaa}, /* gamma 0 */
2662 {0x00, 0x73, 0x00, 0xaa},
2663 {0x00, 0x74, 0x0a, 0xaa},
2664 {0x00, 0x75, 0x16, 0xaa},
2665 {0x00, 0x76, 0x25, 0xaa},
2666 {0x00, 0x77, 0x34, 0xaa},
2667 {0x00, 0x78, 0x49, 0xaa},
2668 {0x00, 0x79, 0x5a, 0xaa},
2669 {0x00, 0x7a, 0x7f, 0xaa},
2670 {0x00, 0x7b, 0x9b, 0xaa},
2671 {0x00, 0x7c, 0xba, 0xaa},
2672 {0x00, 0x7d, 0xd4, 0xaa},
2673 {0x00, 0x7e, 0xea, 0xaa},
2674
2675 {0x00, 0xd6, 0x62, 0xaa}, /* gamma 1 */
2676 {0x00, 0x73, 0x00, 0xaa},
2677 {0x00, 0x74, 0x0a, 0xaa},
2678 {0x00, 0x75, 0x16, 0xaa},
2679 {0x00, 0x76, 0x25, 0xaa},
2680 {0x00, 0x77, 0x34, 0xaa},
2681 {0x00, 0x78, 0x49, 0xaa},
2682 {0x00, 0x79, 0x5a, 0xaa},
2683 {0x00, 0x7a, 0x7f, 0xaa},
2684 {0x00, 0x7b, 0x9b, 0xaa},
2685 {0x00, 0x7c, 0xba, 0xaa},
2686 {0x00, 0x7d, 0xd4, 0xaa},
2687 {0x00, 0x7e, 0xea, 0xaa},
2688
2689 {0x00, 0xd6, 0xa2, 0xaa}, /* gamma 2 */
2690 {0x00, 0x73, 0x00, 0xaa},
2691 {0x00, 0x74, 0x0a, 0xaa},
2692 {0x00, 0x75, 0x16, 0xaa},
2693 {0x00, 0x76, 0x25, 0xaa},
2694 {0x00, 0x77, 0x34, 0xaa},
2695 {0x00, 0x78, 0x49, 0xaa},
2696 {0x00, 0x79, 0x5a, 0xaa},
2697 {0x00, 0x7a, 0x7f, 0xaa},
2698 {0x00, 0x7b, 0x9b, 0xaa},
2699 {0x00, 0x7c, 0xba, 0xaa},
2700 {0x00, 0x7d, 0xd4, 0xaa},
2701 {0x00, 0x7e, 0xea, 0xaa},
Jean-François Moine486cb2d2010-07-26 07:53:57 -03002702 {}
2703};
2704static const u8 poxxxx_init_start_3[][4] = {
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002705 {0x00, 0xb8, 0x28, 0xaa},
2706 {0x00, 0xb9, 0x1e, 0xaa},
2707 {0x00, 0xb6, 0x14, 0xaa},
2708 {0x00, 0xb7, 0x0f, 0xaa},
2709 {0x00, 0x5c, 0x10, 0xaa},
2710 {0x00, 0x5d, 0x18, 0xaa},
2711 {0x00, 0x5e, 0x24, 0xaa},
2712 {0x00, 0x5f, 0x24, 0xaa},
2713 {0x00, 0x86, 0x1a, 0xaa},
2714 {0x00, 0x60, 0x00, 0xaa},
2715 {0x00, 0x61, 0x1b, 0xaa},
2716 {0x00, 0x62, 0x30, 0xaa},
2717 {0x00, 0x63, 0x40, 0xaa},
2718 {0x00, 0x87, 0x1a, 0xaa},
2719 {0x00, 0x64, 0x00, 0xaa},
2720 {0x00, 0x65, 0x08, 0xaa},
2721 {0x00, 0x66, 0x10, 0xaa},
2722 {0x00, 0x67, 0x20, 0xaa},
2723 {0x00, 0x88, 0x10, 0xaa},
2724 {0x00, 0x68, 0x00, 0xaa},
2725 {0x00, 0x69, 0x08, 0xaa},
2726 {0x00, 0x6a, 0x0f, 0xaa},
2727 {0x00, 0x6b, 0x0f, 0xaa},
2728 {0x00, 0x89, 0x07, 0xaa},
2729 {0x00, 0xd5, 0x4c, 0xaa},
2730 {0x00, 0x0a, 0x00, 0xaa},
2731 {0x00, 0x0b, 0x2a, 0xaa},
2732 {0x00, 0x0e, 0x03, 0xaa},
2733 {0x00, 0x0f, 0xea, 0xaa},
2734 {0x00, 0xa2, 0x00, 0xaa},
2735 {0x00, 0xa3, 0x2a, 0xaa},
2736 {0x00, 0xa4, 0x03, 0xaa},
2737 {0x00, 0xa5, 0xea, 0xaa},
2738 {}
2739};
2740static const u8 poxxxx_initVGA[][4] = {
2741 {0x00, 0x20, 0x11, 0xaa},
2742 {0x00, 0x33, 0x38, 0xaa},
2743 {0x00, 0xbb, 0x0d, 0xaa},
Jean-François Moine98475cb2010-07-06 04:44:54 -03002744 {0xb3, 0x22, 0x01, 0xcc}, /* change to 640x480 */
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002745 {0xb3, 0x23, 0xe0, 0xcc},
2746 {0xb3, 0x16, 0x02, 0xcc},
2747 {0xb3, 0x17, 0x7f, 0xcc},
2748 {0xb3, 0x02, 0xb0, 0xcc},
2749 {0xb3, 0x06, 0x00, 0xcc},
2750 {0xb3, 0x5c, 0x01, 0xcc},
2751 {0x00, 0x04, 0x06, 0xaa},
2752 {0x00, 0x05, 0x3f, 0xaa},
2753 {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
2754 {}
2755};
2756static const u8 poxxxx_initQVGA[][4] = {
2757 {0x00, 0x20, 0x33, 0xaa},
2758 {0x00, 0x33, 0x38, 0xaa},
2759 {0x00, 0xbb, 0x0d, 0xaa},
Jean-François Moine98475cb2010-07-06 04:44:54 -03002760 {0xb3, 0x22, 0x00, 0xcc}, /* change to 320x240 */
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002761 {0xb3, 0x23, 0xf0, 0xcc},
2762 {0xb3, 0x16, 0x01, 0xcc},
2763 {0xb3, 0x17, 0x3f, 0xcc},
2764 {0xb3, 0x02, 0xb0, 0xcc},
2765 {0xb3, 0x06, 0x01, 0xcc},
2766 {0xb3, 0x5c, 0x00, 0xcc},
2767 {0x00, 0x04, 0x06, 0xaa},
2768 {0x00, 0x05, 0x3f, 0xaa},
2769 {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
2770 {}
2771};
2772static const u8 poxxxx_init_end_1[][4] = {
2773 {0x00, 0x47, 0x25, 0xaa},
2774 {0x00, 0x48, 0x80, 0xaa},
2775 {0x00, 0x49, 0x1f, 0xaa},
2776 {0x00, 0x4a, 0x40, 0xaa},
2777 {0x00, 0x44, 0x40, 0xaa},
2778 {0x00, 0xab, 0x4a, 0xaa},
2779 {0x00, 0xb1, 0x00, 0xaa},
2780 {0x00, 0xb2, 0x04, 0xaa},
2781 {0x00, 0xb3, 0x08, 0xaa},
2782 {0x00, 0xb4, 0x0b, 0xaa},
2783 {0x00, 0xb5, 0x0d, 0xaa},
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03002784 {}
2785};
2786static const u8 poxxxx_init_end_2[][4] = {
2787 {0x00, 0x1d, 0x85, 0xaa},
2788 {0x00, 0x1e, 0x06, 0xaa},
2789 {0x00, 0x1d, 0x05, 0xaa},
2790 {}
Jean-Francois Moine88521532008-12-10 05:06:13 -03002791};
2792
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002793struct sensor_info {
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002794 s8 sensorId;
2795 u8 I2cAdd;
2796 u8 IdAdd;
2797 u16 VpId;
2798 u8 m1;
2799 u8 m2;
2800 u8 op;
2801};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002802
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002803/* probe values */
2804static const struct sensor_info vc0321_probe_data[] = {
2805/* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
2806/* 0 OV9640 */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002807 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002808/* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002809 {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002810/* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2811 {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2812/* 3 MI1310 */
2813 {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2814/* 4 MI360 - tested in vc032x_probe_sensor */
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002815/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002816/* 5 7131R */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002817 {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002818/* 6 OV7649 */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002819 {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002820/* 7 PAS302BCW */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002821 {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002822/* 8 OV7660 */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002823 {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002824/* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2825/* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2826/* 10 PO1030KC */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002827 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002828/* 11 MI1310_SOC */
2829 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2830/* 12 OV9650 */
2831 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2832/* 13 S5K532 */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002833 {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002834/* 14 MI360_SOC - ??? */
2835/* 15 PO1200N */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002836 {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002837/* 16 PO3030K */
2838 {-1, 0x80 | 0x18, 0x00, 0x0000, 0x24, 0x25, 0x01},
2839/* 17 PO2030 */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002840 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002841/* ?? */
2842 {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
2843 {SENSOR_MI1320, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x65, 0x01},
2844};
2845static const struct sensor_info vc0323_probe_data[] = {
2846/* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
2847/* 0 OV9640 */
2848 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2849/* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
2850 {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2851/* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2852 {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2853/* 3 MI1310 */
2854 {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2855/* 4 MI360 - tested in vc032x_probe_sensor */
2856/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
2857/* 5 7131R */
2858 {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2859/* 6 OV7649 */
2860 {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2861/* 7 PAS302BCW */
2862 {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2863/* 8 OV7660 */
2864 {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2865/* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2866/* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2867/* 10 PO1030KC */
2868 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2869/* 11 MI1310_SOC */
2870 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2871/* 12 OV9650 */
2872 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2873/* 13 S5K532 */
2874 {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
2875/* 14 MI360_SOC - ??? */
2876/* 15 PO1200N */
2877 {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
2878/* 16 ?? */
2879 {-1, 0x80 | 0x2d, 0x00, 0x0000, 0x65, 0x67, 0x01},
2880/* 17 PO2030 */
2881 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2882/* ?? */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002883 {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03002884 {SENSOR_MI1320_SOC, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x67, 0x01},
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002885/*fixme: not in the ms-win probe - may be found before? */
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002886 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002887};
2888
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002889/* read 'len' bytes in gspca_dev->usb_buf */
Jean-François Moineef35d342010-07-06 05:05:05 -03002890static void reg_r_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002891 u16 req,
2892 u16 index,
2893 u16 len)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002894{
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002895 int ret;
2896
2897 if (gspca_dev->usb_err < 0)
2898 return;
2899 ret = usb_control_msg(gspca_dev->dev,
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002900 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002901 req,
2902 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2903 1, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002904 index, gspca_dev->usb_buf, len,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002905 500);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002906 if (ret < 0) {
Joe Perches133a9fe2011-08-21 19:56:57 -03002907 pr_err("reg_r err %d\n", ret);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002908 gspca_dev->usb_err = ret;
2909 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002910}
Jean-François Moineef35d342010-07-06 05:05:05 -03002911static void reg_r(struct gspca_dev *gspca_dev,
2912 u16 req,
2913 u16 index,
2914 u16 len)
2915{
2916 reg_r_i(gspca_dev, req, index, len);
Jean-François Moineef35d342010-07-06 05:05:05 -03002917 if (gspca_dev->usb_err < 0)
2918 return;
2919 if (len == 1)
Joe Perches37d5efb2017-09-22 15:20:33 -04002920 gspca_dbg(gspca_dev, D_USBI, "GET %02x 0001 %04x %02x\n",
2921 req, index,
2922 gspca_dev->usb_buf[0]);
Jean-François Moineef35d342010-07-06 05:05:05 -03002923 else
Joe Perches37d5efb2017-09-22 15:20:33 -04002924 gspca_dbg(gspca_dev, D_USBI, "GET %02x 0001 %04x %*ph\n",
2925 req, index, 3, gspca_dev->usb_buf);
Jean-François Moineef35d342010-07-06 05:05:05 -03002926}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002927
Jean-François Moineef35d342010-07-06 05:05:05 -03002928static void reg_w_i(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03002929 u16 req,
2930 u16 value,
2931 u16 index)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002932{
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002933 int ret;
2934
2935 if (gspca_dev->usb_err < 0)
2936 return;
2937 ret = usb_control_msg(gspca_dev->dev,
2938 usb_sndctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002939 req,
2940 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2941 value, index, NULL, 0,
2942 500);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002943 if (ret < 0) {
Joe Perches133a9fe2011-08-21 19:56:57 -03002944 pr_err("reg_w err %d\n", ret);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002945 gspca_dev->usb_err = ret;
2946 }
2947}
2948static void reg_w(struct gspca_dev *gspca_dev,
2949 u16 req,
2950 u16 value,
2951 u16 index)
2952{
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002953 if (gspca_dev->usb_err < 0)
2954 return;
Joe Perches37d5efb2017-09-22 15:20:33 -04002955 gspca_dbg(gspca_dev, D_USBO, "SET %02x %04x %04x\n", req, value, index);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002956 reg_w_i(gspca_dev, req, value, index);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002957}
2958
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002959static u16 read_sensor_register(struct gspca_dev *gspca_dev,
2960 u16 address)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002961{
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002962 u8 ldata, mdata, hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002963 int retry = 50;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002964
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002965 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002966 if (!(gspca_dev->usb_buf[0] & 0x02)) {
Joe Perches133a9fe2011-08-21 19:56:57 -03002967 pr_err("I2c Bus Busy Wait %02x\n", gspca_dev->usb_buf[0]);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002968 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002969 }
Jean-François Moinefe854ec2010-07-06 05:00:07 -03002970 reg_w(gspca_dev, 0xa0, address, 0xb33a);
2971 reg_w(gspca_dev, 0xa0, 0x02, 0xb339);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002972
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002973 do {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002974 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002975 if (gspca_dev->usb_buf[0] == 0x00)
2976 break;
2977 msleep(40);
2978 } while (--retry >= 0);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002979
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002980 reg_r(gspca_dev, 0xa1, 0xb33e, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002981 ldata = gspca_dev->usb_buf[0];
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002982 reg_r(gspca_dev, 0xa1, 0xb33d, 1);
2983 mdata = gspca_dev->usb_buf[0];
2984 reg_r(gspca_dev, 0xa1, 0xb33c, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03002985 hdata = gspca_dev->usb_buf[0];
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002986 if (hdata != 0 && mdata != 0 && ldata != 0)
Joe Perches37d5efb2017-09-22 15:20:33 -04002987 gspca_dbg(gspca_dev, D_PROBE, "Read Sensor %02x%02x %02x\n",
2988 hdata, mdata, ldata);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002989 reg_r(gspca_dev, 0xa1, 0xb334, 1);
2990 if (gspca_dev->usb_buf[0] == 0x02)
Jean-Francois Moine49796e42009-02-02 06:33:31 -03002991 return (hdata << 8) + mdata;
2992 return hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002993}
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002994
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002995static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
2996{
Jean-Francois Moine1852e752009-06-27 05:33:48 -03002997 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03002998 int i, n;
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03002999 u16 value;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003000 const struct sensor_info *ptsensor_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003001
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003002/*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003003 if (sd->flags & FL_SAMSUNG) {
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003004 reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
3005 reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
3006 /* select the back sensor */
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003007 }
3008
Jean-Francois Moine739570b2008-07-14 09:38:29 -03003009 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
Joe Perches37d5efb2017-09-22 15:20:33 -04003010 gspca_dbg(gspca_dev, D_PROBE, "vc032%d check sensor header %02x\n",
3011 sd->bridge == BRIDGE_VC0321 ? 1 : 3, gspca_dev->usb_buf[0]);
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03003012 if (sd->bridge == BRIDGE_VC0321) {
3013 ptsensor_info = vc0321_probe_data;
3014 n = ARRAY_SIZE(vc0321_probe_data);
3015 } else {
3016 ptsensor_info = vc0323_probe_data;
3017 n = ARRAY_SIZE(vc0323_probe_data);
3018 }
3019 for (i = 0; i < n; i++) {
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003020 reg_w(gspca_dev, 0xa0, 0x02, 0xb334);
3021 reg_w(gspca_dev, 0xa0, ptsensor_info->m1, 0xb300);
3022 reg_w(gspca_dev, 0xa0, ptsensor_info->m2, 0xb300);
3023 reg_w(gspca_dev, 0xa0, 0x01, 0xb308);
3024 reg_w(gspca_dev, 0xa0, 0x0c, 0xb309);
3025 reg_w(gspca_dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
3026 reg_w(gspca_dev, 0xa0, ptsensor_info->op, 0xb301);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003027 value = read_sensor_register(gspca_dev, ptsensor_info->IdAdd);
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03003028 if (value == 0 && ptsensor_info->IdAdd == 0x82)
3029 value = read_sensor_register(gspca_dev, 0x83);
3030 if (value != 0) {
Joe Perches37d5efb2017-09-22 15:20:33 -04003031 gspca_dbg(gspca_dev, D_PROBE, "Sensor ID %04x (%d)\n",
3032 value, i);
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03003033 if (value == ptsensor_info->VpId)
3034 return ptsensor_info->sensorId;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003035
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03003036 switch (value) {
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03003037 case 0x3130:
3038 return SENSOR_PO3130NC;
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03003039 case 0x7673:
3040 return SENSOR_OV7670;
3041 case 0x8243:
3042 return SENSOR_MI0360;
3043 }
Jean-Francois Moine235d0ff2009-03-22 16:33:47 -03003044 }
Jean-Francois Moineff1cf402009-12-26 15:18:02 -03003045 ptsensor_info++;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003046 }
3047 return -1;
3048}
3049
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003050static void i2c_write(struct gspca_dev *gspca_dev,
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03003051 u8 reg, const u8 *val,
3052 u8 size) /* 1 or 2 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003053{
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003054 int retry;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003055
Jean-François Moineef35d342010-07-06 05:05:05 -03003056 if (gspca_dev->usb_err < 0)
3057 return;
3058 if (size == 1)
Joe Perches37d5efb2017-09-22 15:20:33 -04003059 gspca_dbg(gspca_dev, D_USBO, "i2c_w %02x %02x\n", reg, *val);
Jean-François Moineef35d342010-07-06 05:05:05 -03003060 else
Joe Perches37d5efb2017-09-22 15:20:33 -04003061 gspca_dbg(gspca_dev, D_USBO, "i2c_w %02x %02x%02x\n",
3062 reg, *val, val[1]);
Jean-François Moineef35d342010-07-06 05:05:05 -03003063 reg_r_i(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03003064/*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/
Jean-François Moineef35d342010-07-06 05:05:05 -03003065 reg_w_i(gspca_dev, 0xa0, size, 0xb334);
3066 reg_w_i(gspca_dev, 0xa0, reg, 0xb33a);
3067 reg_w_i(gspca_dev, 0xa0, val[0], 0xb336);
Jean-Francois Moine33f5b072009-03-25 07:04:11 -03003068 if (size > 1)
Jean-François Moineef35d342010-07-06 05:05:05 -03003069 reg_w_i(gspca_dev, 0xa0, val[1], 0xb337);
3070 reg_w_i(gspca_dev, 0xa0, 0x01, 0xb339);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003071 retry = 4;
3072 do {
Jean-François Moineef35d342010-07-06 05:05:05 -03003073 reg_r_i(gspca_dev, 0xa1, 0xb33b, 1);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003074 if (gspca_dev->usb_buf[0] == 0)
3075 break;
3076 msleep(20);
3077 } while (--retry > 0);
3078 if (retry <= 0)
Joe Perches133a9fe2011-08-21 19:56:57 -03003079 pr_err("i2c_write timeout\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003080}
3081
3082static void put_tab_to_reg(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003083 const u8 *tab, u8 tabsize, u16 addr)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003084{
3085 int j;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003086 u16 ad = addr;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003087
3088 for (j = 0; j < tabsize; j++)
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003089 reg_w(gspca_dev, 0xa0, tab[j], ad++);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003090}
3091
3092static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003093 const u8 data[][4])
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003094{
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003095 int i = 0;
3096
3097 for (;;) {
3098 switch (data[i][3]) {
3099 default:
3100 return;
3101 case 0xcc: /* normal write */
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003102 reg_w(gspca_dev, 0xa0, data[i][2],
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003103 (data[i][0]) << 8 | data[i][1]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003104 break;
3105 case 0xaa: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03003106 i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003107 break;
3108 case 0xbb: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03003109 i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003110 break;
3111 case 0xdd:
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003112 msleep(data[i][1] * 256 + data[i][2] + 10);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003113 break;
3114 }
3115 i++;
3116 }
3117 /*not reached*/
3118}
3119
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003120
3121/* this function is called at probe time */
3122static int sd_config(struct gspca_dev *gspca_dev,
3123 const struct usb_device_id *id)
3124{
3125 struct sd *sd = (struct sd *) gspca_dev;
Jean-François Moinebb44f562010-07-26 07:59:23 -03003126
3127 sd->bridge = id->driver_info >> 8;
3128 sd->flags = id->driver_info & 0xff;
3129
3130 if (id->idVendor == 0x046d &&
3131 (id->idProduct == 0x0892 || id->idProduct == 0x0896))
3132 sd->sensor = SENSOR_POxxxx; /* no probe */
3133
Jean-François Moinebb44f562010-07-26 07:59:23 -03003134 return 0;
3135}
3136
3137/* this function is called at probe and resume time */
3138static int sd_init(struct gspca_dev *gspca_dev)
3139{
3140 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003141 struct cam *cam;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003142 int sensor;
Jean-François Moine7e5f9052010-12-28 07:24:18 -03003143 /* number of packets per ISOC message */
3144 static u8 npkt[NSENSORS] = {
3145 [SENSOR_HV7131R] = 64,
3146 [SENSOR_MI0360] = 32,
3147 [SENSOR_MI1310_SOC] = 32,
3148 [SENSOR_MI1320] = 64,
3149 [SENSOR_MI1320_SOC] = 128,
3150 [SENSOR_OV7660] = 32,
3151 [SENSOR_OV7670] = 64,
3152 [SENSOR_PO1200] = 128,
3153 [SENSOR_PO3130NC] = 128,
3154 [SENSOR_POxxxx] = 128,
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -03003155 };
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003156
Jean-François Moinebb44f562010-07-26 07:59:23 -03003157 if (sd->sensor != SENSOR_POxxxx)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003158 sensor = vc032x_probe_sensor(gspca_dev);
Jean-François Moinebb44f562010-07-26 07:59:23 -03003159 else
3160 sensor = sd->sensor;
3161
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003162 switch (sensor) {
3163 case -1:
Joe Perches133a9fe2011-08-21 19:56:57 -03003164 pr_err("Unknown sensor...\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003165 return -EINVAL;
3166 case SENSOR_HV7131R:
Joe Perches37d5efb2017-09-22 15:20:33 -04003167 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HV7131R\n");
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003168 break;
3169 case SENSOR_MI0360:
Joe Perches37d5efb2017-09-22 15:20:33 -04003170 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI0360\n");
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003171 sd->bridge = BRIDGE_VC0323;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003172 break;
3173 case SENSOR_MI1310_SOC:
Joe Perches37d5efb2017-09-22 15:20:33 -04003174 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1310_SOC\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003175 break;
3176 case SENSOR_MI1320:
Joe Perches37d5efb2017-09-22 15:20:33 -04003177 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1320\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003178 break;
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03003179 case SENSOR_MI1320_SOC:
Joe Perches37d5efb2017-09-22 15:20:33 -04003180 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1320_SOC\n");
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03003181 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003182 case SENSOR_OV7660:
Joe Perches37d5efb2017-09-22 15:20:33 -04003183 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7660\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003184 break;
3185 case SENSOR_OV7670:
Joe Perches37d5efb2017-09-22 15:20:33 -04003186 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7670\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003187 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03003188 case SENSOR_PO1200:
Joe Perches37d5efb2017-09-22 15:20:33 -04003189 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PO1200\n");
Jean-Francois Moine88521532008-12-10 05:06:13 -03003190 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003191 case SENSOR_PO3130NC:
Joe Perches37d5efb2017-09-22 15:20:33 -04003192 gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PO3130NC\n");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003193 break;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003194 case SENSOR_POxxxx:
Joe Perches37d5efb2017-09-22 15:20:33 -04003195 gspca_dbg(gspca_dev, D_PROBE, "Sensor POxxxx\n");
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003196 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003197 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003198 sd->sensor = sensor;
3199
Jean-François Moinebb44f562010-07-26 07:59:23 -03003200 cam = &gspca_dev->cam;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003201 if (sd->bridge == BRIDGE_VC0321) {
3202 cam->cam_mode = vc0321_mode;
3203 cam->nmodes = ARRAY_SIZE(vc0321_mode);
3204 } else {
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003205 switch (sensor) {
3206 case SENSOR_PO1200:
Jean-Francois Moine88521532008-12-10 05:06:13 -03003207 cam->cam_mode = svga_mode;
3208 cam->nmodes = ARRAY_SIZE(svga_mode);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003209 break;
3210 case SENSOR_MI1310_SOC:
3211 cam->cam_mode = vc0323_mode;
Jean-Francois Moine111815e2009-07-27 05:52:27 -03003212 cam->nmodes = ARRAY_SIZE(vc0323_mode);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003213 break;
3214 case SENSOR_MI1320_SOC:
3215 cam->cam_mode = bi_mode;
3216 cam->nmodes = ARRAY_SIZE(bi_mode);
3217 break;
Jean-François Moine5624c642010-04-02 07:12:42 -03003218 case SENSOR_OV7670:
3219 cam->cam_mode = bi_mode;
3220 cam->nmodes = ARRAY_SIZE(bi_mode) - 1;
3221 break;
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003222 default:
3223 cam->cam_mode = vc0323_mode;
3224 cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
3225 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03003226 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003227 }
Jean-Francois Moine49cb6b02009-04-25 13:29:01 -03003228 cam->npkt = npkt[sd->sensor];
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003229
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003230 if (sd->sensor == SENSOR_OV7670)
3231 sd->flags |= FL_HFLIP | FL_VFLIP;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003232
Jean-François Moine76ed0fe2010-07-14 07:09:50 -03003233 if (sd->bridge == BRIDGE_VC0321) {
3234 reg_r(gspca_dev, 0x8a, 0, 3);
3235 reg_w(gspca_dev, 0x87, 0x00, 0x0f0f);
3236 reg_r(gspca_dev, 0x8b, 0, 3);
3237 reg_w(gspca_dev, 0x88, 0x00, 0x0202);
3238 if (sd->sensor == SENSOR_POxxxx) {
3239 reg_r(gspca_dev, 0xa1, 0xb300, 1);
3240 if (gspca_dev->usb_buf[0] != 0) {
3241 reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
3242 reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
Jean-François Moine76ed0fe2010-07-14 07:09:50 -03003243 }
Jean-François Moine3d217c82010-07-27 05:34:49 -03003244 reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003245 }
3246 }
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003247 return gspca_dev->usb_err;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003248}
3249
Hans Verkuil930806c2012-05-18 06:45:30 -03003250static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003251{
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003252 u8 data;
3253
Hans Verkuil930806c2012-05-18 06:45:30 -03003254 data = val;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003255 if (data >= 0x80)
3256 data &= 0x7f;
3257 else
3258 data = 0xff ^ data;
3259 i2c_write(gspca_dev, 0x98, &data, 1);
3260}
3261
Hans Verkuil930806c2012-05-18 06:45:30 -03003262static void setcontrast(struct gspca_dev *gspca_dev, u8 val)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003263{
Hans Verkuil930806c2012-05-18 06:45:30 -03003264 i2c_write(gspca_dev, 0x99, &val, 1);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003265}
3266
Hans Verkuil930806c2012-05-18 06:45:30 -03003267static void setcolors(struct gspca_dev *gspca_dev, u8 val)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003268{
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003269 u8 data;
3270
Hans Verkuil930806c2012-05-18 06:45:30 -03003271 data = val - (val >> 3) - 1;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003272 i2c_write(gspca_dev, 0x94, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003273 i2c_write(gspca_dev, 0x95, &val, 1);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003274}
3275
Hans Verkuil930806c2012-05-18 06:45:30 -03003276static void sethvflip(struct gspca_dev *gspca_dev, bool hflip, bool vflip)
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003277{
3278 struct sd *sd = (struct sd *) gspca_dev;
Hans Verkuil930806c2012-05-18 06:45:30 -03003279 u8 data[2];
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003280
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003281 if (sd->flags & FL_HFLIP)
Jean-Francois Moinebb2c8182009-08-02 06:56:47 -03003282 hflip = !hflip;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003283 if (sd->flags & FL_VFLIP)
Jean-Francois Moinebb2c8182009-08-02 06:56:47 -03003284 vflip = !vflip;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003285 switch (sd->sensor) {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003286 case SENSOR_MI1310_SOC:
Jean-Francois Moine219f30272009-12-26 15:21:57 -03003287 case SENSOR_MI1320:
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003288 case SENSOR_MI1320_SOC:
3289 data[0] = data[1] = 0; /* select page 0 */
3290 i2c_write(gspca_dev, 0xf0, data, 2);
3291 data[0] = sd->sensor == SENSOR_MI1310_SOC ? 0x03 : 0x01;
3292 data[1] = 0x02 * hflip
3293 | 0x01 * vflip;
3294 i2c_write(gspca_dev, 0x20, data, 2);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003295 break;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003296 case SENSOR_OV7660:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003297 case SENSOR_OV7670:
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003298 data[0] = sd->sensor == SENSOR_OV7660 ? 0x01 : 0x07;
3299 data[0] |= OV7660_MVFP_MIRROR * hflip
3300 | OV7660_MVFP_VFLIP * vflip;
3301 i2c_write(gspca_dev, OV7660_REG_MVFP, data, 1);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003302 break;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003303 case SENSOR_PO1200:
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003304 data[0] = 0;
3305 i2c_write(gspca_dev, 0x03, data, 1);
3306 data[0] = 0x80 * hflip
3307 | 0x40 * vflip
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003308 | 0x06;
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003309 i2c_write(gspca_dev, 0x1e, data, 1);
3310 break;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003311 }
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03003312}
3313
Hans Verkuil930806c2012-05-18 06:45:30 -03003314static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003315{
3316 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003317 static const u8 (*ov7660_freq_tb[3])[4] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003318 {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
3319
3320 if (sd->sensor != SENSOR_OV7660)
3321 return;
Hans Verkuil930806c2012-05-18 06:45:30 -03003322 usb_exchange(gspca_dev, ov7660_freq_tb[val]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003323}
3324
Hans Verkuil930806c2012-05-18 06:45:30 -03003325static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003326{
3327 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003328 u8 data;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003329
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003330 switch (sd->sensor) {
3331 case SENSOR_PO1200:
3332 data = 0;
3333 i2c_write(gspca_dev, 0x03, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003334 if (val < 0)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003335 data = 0x6a;
3336 else
Hans Verkuil930806c2012-05-18 06:45:30 -03003337 data = 0xb5 + val * 3;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003338 i2c_write(gspca_dev, 0x61, &data, 1);
3339 break;
3340 case SENSOR_POxxxx:
Hans Verkuil930806c2012-05-18 06:45:30 -03003341 if (val < 0)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003342 data = 0x7e; /* def = max */
3343 else
Hans Verkuil930806c2012-05-18 06:45:30 -03003344 data = 0x60 + val * 0x0f;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003345 i2c_write(gspca_dev, 0x59, &data, 1);
3346 break;
3347 }
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003348}
Hans Verkuil930806c2012-05-18 06:45:30 -03003349static void setgain(struct gspca_dev *gspca_dev, u8 val)
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003350{
Hans Verkuil930806c2012-05-18 06:45:30 -03003351 i2c_write(gspca_dev, 0x15, &val, 1);
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003352}
3353
Hans Verkuil930806c2012-05-18 06:45:30 -03003354static void setexposure(struct gspca_dev *gspca_dev, s32 val)
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003355{
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003356 u8 data;
3357
Hans Verkuil930806c2012-05-18 06:45:30 -03003358 data = val >> 8;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003359 i2c_write(gspca_dev, 0x1a, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003360 data = val;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003361 i2c_write(gspca_dev, 0x1b, &data, 1);
3362}
3363
Hans Verkuil930806c2012-05-18 06:45:30 -03003364static void setautogain(struct gspca_dev *gspca_dev, s32 val)
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003365{
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003366 static const u8 data[2] = {0x28, 0x3c};
3367
Hans Verkuil930806c2012-05-18 06:45:30 -03003368 i2c_write(gspca_dev, 0xd1, &data[val], 1);
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003369}
3370
3371static void setgamma(struct gspca_dev *gspca_dev)
3372{
3373/*fixme:to do */
3374 usb_exchange(gspca_dev, poxxxx_gamma);
3375}
3376
Hans Verkuil930806c2012-05-18 06:45:30 -03003377static void setbacklight(struct gspca_dev *gspca_dev, s32 val)
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003378{
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003379 u16 v;
3380 u8 data;
3381
Hans Verkuil930806c2012-05-18 06:45:30 -03003382 data = (val << 4) | 0x0f;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003383 i2c_write(gspca_dev, 0xaa, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003384 v = 613 + 12 * val;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003385 data = v >> 8;
3386 i2c_write(gspca_dev, 0xc4, &data, 1);
3387 data = v;
3388 i2c_write(gspca_dev, 0xc5, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003389 v = 1093 - 12 * val;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003390 data = v >> 8;
3391 i2c_write(gspca_dev, 0xc6, &data, 1);
3392 data = v;
3393 i2c_write(gspca_dev, 0xc7, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003394 v = 342 + 9 * val;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003395 data = v >> 8;
3396 i2c_write(gspca_dev, 0xc8, &data, 1);
3397 data = v;
3398 i2c_write(gspca_dev, 0xc9, &data, 1);
Hans Verkuil930806c2012-05-18 06:45:30 -03003399 v = 702 - 9 * val;
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003400 data = v >> 8;
3401 i2c_write(gspca_dev, 0xca, &data, 1);
3402 data = v;
3403 i2c_write(gspca_dev, 0xcb, &data, 1);
3404}
3405
3406static void setwb(struct gspca_dev *gspca_dev)
3407{
3408/*fixme:to do - valid when reg d1 = 0x1c - (reg16 + reg15 = 0xa3)*/
3409 static const u8 data[2] = {0x00, 0x00};
3410
3411 i2c_write(gspca_dev, 0x16, &data[0], 1);
3412 i2c_write(gspca_dev, 0x18, &data[1], 1);
3413}
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03003414
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03003415static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003416{
3417 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003418 const u8 (*init)[4];
3419 const u8 *GammaT = NULL;
3420 const u8 *MatrixT = NULL;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003421 int mode;
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003422 static const u8 (*mi1320_soc_init[])[4] = {
3423 mi1320_soc_InitSXGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003424 mi1320_soc_InitVGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003425 mi1320_soc_InitQVGA,
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003426 };
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003427
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003428/*fixme: back sensor only*/
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003429 if (sd->flags & FL_SAMSUNG) {
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003430 reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
3431 reg_w(gspca_dev, 0xa9, 0x8348, 0x000e);
3432 reg_w(gspca_dev, 0xa9, 0x0000, 0x001a);
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003433 }
3434
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003435 /* Assume start use the good resolution from gspca_dev->mode */
3436 if (sd->bridge == BRIDGE_VC0321) {
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003437 reg_w(gspca_dev, 0xa0, 0xff, 0xbfec);
3438 reg_w(gspca_dev, 0xa0, 0xff, 0xbfed);
3439 reg_w(gspca_dev, 0xa0, 0xff, 0xbfee);
3440 reg_w(gspca_dev, 0xa0, 0xff, 0xbfef);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003441 sd->image_offset = 46;
3442 } else {
3443 if (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].pixelformat
3444 == V4L2_PIX_FMT_JPEG)
3445 sd->image_offset = 0;
3446 else
3447 sd->image_offset = 32;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003448 }
3449
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03003450 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003451 switch (sd->sensor) {
3452 case SENSOR_HV7131R:
3453 GammaT = hv7131r_gamma;
3454 MatrixT = hv7131r_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003455 if (mode)
3456 init = hv7131r_initQVGA_data; /* 320x240 */
3457 else
3458 init = hv7131r_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003459 break;
3460 case SENSOR_OV7660:
3461 GammaT = ov7660_gamma;
3462 MatrixT = ov7660_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003463 if (mode)
3464 init = ov7660_initQVGA_data; /* 320x240 */
3465 else
3466 init = ov7660_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003467 break;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003468 case SENSOR_MI0360:
3469 GammaT = mi1320_gamma;
3470 MatrixT = mi0360_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003471 if (mode)
3472 init = mi0360_initQVGA_JPG; /* 320x240 */
3473 else
3474 init = mi0360_initVGA_JPG; /* 640x480 */
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03003475 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003476 case SENSOR_MI1310_SOC:
Jean-Francois Moinea92e9062009-01-29 05:32:23 -03003477 GammaT = mi1320_gamma;
Jean-Francois Moinef985c702009-02-28 08:23:25 -03003478 MatrixT = mi1320_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003479 switch (mode) {
3480 case 1:
3481 init = mi1310_socinitQVGA_JPG; /* 320x240 */
3482 break;
3483 case 0:
3484 init = mi1310_socinitVGA_JPG; /* 640x480 */
3485 break;
3486 default:
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03003487 init = mi1310_soc_InitSXGA_JPG; /* 1280x1024 */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003488 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003489 }
3490 break;
3491 case SENSOR_MI1320:
3492 GammaT = mi1320_gamma;
3493 MatrixT = mi1320_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003494 if (mode)
3495 init = mi1320_initQVGA_data; /* 320x240 */
3496 else
3497 init = mi1320_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003498 break;
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03003499 case SENSOR_MI1320_SOC:
3500 GammaT = mi1320_gamma;
3501 MatrixT = mi1320_matrix;
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003502 init = mi1320_soc_init[mode];
Jean-Francois Moinedb786a32009-03-23 06:03:52 -03003503 break;
Jean-François Moine5624c642010-04-02 07:12:42 -03003504 case SENSOR_OV7670:
3505 init = mode == 1 ? ov7670_InitVGA : ov7670_InitQVGA;
3506 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003507 case SENSOR_PO3130NC:
3508 GammaT = po3130_gamma;
3509 MatrixT = po3130_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003510 if (mode)
3511 init = po3130_initQVGA_data; /* 320x240 */
3512 else
3513 init = po3130_initVGA_data; /* 640x480 */
3514 usb_exchange(gspca_dev, init);
3515 init = po3130_rundata;
Jean-Francois Moine88521532008-12-10 05:06:13 -03003516 break;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003517 case SENSOR_PO1200:
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003518 GammaT = po1200_gamma;
3519 MatrixT = po1200_matrix;
3520 init = po1200_initVGA_data;
3521 break;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003522 default:
3523/* case SENSOR_POxxxx: */
3524 usb_exchange(gspca_dev, poxxxx_init_common);
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003525 setgamma(gspca_dev);
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003526 usb_exchange(gspca_dev, poxxxx_init_start_3);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003527 if (mode)
3528 init = poxxxx_initQVGA;
3529 else
3530 init = poxxxx_initVGA;
3531 usb_exchange(gspca_dev, init);
3532 reg_r(gspca_dev, 0x8c, 0x0000, 3);
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003533 reg_w(gspca_dev, 0xa0,
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003534 gspca_dev->usb_buf[2] & 1 ? 0 : 1,
3535 0xb35c);
3536 msleep(300);
3537/*fixme: i2c read 04 and 05*/
3538 init = poxxxx_init_end_1;
3539 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003540 }
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03003541 usb_exchange(gspca_dev, init);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003542 if (GammaT && MatrixT) {
3543 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
3544 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
3545 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
3546 put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
Jean-Francois Moine49796e42009-02-02 06:33:31 -03003547
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03003548 switch (sd->sensor) {
3549 case SENSOR_PO1200:
3550 case SENSOR_HV7131R:
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003551 reg_w(gspca_dev, 0x89, 0x0400, 0x1415);
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03003552 break;
3553 case SENSOR_MI1310_SOC:
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003554 reg_w(gspca_dev, 0x89, 0x058c, 0x0000);
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03003555 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03003556 }
Jean-Francois Moineae310ee2009-09-01 14:02:22 -03003557 msleep(100);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003558 }
Jean-François Moine5624c642010-04-02 07:12:42 -03003559 switch (sd->sensor) {
3560 case SENSOR_OV7670:
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003561 reg_w(gspca_dev, 0x87, 0xffff, 0xffff);
3562 reg_w(gspca_dev, 0x88, 0xff00, 0xf0f1);
3563 reg_w(gspca_dev, 0xa0, 0x0000, 0xbfff);
Jean-François Moine5624c642010-04-02 07:12:42 -03003564 break;
3565 case SENSOR_POxxxx:
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003566 usb_exchange(gspca_dev, poxxxx_init_end_2);
Jean-François Moine486cb2d2010-07-26 07:53:57 -03003567 setwb(gspca_dev);
3568 msleep(80); /* led on */
3569 reg_w(gspca_dev, 0x89, 0xffff, 0xfdff);
Jean-François Moine5624c642010-04-02 07:12:42 -03003570 break;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003571 }
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003572 return gspca_dev->usb_err;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003573}
3574
3575static void sd_stopN(struct gspca_dev *gspca_dev)
3576{
AceLan Kao4041f6b2009-07-27 05:43:55 -03003577 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003578
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003579 switch (sd->sensor) {
3580 case SENSOR_MI1310_SOC:
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003581 reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003582 break;
3583 case SENSOR_POxxxx:
3584 return;
3585 default:
3586 if (!(sd->flags & FL_SAMSUNG))
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003587 reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003588 break;
3589 }
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003590 reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
3591 reg_w(gspca_dev, 0xa0, 0x09, 0xb003);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003592}
3593
Jean-Francois Moine98522a72008-11-18 06:33:08 -03003594/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003595static void sd_stop0(struct gspca_dev *gspca_dev)
3596{
AceLan Kao4041f6b2009-07-27 05:43:55 -03003597 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003598
Jean-Francois Moine98522a72008-11-18 06:33:08 -03003599 if (!gspca_dev->present)
3600 return;
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003601/*fixme: is this useful?*/
3602 if (sd->sensor == SENSOR_MI1310_SOC)
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003603 reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
Jean-Francois Moineba624ce2009-09-03 13:46:59 -03003604 else if (!(sd->flags & FL_SAMSUNG))
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003605 reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003606
3607 if (sd->sensor == SENSOR_POxxxx) {
Jean-François Moinefe854ec2010-07-06 05:00:07 -03003608 reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
3609 reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
3610 reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003611 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003612}
3613
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003614static void sd_pkt_scan(struct gspca_dev *gspca_dev,
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003615 u8 *data, /* isoc packet */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003616 int len) /* iso pkt length */
3617{
3618 struct sd *sd = (struct sd *) gspca_dev;
3619
3620 if (data[0] == 0xff && data[1] == 0xd8) {
Joe Perches37d5efb2017-09-22 15:20:33 -04003621 gspca_dbg(gspca_dev, D_PACK,
3622 "vc032x header packet found len %d\n", len);
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003623 gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
Jean-Francois Moine58e2ded2009-03-25 07:06:29 -03003624 data += sd->image_offset;
3625 len -= sd->image_offset;
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003626 gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003627 return;
3628 }
Hans de Goeded473a002008-12-11 05:02:18 -03003629
3630 /* The vc0321 sends some additional data after sending the complete
3631 * frame, we ignore this. */
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003632 if (sd->bridge == BRIDGE_VC0321) {
Jean-François Moineb192ca92010-06-27 03:08:19 -03003633 int size, l;
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003634
Jean-François Moineb192ca92010-06-27 03:08:19 -03003635 l = gspca_dev->image_len;
Hans Verkuil1f5965c2018-05-12 10:44:00 -04003636 size = gspca_dev->pixfmt.sizeimage;
Jean-François Moineb192ca92010-06-27 03:08:19 -03003637 if (len > size - l)
3638 len = size - l;
Jean-Francois Moine76dd2722009-11-13 09:21:03 -03003639 }
3640 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003641}
3642
Hans Verkuil930806c2012-05-18 06:45:30 -03003643static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003644{
Hans Verkuil930806c2012-05-18 06:45:30 -03003645 struct gspca_dev *gspca_dev =
3646 container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
3647 struct sd *sd = (struct sd *)gspca_dev;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003648
Hans Verkuil930806c2012-05-18 06:45:30 -03003649 gspca_dev->usb_err = 0;
Jean-Francois Moine83c94a12009-12-26 16:07:24 -03003650
Hans Verkuil930806c2012-05-18 06:45:30 -03003651 if (!gspca_dev->streaming && ctrl->id != V4L2_CID_POWER_LINE_FREQUENCY)
Jean-Francois Moine8b605f12009-07-27 06:28:37 -03003652 return 0;
Hans Verkuil930806c2012-05-18 06:45:30 -03003653
3654 switch (ctrl->id) {
3655 case V4L2_CID_BRIGHTNESS:
3656 setbrightness(gspca_dev, ctrl->val);
3657 break;
3658 case V4L2_CID_CONTRAST:
3659 setcontrast(gspca_dev, ctrl->val);
3660 break;
3661 case V4L2_CID_SATURATION:
3662 setcolors(gspca_dev, ctrl->val);
3663 break;
3664 case V4L2_CID_HFLIP:
3665 sethvflip(gspca_dev, sd->hflip->val, sd->vflip->val);
3666 break;
3667 case V4L2_CID_SHARPNESS:
3668 setsharpness(gspca_dev, ctrl->val);
3669 break;
3670 case V4L2_CID_AUTOGAIN:
3671 setautogain(gspca_dev, ctrl->val);
3672 break;
3673 case V4L2_CID_GAIN:
3674 setgain(gspca_dev, ctrl->val);
3675 break;
3676 case V4L2_CID_EXPOSURE:
3677 setexposure(gspca_dev, ctrl->val);
3678 break;
3679 case V4L2_CID_BACKLIGHT_COMPENSATION:
3680 setbacklight(gspca_dev, ctrl->val);
3681 break;
3682 case V4L2_CID_POWER_LINE_FREQUENCY:
3683 setlightfreq(gspca_dev, ctrl->val);
3684 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003685 }
Hans Verkuil930806c2012-05-18 06:45:30 -03003686 return gspca_dev->usb_err;
3687}
3688
3689static const struct v4l2_ctrl_ops sd_ctrl_ops = {
3690 .s_ctrl = sd_s_ctrl,
3691};
3692
3693static int sd_init_controls(struct gspca_dev *gspca_dev)
3694{
3695 struct sd *sd = (struct sd *)gspca_dev;
3696 struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
3697 bool has_brightness = false;
3698 bool has_contrast = false;
3699 bool has_sat = false;
3700 bool has_hvflip = false;
3701 bool has_freq = false;
3702 bool has_backlight = false;
3703 bool has_exposure = false;
3704 bool has_autogain = false;
3705 bool has_gain = false;
3706 bool has_sharpness = false;
3707
3708 switch (sd->sensor) {
3709 case SENSOR_HV7131R:
3710 case SENSOR_MI0360:
3711 case SENSOR_PO3130NC:
3712 break;
3713 case SENSOR_MI1310_SOC:
3714 case SENSOR_MI1320:
3715 case SENSOR_MI1320_SOC:
3716 case SENSOR_OV7660:
3717 has_hvflip = true;
3718 break;
3719 case SENSOR_OV7670:
3720 has_hvflip = has_freq = true;
3721 break;
3722 case SENSOR_PO1200:
3723 has_hvflip = has_sharpness = true;
3724 break;
3725 case SENSOR_POxxxx:
3726 has_brightness = has_contrast = has_sat = has_backlight =
3727 has_exposure = has_autogain = has_gain =
3728 has_sharpness = true;
3729 break;
3730 }
3731
3732 gspca_dev->vdev.ctrl_handler = hdl;
3733 v4l2_ctrl_handler_init(hdl, 8);
3734 if (has_brightness)
3735 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3736 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
3737 if (has_contrast)
3738 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3739 V4L2_CID_CONTRAST, 0, 255, 1, 127);
3740 if (has_sat)
3741 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3742 V4L2_CID_SATURATION, 1, 127, 1, 63);
3743 if (has_hvflip) {
3744 sd->hflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3745 V4L2_CID_HFLIP, 0, 1, 1, 0);
3746 sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3747 V4L2_CID_VFLIP, 0, 1, 1, 0);
3748 }
3749 if (has_sharpness)
3750 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3751 V4L2_CID_SHARPNESS, -1, 2, 1, -1);
3752 if (has_freq)
3753 v4l2_ctrl_new_std_menu(hdl, &sd_ctrl_ops,
3754 V4L2_CID_POWER_LINE_FREQUENCY,
3755 V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
3756 V4L2_CID_POWER_LINE_FREQUENCY_50HZ);
3757 if (has_autogain)
3758 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3759 V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
3760 if (has_gain)
3761 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3762 V4L2_CID_GAIN, 0, 78, 1, 0);
3763 if (has_exposure)
3764 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3765 V4L2_CID_EXPOSURE, 0, 4095, 1, 450);
3766 if (has_backlight)
3767 v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3768 V4L2_CID_BACKLIGHT_COMPENSATION, 0, 15, 1, 15);
3769
3770 if (hdl->error) {
3771 pr_err("Could not initialize controls\n");
3772 return hdl->error;
3773 }
3774 if (sd->hflip)
3775 v4l2_ctrl_cluster(2, &sd->hflip);
3776 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003777}
3778
3779/* sub-driver description */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03003780static const struct sd_desc sd_desc = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003781 .name = MODULE_NAME,
Hans Verkuil930806c2012-05-18 06:45:30 -03003782 .init_controls = sd_init_controls,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003783 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03003784 .init = sd_init,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003785 .start = sd_start,
3786 .stopN = sd_stopN,
3787 .stop0 = sd_stop0,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003788 .pkt_scan = sd_pkt_scan,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003789};
3790
3791/* -- module initialisation -- */
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003792#define BF(bridge, flags) \
3793 .driver_info = (BRIDGE_ ## bridge << 8) \
3794 | (flags)
Jean-François Moine95c967c2011-01-13 05:20:29 -03003795static const struct usb_device_id device_table[] = {
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003796 {USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)},
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003797 {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
3798 {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
3799 {USB_DEVICE(0x046d, 0x0897), BF(VC0321, 0)},
3800 {USB_DEVICE(0x0ac8, 0x0321), BF(VC0321, 0)},
3801 {USB_DEVICE(0x0ac8, 0x0323), BF(VC0323, 0)},
3802 {USB_DEVICE(0x0ac8, 0x0328), BF(VC0321, 0)},
3803 {USB_DEVICE(0x0ac8, 0xc001), BF(VC0321, 0)},
3804 {USB_DEVICE(0x0ac8, 0xc002), BF(VC0321, 0)},
Jean-Francois Moinee27188e2009-07-27 06:00:03 -03003805 {USB_DEVICE(0x0ac8, 0xc301), BF(VC0323, FL_SAMSUNG)},
Jean-Francois Moine1852e752009-06-27 05:33:48 -03003806 {USB_DEVICE(0x15b8, 0x6001), BF(VC0323, 0)},
3807 {USB_DEVICE(0x15b8, 0x6002), BF(VC0323, 0)},
3808 {USB_DEVICE(0x17ef, 0x4802), BF(VC0323, 0)},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003809 {}
3810};
3811MODULE_DEVICE_TABLE(usb, device_table);
3812
3813/* -- device connect -- */
3814static int sd_probe(struct usb_interface *intf,
3815 const struct usb_device_id *id)
3816{
3817 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
3818 THIS_MODULE);
3819}
3820
3821static struct usb_driver sd_driver = {
3822 .name = MODULE_NAME,
3823 .id_table = device_table,
3824 .probe = sd_probe,
3825 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03003826#ifdef CONFIG_PM
3827 .suspend = gspca_suspend,
3828 .resume = gspca_resume,
Hans de Goede8bb58962012-06-30 06:44:47 -03003829 .reset_resume = gspca_resume,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03003830#endif
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03003831};
3832
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003833module_usb_driver(sd_driver);