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 int s5k83a_read_sensor(struct sd
*sd
, const u8 address
,
50 u8
*i2c_data
, const u8 len
);
51 int s5k83a_write_sensor(struct sd
*sd
, const u8 address
,
52 u8
*i2c_data
, const u8 len
);
54 int s5k83a_set_brightness(struct gspca_dev
*gspca_dev
, __s32 val
);
55 int s5k83a_get_brightness(struct gspca_dev
*gspca_dev
, __s32
*val
);
56 int s5k83a_set_whiteness(struct gspca_dev
*gspca_dev
, __s32 val
);
57 int s5k83a_get_whiteness(struct gspca_dev
*gspca_dev
, __s32
*val
);
58 int s5k83a_set_gain(struct gspca_dev
*gspca_dev
, __s32 val
);
59 int s5k83a_get_gain(struct gspca_dev
*gspca_dev
, __s32
*val
);
60 int s5k83a_get_vflip(struct gspca_dev
*gspca_dev
, __s32
*val
);
61 int s5k83a_set_vflip(struct gspca_dev
*gspca_dev
, __s32 val
);
62 int s5k83a_get_hflip(struct gspca_dev
*gspca_dev
, __s32
*val
);
63 int s5k83a_set_hflip(struct gspca_dev
*gspca_dev
, __s32 val
);
66 static struct m5602_sensor s5k83a
= {
68 .probe
= s5k83a_probe
,
70 .power_down
= s5k83a_power_down
,
76 .id
= V4L2_CID_BRIGHTNESS
,
77 .type
= V4L2_CTRL_TYPE_INTEGER
,
82 .default_value
= S5K83A_DEFAULT_BRIGHTNESS
,
83 .flags
= V4L2_CTRL_FLAG_SLIDER
85 .set
= s5k83a_set_brightness
,
86 .get
= s5k83a_get_brightness
90 .id
= V4L2_CID_WHITENESS
,
91 .type
= V4L2_CTRL_TYPE_INTEGER
,
96 .default_value
= S5K83A_DEFAULT_WHITENESS
,
97 .flags
= V4L2_CTRL_FLAG_SLIDER
99 .set
= s5k83a_set_whiteness
,
100 .get
= s5k83a_get_whiteness
,
104 .type
= V4L2_CTRL_TYPE_INTEGER
,
107 .maximum
= S5K83A_MAXIMUM_GAIN
,
109 .default_value
= S5K83A_DEFAULT_GAIN
,
110 .flags
= V4L2_CTRL_FLAG_SLIDER
112 .set
= s5k83a_set_gain
,
113 .get
= s5k83a_get_gain
116 .id
= V4L2_CID_HFLIP
,
117 .type
= V4L2_CTRL_TYPE_BOOLEAN
,
118 .name
= "horizontal flip",
124 .set
= s5k83a_set_hflip
,
125 .get
= s5k83a_get_hflip
128 .id
= V4L2_CID_VFLIP
,
129 .type
= V4L2_CTRL_TYPE_BOOLEAN
,
130 .name
= "vertical flip",
136 .set
= s5k83a_set_vflip
,
137 .get
= s5k83a_get_vflip
143 M5602_DEFAULT_FRAME_WIDTH
,
144 M5602_DEFAULT_FRAME_HEIGHT
,
148 M5602_DEFAULT_FRAME_WIDTH
* M5602_DEFAULT_FRAME_HEIGHT
,
149 .bytesperline
= M5602_DEFAULT_FRAME_WIDTH
,
150 .colorspace
= V4L2_COLORSPACE_SRGB
,
156 static const unsigned char preinit_s5k83a
[][4] =
158 {BRIDGE
, M5602_XB_MCU_CLK_DIV
, 0x02, 0x00},
159 {BRIDGE
, M5602_XB_MCU_CLK_CTRL
, 0xb0, 0x00},
160 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
161 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
162 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
163 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x0d, 0x00},
164 {BRIDGE
, M5602_XB_SENSOR_CTRL
, 0x00, 0x00},
166 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
167 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
168 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x08, 0x00},
169 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x3f, 0x00},
170 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x3f, 0x00},
171 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
172 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0xff, 0x00},
173 {BRIDGE
, M5602_XB_GPIO_DIR_L
, 0xff, 0x00},
174 {BRIDGE
, M5602_XB_GPIO_DAT_L
, 0x00, 0x00},
175 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0xb0, 0x00},
176 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0x80, 0x00},
177 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
178 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
179 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
180 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
181 {BRIDGE
, M5602_XB_MCU_CLK_DIV
, 0x02, 0x00},
182 {BRIDGE
, M5602_XB_MCU_CLK_CTRL
, 0xb0, 0x00},
183 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
184 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xf0, 0x00},
185 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
186 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x1c, 0x00},
187 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x06, 0x00},
188 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x06, 0x00},
189 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
190 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0x00, 0x00},
191 {BRIDGE
, M5602_XB_I2C_CLK_DIV
, 0x20, 0x00},
193 {SENSOR
, S5K83A_PAGE_MAP
, 0x00, 0x00}
196 /* This could probably be considerably shortened.
197 I don't have the hardware to experiment with it, patches welcome
199 static const unsigned char init_s5k83a
[][4] =
201 {SENSOR
, S5K83A_PAGE_MAP
, 0x04, 0x00},
202 {SENSOR
, 0xaf, 0x01, 0x00},
203 {SENSOR
, S5K83A_PAGE_MAP
, 0x00, 0x00},
204 {SENSOR
, 0x7b, 0xff, 0x00},
205 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
206 {SENSOR
, 0x01, 0x50, 0x00},
207 {SENSOR
, 0x12, 0x20, 0x00},
208 {SENSOR
, 0x17, 0x40, 0x00},
209 {SENSOR
, S5K83A_BRIGHTNESS
, 0x0f, 0x00},
210 {SENSOR
, 0x1c, 0x00, 0x00},
211 {SENSOR
, 0x02, 0x70, 0x00},
212 {SENSOR
, 0x03, 0x0b, 0x00},
213 {SENSOR
, 0x04, 0xf0, 0x00},
214 {SENSOR
, 0x05, 0x0b, 0x00},
215 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
217 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x06, 0x00},
218 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
219 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
220 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
221 {BRIDGE
, M5602_XB_LINE_OF_FRAME_H
, 0x81, 0x00},
222 {BRIDGE
, M5602_XB_PIX_OF_LINE_H
, 0x82, 0x00},
223 {BRIDGE
, M5602_XB_SIG_INI
, 0x01, 0x00},
224 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
225 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
226 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
227 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
228 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x01, 0x00},
229 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0xe4, 0x00},
230 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
231 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
232 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
233 {BRIDGE
, M5602_XB_SIG_INI
, 0x02, 0x00},
234 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
235 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
236 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x02, 0x00},
237 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x87, 0x00},
238 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
239 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
240 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
242 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
243 {SENSOR
, 0x06, 0x71, 0x00},
244 {SENSOR
, 0x07, 0xe8, 0x00},
245 {SENSOR
, 0x08, 0x02, 0x00},
246 {SENSOR
, 0x09, 0x88, 0x00},
247 {SENSOR
, 0x14, 0x00, 0x00},
248 {SENSOR
, 0x15, 0x20, 0x00},
249 {SENSOR
, 0x19, 0x00, 0x00},
250 {SENSOR
, 0x1a, 0x98, 0x00},
251 {SENSOR
, 0x0f, 0x02, 0x00},
252 {SENSOR
, 0x10, 0xe5, 0x00},
253 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
254 {SENSOR_LONG
, 0x14, 0x00, 0x20},
255 {SENSOR_LONG
, 0x0d, 0x00, 0x7d},
256 {SENSOR_LONG
, 0x1b, 0x0d, 0x05},
258 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x06, 0x00},
259 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
260 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
261 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
262 {BRIDGE
, M5602_XB_LINE_OF_FRAME_H
, 0x81, 0x00},
263 {BRIDGE
, M5602_XB_PIX_OF_LINE_H
, 0x82, 0x00},
264 {BRIDGE
, M5602_XB_SIG_INI
, 0x01, 0x00},
265 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
266 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
267 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
268 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
269 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x01, 0x00},
270 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0xe4, 0x00},
271 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
272 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
273 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
274 {BRIDGE
, M5602_XB_SIG_INI
, 0x02, 0x00},
275 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
276 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
277 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x02, 0x00},
278 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x87, 0x00},
280 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
281 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
282 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x08, 0x00},
283 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x3f, 0x00},
284 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x3f, 0x00},
285 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
286 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0xff, 0x00},
287 {BRIDGE
, M5602_XB_GPIO_DIR_L
, 0xff, 0x00},
288 {BRIDGE
, M5602_XB_GPIO_DAT_L
, 0x00, 0x00},
289 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0xb0, 0x00},
290 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0x80, 0x00},
291 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
292 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
293 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
294 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
295 {BRIDGE
, M5602_XB_MCU_CLK_DIV
, 0x02, 0x00},
296 {BRIDGE
, M5602_XB_MCU_CLK_CTRL
, 0xb0, 0x00},
297 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
298 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xf0, 0x00},
299 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
300 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x1c, 0x00},
301 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x06, 0x00},
302 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x06, 0x00},
303 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
304 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0x00, 0x00},
305 {BRIDGE
, M5602_XB_I2C_CLK_DIV
, 0x20, 0x00},
307 {SENSOR
, S5K83A_PAGE_MAP
, 0x04, 0x00},
308 {SENSOR
, 0xaf, 0x01, 0x00},
309 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
310 /* ff ( init value )is very dark) || 71 and f0 better */
311 {SENSOR
, 0x7b, 0xff, 0x00},
312 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
313 {SENSOR
, 0x01, 0x50, 0x00},
314 {SENSOR
, 0x12, 0x20, 0x00},
315 {SENSOR
, 0x17, 0x40, 0x00},
316 {SENSOR
, S5K83A_BRIGHTNESS
, 0x0f, 0x00},
317 {SENSOR
, 0x1c, 0x00, 0x00},
318 {SENSOR
, 0x02, 0x70, 0x00},
319 /* some values like 0x10 give a blue-purple image */
320 {SENSOR
, 0x03, 0x0b, 0x00},
321 {SENSOR
, 0x04, 0xf0, 0x00},
322 {SENSOR
, 0x05, 0x0b, 0x00},
323 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
325 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x06, 0x00},
326 /* under 80 don't work, highter depend on value */
327 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
329 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
330 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
331 {BRIDGE
, M5602_XB_LINE_OF_FRAME_H
, 0x81, 0x00},
332 {BRIDGE
, M5602_XB_PIX_OF_LINE_H
, 0x82, 0x00},
333 {BRIDGE
, M5602_XB_SIG_INI
, 0x01, 0x00},
334 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
335 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
336 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
337 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
338 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x01, 0x00},
339 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0xe4, 0x00},
340 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
341 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
342 {BRIDGE
, M5602_XB_SIG_INI
, 0x02, 0x00},
343 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
344 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
345 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x02, 0x00},
346 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x7f, 0x00},
348 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
349 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
350 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
352 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
353 {SENSOR
, 0x06, 0x71, 0x00},
354 {SENSOR
, 0x07, 0xe8, 0x00},
355 {SENSOR
, 0x08, 0x02, 0x00},
356 {SENSOR
, 0x09, 0x88, 0x00},
357 {SENSOR
, 0x14, 0x00, 0x00},
358 {SENSOR
, 0x15, 0x20, 0x00},
359 {SENSOR
, 0x19, 0x00, 0x00},
360 {SENSOR
, 0x1a, 0x98, 0x00},
361 {SENSOR
, 0x0f, 0x02, 0x00},
362 {SENSOR
, 0x10, 0xe5, 0x00},
363 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
364 {SENSOR_LONG
, 0x14, 0x00, 0x20},
365 {SENSOR_LONG
, 0x0d, 0x00, 0x7d},
366 {SENSOR_LONG
, 0x1b, 0x0d, 0x05},
368 /* The following sequence is useless after a clean boot
369 but is necessary after resume from suspend */
370 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
371 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x08, 0x00},
372 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x3f, 0x00},
373 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x3f, 0x00},
374 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
375 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0xff, 0x00},
376 {BRIDGE
, M5602_XB_GPIO_DIR_L
, 0xff, 0x00},
377 {BRIDGE
, M5602_XB_GPIO_DAT_L
, 0x00, 0x00},
378 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0xb0, 0x00},
379 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0x80, 0x00},
380 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
381 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
382 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
383 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
384 {BRIDGE
, M5602_XB_MCU_CLK_DIV
, 0x02, 0x00},
385 {BRIDGE
, M5602_XB_MCU_CLK_CTRL
, 0xb0, 0x00},
386 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
387 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xf0, 0x00},
388 {BRIDGE
, M5602_XB_GPIO_DIR
, 0x1d, 0x00},
389 {BRIDGE
, M5602_XB_GPIO_DAT
, 0x1c, 0x00},
390 {BRIDGE
, M5602_XB_GPIO_EN_H
, 0x06, 0x00},
391 {BRIDGE
, M5602_XB_GPIO_DIR_H
, 0x06, 0x00},
392 {BRIDGE
, M5602_XB_GPIO_DAT_H
, 0x00, 0x00},
393 {BRIDGE
, M5602_XB_GPIO_EN_L
, 0x00, 0x00},
394 {BRIDGE
, M5602_XB_I2C_CLK_DIV
, 0x20, 0x00},
396 {SENSOR
, S5K83A_PAGE_MAP
, 0x04, 0x00},
397 {SENSOR
, 0xaf, 0x01, 0x00},
398 {SENSOR
, S5K83A_PAGE_MAP
, 0x00, 0x00},
399 {SENSOR
, 0x7b, 0xff, 0x00},
400 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
401 {SENSOR
, 0x01, 0x50, 0x00},
402 {SENSOR
, 0x12, 0x20, 0x00},
403 {SENSOR
, 0x17, 0x40, 0x00},
404 {SENSOR
, S5K83A_BRIGHTNESS
, 0x0f, 0x00},
405 {SENSOR
, 0x1c, 0x00, 0x00},
406 {SENSOR
, 0x02, 0x70, 0x00},
407 {SENSOR
, 0x03, 0x0b, 0x00},
408 {SENSOR
, 0x04, 0xf0, 0x00},
409 {SENSOR
, 0x05, 0x0b, 0x00},
410 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
412 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x06, 0x00},
413 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
414 {BRIDGE
, M5602_XB_ADC_CTRL
, 0xc0, 0x00},
415 {BRIDGE
, M5602_XB_SENSOR_TYPE
, 0x09, 0x00},
416 {BRIDGE
, M5602_XB_LINE_OF_FRAME_H
, 0x81, 0x00},
417 {BRIDGE
, M5602_XB_PIX_OF_LINE_H
, 0x82, 0x00},
418 {BRIDGE
, M5602_XB_SIG_INI
, 0x01, 0x00},
419 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
420 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
421 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
422 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
423 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x01, 0x00},
424 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0xe4, 0x00},
425 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
426 {BRIDGE
, M5602_XB_VSYNC_PARA
, 0x00, 0x00},
427 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
428 {BRIDGE
, M5602_XB_SIG_INI
, 0x02, 0x00},
429 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
430 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x00, 0x00},
431 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x02, 0x00},
432 {BRIDGE
, M5602_XB_HSYNC_PARA
, 0x7f, 0x00},
433 {BRIDGE
, M5602_XB_SIG_INI
, 0x00, 0x00},
434 {BRIDGE
, M5602_XB_SEN_CLK_DIV
, 0x00, 0x00},
435 {BRIDGE
, M5602_XB_SEN_CLK_CTRL
, 0xb0, 0x00},
437 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
438 {SENSOR
, 0x06, 0x71, 0x00},
439 {SENSOR
, 0x07, 0xe8, 0x00},
440 {SENSOR
, 0x08, 0x02, 0x00},
441 {SENSOR
, 0x09, 0x88, 0x00},
442 {SENSOR
, 0x14, 0x00, 0x00},
443 {SENSOR
, 0x15, 0x20, 0x00},
444 {SENSOR
, 0x19, 0x00, 0x00},
445 {SENSOR
, 0x1a, 0x98, 0x00},
446 {SENSOR
, 0x0f, 0x02, 0x00},
448 {SENSOR
, 0x10, 0xe5, 0x00},
449 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
450 {SENSOR_LONG
, 0x14, 0x00, 0x20},
451 {SENSOR_LONG
, 0x0d, 0x00, 0x7d},
452 {SENSOR_LONG
, 0x1b, 0x0d, 0x05},
455 (this is value after boot, but after tries can be different) */
456 {SENSOR
, 0x00, 0x06, 0x00},
458 /* set default brightness */
459 {SENSOR_LONG
, 0x14, 0x00, 0x20},
460 {SENSOR_LONG
, 0x0d, 0x01, 0x00},
461 {SENSOR_LONG
, 0x1b, S5K83A_DEFAULT_BRIGHTNESS
>> 3,
462 S5K83A_DEFAULT_BRIGHTNESS
>> 1},
464 /* set default whiteness */
465 {SENSOR
, S5K83A_WHITENESS
, S5K83A_DEFAULT_WHITENESS
, 0x00},
467 /* set default gain */
468 {SENSOR_LONG
, 0x18, 0x00, S5K83A_DEFAULT_GAIN
},
470 /* set default flip */
471 {SENSOR
, S5K83A_PAGE_MAP
, 0x05, 0x00},
472 {SENSOR
, S5K83A_FLIP
, 0x00 | S5K83A_FLIP_MASK
, 0x00},
473 {SENSOR
, S5K83A_HFLIP_TUNE
, 0x0b, 0x00},
474 {SENSOR
, S5K83A_VFLIP_TUNE
, 0x0a, 0x00}