2 * Driver for the s5k83a sensor
4 * Copyright (C) 2008 Erik Andrén
5 * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
6 * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
8 * Portions of code to USB interface and ALi driver software,
9 * Copyright (c) 2006 Willem Duinker
10 * v4l2 interface modeled after the V4L2 driver
11 * for SN9C10x PC Camera Controllers
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation, version 2.
19 #ifndef M5602_S5K83A_H_
20 #define M5602_S5K83A_H_
22 #include "m5602_sensor.h"
24 #define S5K83A_FLIP 0x01
25 #define S5K83A_HFLIP_TUNE 0x03
26 #define S5K83A_VFLIP_TUNE 0x05
27 #define S5K83A_WHITENESS 0x0a
28 #define S5K83A_GAIN 0x18
29 #define S5K83A_BRIGHTNESS 0x1b
30 #define S5K83A_PAGE_MAP 0xec
32 #define S5K83A_DEFAULT_BRIGHTNESS 0x71
33 #define S5K83A_DEFAULT_WHITENESS 0x7e
34 #define S5K83A_DEFAULT_GAIN 0x00
35 #define S5K83A_MAXIMUM_GAIN 0x3c
36 #define S5K83A_FLIP_MASK 0x10
39 /*****************************************************************************/
41 /* Kernel module parameters */
42 extern int force_sensor;
43 extern int dump_sensor;
45 int s5k83a_probe(struct sd *sd);
46 int s5k83a_init(struct sd *sd);
47 int s5k83a_power_down(struct sd *sd);
49 void s5k83a_dump_registers(struct sd *sd);
51 int s5k83a_read_sensor(struct sd *sd, const u8 address,
52 u8 *i2c_data, const u8 len);
53 int s5k83a_write_sensor(struct sd *sd, const u8 address,
54 u8 *i2c_data, const u8 len);
56 int s5k83a_set_brightness(struct gspca_dev *gspca_dev, __s32 val);
57 int s5k83a_get_brightness(struct gspca_dev *gspca_dev, __s32 *val);
58 int s5k83a_set_whiteness(struct gspca_dev *gspca_dev, __s32 val);
59 int s5k83a_get_whiteness(struct gspca_dev *gspca_dev, __s32 *val);
60 int s5k83a_set_gain(struct gspca_dev *gspca_dev, __s32 val);
61 int s5k83a_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
62 int s5k83a_get_vflip(struct gspca_dev *gspca_dev, __s32 *val);
63 int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
64 int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
65 int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
68 static struct m5602_sensor s5k83a = {
70 .probe = s5k83a_probe,
72 .power_down = s5k83a_power_down,
73 .read_sensor = s5k83a_read_sensor,
74 .write_sensor = s5k83a_write_sensor,
80 .id = V4L2_CID_BRIGHTNESS,
81 .type = V4L2_CTRL_TYPE_INTEGER,
86 .default_value = S5K83A_DEFAULT_BRIGHTNESS,
87 .flags = V4L2_CTRL_FLAG_SLIDER
89 .set = s5k83a_set_brightness,
90 .get = s5k83a_get_brightness
94 .id = V4L2_CID_WHITENESS,
95 .type = V4L2_CTRL_TYPE_INTEGER,
100 .default_value = S5K83A_DEFAULT_WHITENESS,
101 .flags = V4L2_CTRL_FLAG_SLIDER
103 .set = s5k83a_set_whiteness,
104 .get = s5k83a_get_whiteness,
108 .type = V4L2_CTRL_TYPE_INTEGER,
111 .maximum = S5K83A_MAXIMUM_GAIN,
113 .default_value = S5K83A_DEFAULT_GAIN,
114 .flags = V4L2_CTRL_FLAG_SLIDER
116 .set = s5k83a_set_gain,
117 .get = s5k83a_get_gain
120 .id = V4L2_CID_HFLIP,
121 .type = V4L2_CTRL_TYPE_BOOLEAN,
122 .name = "horizontal flip",
128 .set = s5k83a_set_hflip,
129 .get = s5k83a_get_hflip
132 .id = V4L2_CID_VFLIP,
133 .type = V4L2_CTRL_TYPE_BOOLEAN,
134 .name = "vertical flip",
140 .set = s5k83a_set_vflip,
141 .get = s5k83a_get_vflip
147 M5602_DEFAULT_FRAME_WIDTH,
148 M5602_DEFAULT_FRAME_HEIGHT,
152 M5602_DEFAULT_FRAME_WIDTH * M5602_DEFAULT_FRAME_HEIGHT,
153 .bytesperline = M5602_DEFAULT_FRAME_WIDTH,
154 .colorspace = V4L2_COLORSPACE_SRGB,
160 static const unsigned char preinit_s5k83a[][4] =
162 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
163 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
164 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
165 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
166 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
167 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0d, 0x00},
168 {BRIDGE, M5602_XB_SENSOR_CTRL, 0x00, 0x00},
170 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
171 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
172 {BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
173 {BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
174 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
175 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
176 {BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
177 {BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
178 {BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
179 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
180 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
181 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
182 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
183 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
184 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
185 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
186 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
187 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
188 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
189 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
190 {BRIDGE, M5602_XB_GPIO_DAT, 0x1c, 0x00},
191 {BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
192 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
193 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
194 {BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
195 {BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
197 {SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00}
200 /* This could probably be considerably shortened.
201 I don't have the hardware to experiment with it, patches welcome
203 static const unsigned char init_s5k83a[][4] =
205 {SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
206 {SENSOR, 0xaf, 0x01, 0x00},
207 {SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00},
208 {SENSOR, 0x7b, 0xff, 0x00},
209 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
210 {SENSOR, 0x01, 0x50, 0x00},
211 {SENSOR, 0x12, 0x20, 0x00},
212 {SENSOR, 0x17, 0x40, 0x00},
213 {SENSOR, S5K83A_BRIGHTNESS, 0x0f, 0x00},
214 {SENSOR, 0x1c, 0x00, 0x00},
215 {SENSOR, 0x02, 0x70, 0x00},
216 {SENSOR, 0x03, 0x0b, 0x00},
217 {SENSOR, 0x04, 0xf0, 0x00},
218 {SENSOR, 0x05, 0x0b, 0x00},
219 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
221 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
222 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
223 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
224 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
225 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
226 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
227 {BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
228 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
229 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
230 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
231 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
232 {BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
233 {BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
234 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
235 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
236 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
237 {BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
238 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
239 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
240 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
241 {BRIDGE, M5602_XB_HSYNC_PARA, 0x87, 0x00},
242 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
243 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
244 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
246 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
247 {SENSOR, 0x06, 0x71, 0x00},
248 {SENSOR, 0x07, 0xe8, 0x00},
249 {SENSOR, 0x08, 0x02, 0x00},
250 {SENSOR, 0x09, 0x88, 0x00},
251 {SENSOR, 0x14, 0x00, 0x00},
252 {SENSOR, 0x15, 0x20, 0x00},
253 {SENSOR, 0x19, 0x00, 0x00},
254 {SENSOR, 0x1a, 0x98, 0x00},
255 {SENSOR, 0x0f, 0x02, 0x00},
256 {SENSOR, 0x10, 0xe5, 0x00},
257 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
258 {SENSOR_LONG, 0x14, 0x00, 0x20},
259 {SENSOR_LONG, 0x0d, 0x00, 0x7d},
260 {SENSOR_LONG, 0x1b, 0x0d, 0x05},
262 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
263 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
264 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
265 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
266 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
267 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
268 {BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
269 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
270 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
271 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
272 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
273 {BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
274 {BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
275 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
276 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
277 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
278 {BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
279 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
280 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
281 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
282 {BRIDGE, M5602_XB_HSYNC_PARA, 0x87, 0x00},
284 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
285 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
286 {BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
287 {BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
288 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
289 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
290 {BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
291 {BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
292 {BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
293 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
294 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
295 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
296 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
297 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
298 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
299 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
300 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
301 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
302 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
303 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
304 {BRIDGE, M5602_XB_GPIO_DAT, 0x1c, 0x00},
305 {BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
306 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
307 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
308 {BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
309 {BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
311 {SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
312 {SENSOR, 0xaf, 0x01, 0x00},
313 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
314 /* ff ( init value )is very dark) || 71 and f0 better */
315 {SENSOR, 0x7b, 0xff, 0x00},
316 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
317 {SENSOR, 0x01, 0x50, 0x00},
318 {SENSOR, 0x12, 0x20, 0x00},
319 {SENSOR, 0x17, 0x40, 0x00},
320 {SENSOR, S5K83A_BRIGHTNESS, 0x0f, 0x00},
321 {SENSOR, 0x1c, 0x00, 0x00},
322 {SENSOR, 0x02, 0x70, 0x00},
323 /* some values like 0x10 give a blue-purple image */
324 {SENSOR, 0x03, 0x0b, 0x00},
325 {SENSOR, 0x04, 0xf0, 0x00},
326 {SENSOR, 0x05, 0x0b, 0x00},
327 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
329 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
330 /* under 80 don't work, highter depend on value */
331 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
333 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
334 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
335 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
336 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
337 {BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
338 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
339 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
340 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
341 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
342 {BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
343 {BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
344 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
345 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
346 {BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
347 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
348 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
349 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
350 {BRIDGE, M5602_XB_HSYNC_PARA, 0x7f, 0x00},
352 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
353 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
354 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
356 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
357 {SENSOR, 0x06, 0x71, 0x00},
358 {SENSOR, 0x07, 0xe8, 0x00},
359 {SENSOR, 0x08, 0x02, 0x00},
360 {SENSOR, 0x09, 0x88, 0x00},
361 {SENSOR, 0x14, 0x00, 0x00},
362 {SENSOR, 0x15, 0x20, 0x00},
363 {SENSOR, 0x19, 0x00, 0x00},
364 {SENSOR, 0x1a, 0x98, 0x00},
365 {SENSOR, 0x0f, 0x02, 0x00},
366 {SENSOR, 0x10, 0xe5, 0x00},
367 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
368 {SENSOR_LONG, 0x14, 0x00, 0x20},
369 {SENSOR_LONG, 0x0d, 0x00, 0x7d},
370 {SENSOR_LONG, 0x1b, 0x0d, 0x05},
372 /* The following sequence is useless after a clean boot
373 but is necessary after resume from suspend */
374 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
375 {BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
376 {BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
377 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
378 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
379 {BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
380 {BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
381 {BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
382 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
383 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
384 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
385 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
386 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
387 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
388 {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
389 {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
390 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
391 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
392 {BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
393 {BRIDGE, M5602_XB_GPIO_DAT, 0x1c, 0x00},
394 {BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
395 {BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
396 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
397 {BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
398 {BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
400 {SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
401 {SENSOR, 0xaf, 0x01, 0x00},
402 {SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00},
403 {SENSOR, 0x7b, 0xff, 0x00},
404 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
405 {SENSOR, 0x01, 0x50, 0x00},
406 {SENSOR, 0x12, 0x20, 0x00},
407 {SENSOR, 0x17, 0x40, 0x00},
408 {SENSOR, S5K83A_BRIGHTNESS, 0x0f, 0x00},
409 {SENSOR, 0x1c, 0x00, 0x00},
410 {SENSOR, 0x02, 0x70, 0x00},
411 {SENSOR, 0x03, 0x0b, 0x00},
412 {SENSOR, 0x04, 0xf0, 0x00},
413 {SENSOR, 0x05, 0x0b, 0x00},
414 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
416 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
417 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
418 {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
419 {BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
420 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
421 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
422 {BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
423 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
424 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
425 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
426 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
427 {BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
428 {BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
429 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
430 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
431 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
432 {BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
433 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
434 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
435 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
436 {BRIDGE, M5602_XB_HSYNC_PARA, 0x7f, 0x00},
437 {BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
438 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
439 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
441 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
442 {SENSOR, 0x06, 0x71, 0x00},
443 {SENSOR, 0x07, 0xe8, 0x00},
444 {SENSOR, 0x08, 0x02, 0x00},
445 {SENSOR, 0x09, 0x88, 0x00},
446 {SENSOR, 0x14, 0x00, 0x00},
447 {SENSOR, 0x15, 0x20, 0x00},
448 {SENSOR, 0x19, 0x00, 0x00},
449 {SENSOR, 0x1a, 0x98, 0x00},
450 {SENSOR, 0x0f, 0x02, 0x00},
452 {SENSOR, 0x10, 0xe5, 0x00},
453 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
454 {SENSOR_LONG, 0x14, 0x00, 0x20},
455 {SENSOR_LONG, 0x0d, 0x00, 0x7d},
456 {SENSOR_LONG, 0x1b, 0x0d, 0x05},
459 (this is value after boot, but after tries can be different) */
460 {SENSOR, 0x00, 0x06, 0x00},
462 /* set default brightness */
463 {SENSOR_LONG, 0x14, 0x00, 0x20},
464 {SENSOR_LONG, 0x0d, 0x01, 0x00},
465 {SENSOR_LONG, 0x1b, S5K83A_DEFAULT_BRIGHTNESS >> 3,
466 S5K83A_DEFAULT_BRIGHTNESS >> 1},
468 /* set default whiteness */
469 {SENSOR, S5K83A_WHITENESS, S5K83A_DEFAULT_WHITENESS, 0x00},
471 /* set default gain */
472 {SENSOR_LONG, 0x18, 0x00, S5K83A_DEFAULT_GAIN},
474 /* set default flip */
475 {SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
476 {SENSOR, S5K83A_FLIP, 0x00 | S5K83A_FLIP_MASK, 0x00},
477 {SENSOR, S5K83A_HFLIP_TUNE, 0x0b, 0x00},
478 {SENSOR, S5K83A_VFLIP_TUNE, 0x0a, 0x00}