1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * ov2775 driver
4 *
5 * Copyright (C) 2020 Rockchip Electronics Co., Ltd.
6 *
7 * V0.0X01.0X01 first version
8 */
9
10 #include <linux/clk.h>
11 #include <linux/device.h>
12 #include <linux/delay.h>
13 #include <linux/gpio/consumer.h>
14 #include <linux/i2c.h>
15 #include <linux/module.h>
16 #include <linux/pm_runtime.h>
17 #include <linux/regulator/consumer.h>
18 #include <linux/sysfs.h>
19 #include <linux/slab.h>
20 #include <linux/version.h>
21 #include <linux/rk-camera-module.h>
22 #include <media/media-entity.h>
23 #include <media/v4l2-async.h>
24 #include <media/v4l2-ctrls.h>
25 #include <media/v4l2-subdev.h>
26 #include <media/v4l2-fwnode.h>
27 #include <linux/pinctrl/consumer.h>
28 #include <linux/of.h>
29 #include <linux/of_device.h>
30 #include <linux/of_graph.h>
31 #include <linux/of_platform.h>
32 #include <linux/of_gpio.h>
33 #include <linux/mfd/syscon.h>
34 #include <linux/rk-preisp.h>
35
36 #define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x00)
37
38 #ifndef V4L2_CID_DIGITAL_GAIN
39 #define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN
40 #endif
41
42 #define OV2775_LINK_FREQ_480MHZ 480000000
43 #define OV2775_XVCLK_FREQ 24000000
44
45 #define CHIP_ID 0x2770
46 #define OV2775_REG_CHIP_ID 0x300a
47
48 #define OV2775_REG_CTRL_MODE 0x3012
49 #define OV2775_MODE_SW_STANDBY 0x0
50 #define OV2775_MODE_STREAMING BIT(0)
51
52 #define OV2775_REG_EXPOSURE_H 0x30B6
53 #define OV2775_REG_EXPOSURE_L 0x30B7
54 #define OV2775_EXPOSURE_MIN 1
55 #define OV2775_EXPOSURE_STEP 1
56 #define OV2775_VTS_MAX 0xffff
57
58 #define OV2775_READ_MODE 0x30c0
59 #define OV2775_FLIP BIT(3)
60 #define OV2775_MIRROR BIT(2)
61
62 #define OV2775_REG_GAIN 0x30bb
63 #define OV2775_GAIN_MIN 0x0300
64 #define OV2775_GAIN_MAX 0x20000
65 #define OV2775_GAIN_STEP 1
66 #define OV2775_GAIN_DEFAULT 0x0300
67
68 #define OV2775_REG_DIG_GAIN_HCG_H 0x315a
69 #define OV2775_REG_DIG_GAIN_HCG_L 0x315b
70
71 #define OV2775_REG_DIG_GAIN_LCG_H 0x315c
72 #define OV2775_REG_DIG_GAIN_LCG_L 0x315d
73
74 #define OV2775_REG_TEST_PATTERN 0x303a
75 #define OV2775_TEST_PATTERN_ENABLE 0x20
76 #define OV2775_TEST_PATTERN_DISABLE 0x0
77
78 #define OV2775_REG_VTS_H 0x30b2
79 #define OV2775_REG_VTS_L 0x30b3
80
81 #define OV2775_REG_GROUP_CTL 0x3464
82 #define OV2775_REG_OPERATE_CTL 0x3467
83 #define OV2775_REG_GROUP_BIT 0x8000
84
85 #define REG_DELAY 0xFFFE
86 #define REG_NULL 0xFFFF
87
88 #define OV2775_REG_VALUE_08BIT 1
89 #define OV2775_REG_VALUE_16BIT 2
90 #define OV2775_REG_VALUE_24BIT 3
91
92 #define OF_CAMERA_PINCTRL_STATE_DEFAULT "rockchip,camera_default"
93 #define OF_CAMERA_PINCTRL_STATE_SLEEP "rockchip,camera_sleep"
94
95 #define OV2775_NAME "ov2775"
96
97 struct ov2775_gpio {
98 int pltfrm_gpio;
99 const char *label;
100 enum of_gpio_flags active_low;
101 };
102
103 static const char * const ov2775_supply_names[] = {
104 "avdd", /* Analog power */
105 "dovdd", /* Digital I/O power */
106 "dvdd", /* Digital core power */
107 };
108
109 #define OV2775_NUM_SUPPLIES ARRAY_SIZE(ov2775_supply_names)
110
111 struct regval {
112 u16 addr;
113 u8 val;
114 };
115
116 struct ov2775_mode {
117 u32 bus_fmt;
118 u32 width;
119 u32 height;
120 struct v4l2_fract max_fps;
121 u32 hts_def;
122 u32 vts_def;
123 u32 exp_def;
124 u32 hdr_mode;
125 u32 bpp;
126 u32 lane;
127 u32 vc[PAD_MAX];
128 const struct regval *reg_list;
129
130 };
131
132 struct ov2775 {
133 struct i2c_client *client;
134 struct clk *xvclk;
135 struct gpio_desc *rst_gpio;
136 struct gpio_desc *pd_gpio;
137 struct gpio_desc *pwd_gpio;
138 struct regulator_bulk_data supplies[OV2775_NUM_SUPPLIES];
139 struct pinctrl *pinctrl;
140 struct pinctrl_state *pins_default;
141 struct pinctrl_state *pins_sleep;
142 struct preisp_hdrae_exp_s init_hdrae_exp;
143
144 struct v4l2_subdev subdev;
145 struct media_pad pad;
146 struct v4l2_ctrl_handler ctrl_handler;
147 struct v4l2_ctrl *exposure;
148 struct v4l2_ctrl *anal_gain;
149 struct v4l2_ctrl *digi_gain;
150 struct v4l2_ctrl *hblank;
151 struct v4l2_ctrl *vblank;
152 struct v4l2_ctrl *test_pattern;
153 struct v4l2_ctrl *pixel_rate;
154 struct v4l2_ctrl *h_flip;
155 struct v4l2_ctrl *v_flip;
156 struct mutex mutex;
157 bool has_init_exp;
158 bool streaming;
159 bool power_on;
160 const struct ov2775_mode *cur_mode;
161 const struct ov2775_mode *support_modes;
162 u32 support_modes_num;
163 u32 module_index;
164 u32 flip;
165 const char *module_facing;
166 const char *module_name;
167 const char *len_name;
168 };
169
170 #define to_ov2775(sd) container_of(sd, struct ov2775, subdev)
171
172 /* 4 lanes,raw 12bit */
173 static const struct regval ov2775_linear12bit_init_tab_1920_1080[] = {
174 {0x3013, 0x01},
175 {REG_DELAY, 0x10},
176 {0x3000, 0x02},
177 {0x3001, 0x28},
178 {0x3002, 0x03},
179 {0x3003, 0x01},
180 {0x3004, 0x02},
181 {0x3005, 0x26},
182 {0x3006, 0x00},
183 {0x3007, 0x07},
184 {0x3008, 0x01},
185 {0x3009, 0x00},
186 {0x300c, 0x6c},
187 {0x300e, 0x80},
188 {0x300f, 0x00},
189 {0x3012, 0x00},
190 {0x3013, 0x00},
191 {0x3014, 0xc4},
192 {0x3015, 0x00},
193 {0x3017, 0x00},
194 {0x3018, 0x00},
195 {0x3019, 0x00},
196 {0x301a, 0x00},
197 {0x301b, 0x01},
198 {0x301e, 0x17},
199 {0x301f, 0xe1},
200 {0x3030, 0x02},
201 {0x3031, 0x72},
202 {0x3032, 0xf0},
203 {0x3033, 0x30},
204 {0x3034, 0x3f},
205 {0x3035, 0x5f},
206 {0x3036, 0x02},
207 {0x3037, 0x9f},
208 {0x3038, 0x04},
209 {0x3039, 0xb7},
210 {0x303a, 0x04},
211 {0x303b, 0x07},
212 {0x303c, 0xf0},
213 {0x303d, 0x00},
214 {0x303e, 0x0b},
215 {0x303f, 0xe3},
216 {0x3040, 0xf3},
217 {0x3041, 0x29},
218 {0x3042, 0xf6},
219 {0x3043, 0x65},
220 {0x3044, 0x06},
221 {0x3045, 0x0f},
222 {0x3046, 0x59},
223 {0x3047, 0x07},
224 {0x3048, 0x82},
225 {0x3049, 0xcf},
226 {0x304a, 0x12},
227 {0x304b, 0x40},
228 {0x304c, 0x33},
229 {0x304d, 0xa4},
230 {0x304e, 0x0b},
231 {0x304f, 0x3d},
232 {0x3050, 0x10},
233 {0x3060, 0x00},
234 {0x3061, 0x64},
235 {0x3062, 0x00},
236 {0x3063, 0xe4},
237 {0x3066, 0x80},
238 {0x3080, 0x00},
239 {0x3081, 0x00},
240 {0x3082, 0x01},
241 {0x3083, 0xe3},
242 {0x3084, 0x06},
243 {0x3085, 0x00},
244 {0x3086, 0x10},
245 {0x3087, 0x10},
246 {0x3089, 0x00},
247 {0x308a, 0x01},
248 {0x3093, 0x00},
249 {0x30a0, 0x00},
250 {0x30a1, 0x00},
251 {0x30a2, 0x00},
252 {0x30a3, 0x00},
253 {0x30a4, 0x07},
254 {0x30a5, 0x8f},
255 {0x30a6, 0x04},
256 {0x30a7, 0x47},
257 {0x30a8, 0x00},
258 {0x30a9, 0x00},
259 {0x30aa, 0x00},
260 {0x30ab, 0x00},
261 {0x30ac, 0x07},
262 {0x30ad, 0x90},
263 {0x30ae, 0x04},
264 {0x30af, 0x48},
265 {0x30b0, 0x04},
266 {0x30b1, 0x7e},
267 {0x30b2, 0x04},
268 {0x30b3, 0x65},
269 {0x30b4, 0x00},
270 {0x30b5, 0x00},
271 {0x30b6, 0x00},
272 {0x30b7, 0x10},
273 {0x30b8, 0x00},
274 {0x30b9, 0x02},
275 {0x30ba, 0x10},
276 {0x30bb, 0x00},
277 {0x30bc, 0x00},
278 {0x30bd, 0x03},
279 {0x30be, 0x5c},
280 {0x30bf, 0x00},
281 {0x30c0, 0x01},
282 {0x30c1, 0x00},
283 {0x30c2, 0x20},
284 {0x30c3, 0x00},
285 {0x30c4, 0x4a},
286 {0x30c5, 0x00},
287 {0x30c7, 0x00},
288 {0x30c8, 0x00},
289 {0x30d1, 0x00},
290 {0x30d2, 0x00},
291 {0x30d3, 0x80},
292 {0x30d4, 0x00},
293 {0x30d9, 0x09},
294 {0x30da, 0x64},
295 {0x30dd, 0x00},
296 {0x30de, 0x16},
297 {0x30df, 0x00},
298 {0x30e0, 0x17},
299 {0x30e1, 0x00},
300 {0x30e2, 0x18},
301 {0x30e3, 0x10},
302 {0x30e4, 0x04},
303 {0x30e5, 0x00},
304 {0x30e6, 0x00},
305 {0x30e7, 0x00},
306 {0x30e8, 0x00},
307 {0x30e9, 0x00},
308 {0x30ea, 0x00},
309 {0x30eb, 0x00},
310 {0x30ec, 0x00},
311 {0x30ed, 0x00},
312 {0x3101, 0x00},
313 {0x3102, 0x00},
314 {0x3103, 0x00},
315 {0x3104, 0x00},
316 {0x3105, 0x8c},
317 {0x3106, 0x87},
318 {0x3107, 0xc0},
319 {0x3108, 0x9d},
320 {0x3109, 0x8d},
321 {0x310a, 0x8d},
322 {0x310b, 0x6a},
323 {0x310c, 0x3a},
324 {0x310d, 0x5a},
325 {0x310e, 0x00},
326 {0x3120, 0x00},
327 {0x3121, 0x00},
328 {0x3122, 0x00},
329 {0x3123, 0xf0},
330 {0x3124, 0x00},
331 {0x3125, 0x70},
332 {0x3126, 0x1f},
333 {0x3127, 0x0f},
334 {0x3128, 0x00},
335 {0x3129, 0x3a},
336 {0x312a, 0x02},
337 {0x312b, 0x0f},
338 {0x312c, 0x00},
339 {0x312d, 0x0f},
340 {0x312e, 0x1d},
341 {0x312f, 0x00},
342 {0x3130, 0x00},
343 {0x3131, 0x00},
344 {0x3132, 0x00},
345 {0x3140, 0x0a},
346 {0x3141, 0x03},
347 {0x3142, 0x00},
348 {0x3143, 0x00},
349 {0x3144, 0x00},
350 {0x3145, 0x00},
351 {0x3146, 0x00},
352 {0x3147, 0x00},
353 {0x3148, 0x00},
354 {0x3149, 0x00},
355 {0x314a, 0x00},
356 {0x314b, 0x00},
357 {0x314c, 0x00},
358 {0x314d, 0x00},
359 {0x314e, 0x1c},
360 {0x314f, 0xff},
361 {0x3150, 0xff},
362 {0x3151, 0xff},
363 {0x3152, 0x10},
364 {0x3153, 0x10},
365 {0x3154, 0x10},
366 {0x3155, 0x00},
367 {0x3156, 0x03},
368 {0x3157, 0x00},
369 {0x3158, 0x0f},
370 {0x3159, 0xff},
371 {0x315a, 0x01},
372 {0x315b, 0x00},
373 {0x315c, 0x01},
374 {0x315d, 0x00},
375 {0x315e, 0x01},
376 {0x315f, 0x00},
377 {0x3160, 0x00},
378 {0x3161, 0x40},
379 {0x3162, 0x00},
380 {0x3163, 0x40},
381 {0x3164, 0x00},
382 {0x3165, 0x40},
383 {0x3190, 0x08},
384 {0x3191, 0x99},
385 {0x3193, 0x08},
386 {0x3194, 0x13},
387 {0x3195, 0x33},
388 {0x3196, 0x00},
389 {0x3197, 0x10},
390 {0x3198, 0x00},
391 {0x3199, 0x7f},
392 {0x319a, 0x80},
393 {0x319b, 0xff},
394 {0x319c, 0x80},
395 {0x319d, 0xbf},
396 {0x319e, 0xc0},
397 {0x319f, 0xff},
398 {0x31a0, 0x24},
399 {0x31a1, 0x55},
400 {0x31a2, 0x00},
401 {0x31a3, 0x00},
402 {0x31a6, 0x00},
403 {0x31a7, 0x00},
404 {0x31b0, 0x00},
405 {0x31b1, 0x00},
406 {0x31b2, 0x02},
407 {0x31b3, 0x00},
408 {0x31b4, 0x00},
409 {0x31b5, 0x01},
410 {0x31b6, 0x00},
411 {0x31b7, 0x00},
412 {0x31b8, 0x00},
413 {0x31b9, 0x00},
414 {0x31ba, 0x00},
415 {0x31d0, 0x3c},
416 {0x31d1, 0x34},
417 {0x31d2, 0x3c},
418 {0x31d3, 0x00},
419 {0x31d4, 0x2d},
420 {0x31d5, 0x00},
421 {0x31d6, 0x01},
422 {0x31d7, 0x06},
423 {0x31d8, 0x00},
424 {0x31d9, 0x64},
425 {0x31da, 0x00},
426 {0x31db, 0x30},
427 {0x31dc, 0x04},
428 {0x31dd, 0x69},
429 {0x31de, 0x0a},
430 {0x31df, 0x3c},
431 {0x31e0, 0x04},
432 {0x31e1, 0x32},
433 {0x31e2, 0x00},
434 {0x31e3, 0x00},
435 {0x31e4, 0x08},
436 {0x31e5, 0x80},
437 {0x31e6, 0x00},
438 {0x31e7, 0x2c},
439 {0x31e8, 0x6c},
440 {0x31e9, 0xac},
441 {0x31ea, 0xec},
442 {0x31eb, 0x3f},
443 {0x31ec, 0x0f},
444 {0x31ed, 0x20},
445 {0x31ee, 0x04},
446 {0x31ef, 0x48},
447 {0x31f0, 0x07},
448 {0x31f1, 0x90},
449 {0x31f2, 0x04},
450 {0x31f3, 0x48},
451 {0x31f4, 0x07},
452 {0x31f5, 0x90},
453 {0x31f6, 0x04},
454 {0x31f7, 0x48},
455 {0x31f8, 0x07},
456 {0x31f9, 0x90},
457 {0x31fa, 0x04},
458 {0x31fb, 0x48},
459 {0x31fd, 0xcb},
460 {0x31fe, 0x0f},
461 {0x31ff, 0x03},
462 {0x3200, 0x00},
463 {0x3201, 0xff},
464 {0x3202, 0x00},
465 {0x3203, 0xff},
466 {0x3204, 0xff},
467 {0x3205, 0xff},
468 {0x3206, 0xff},
469 {0x3207, 0xff},
470 {0x3208, 0xff},
471 {0x3209, 0xff},
472 {0x320a, 0xff},
473 {0x320b, 0x1b},
474 {0x320c, 0x1f},
475 {0x320d, 0x1e},
476 {0x320e, 0x30},
477 {0x320f, 0x2d},
478 {0x3210, 0x2c},
479 {0x3211, 0x2b},
480 {0x3212, 0x2a},
481 {0x3213, 0x24},
482 {0x3214, 0x22},
483 {0x3215, 0x00},
484 {0x3216, 0x04},
485 {0x3217, 0x2c},
486 {0x3218, 0x6c},
487 {0x3219, 0xac},
488 {0x321a, 0xec},
489 {0x321b, 0x00},
490 {0x3230, 0x3a},
491 {0x3231, 0x00},
492 {0x3232, 0x80},
493 {0x3233, 0x00},
494 {0x3234, 0x10},
495 {0x3235, 0xaa},
496 {0x3236, 0x55},
497 {0x3237, 0x99},
498 {0x3238, 0x66},
499 {0x3239, 0x08},
500 {0x323a, 0x88},
501 {0x323b, 0x00},
502 {0x323c, 0x00},
503 {0x323d, 0x03},
504 {0x3250, 0x33},
505 {0x3251, 0x00},
506 {0x3252, 0x20},
507 {0x3253, 0x00},
508 {0x3254, 0x00},
509 {0x3255, 0x01},
510 {0x3256, 0x00},
511 {0x3257, 0x00},
512 {0x3258, 0x00},
513 {0x3270, 0x01},
514 {0x3271, 0x60},
515 {0x3272, 0xc0},
516 {0x3273, 0x00},
517 {0x3274, 0x80},
518 {0x3275, 0x40},
519 {0x3276, 0x02},
520 {0x3277, 0x08},
521 {0x3278, 0x10},
522 {0x3279, 0x04},
523 {0x327a, 0x00},
524 {0x327b, 0x03},
525 {0x327c, 0x10},
526 {0x327d, 0x60},
527 {0x327e, 0xc0},
528 {0x327f, 0x06},
529 {0x3288, 0x10},
530 {0x3289, 0x00},
531 {0x328a, 0x08},
532 {0x328b, 0x00},
533 {0x328c, 0x04},
534 {0x328d, 0x00},
535 {0x328e, 0x02},
536 {0x328f, 0x00},
537 {0x3290, 0x20},
538 {0x3291, 0x00},
539 {0x3292, 0x10},
540 {0x3293, 0x00},
541 {0x3294, 0x08},
542 {0x3295, 0x00},
543 {0x3296, 0x04},
544 {0x3297, 0x00},
545 {0x3298, 0x40},
546 {0x3299, 0x00},
547 {0x329a, 0x20},
548 {0x329b, 0x00},
549 {0x329c, 0x10},
550 {0x329d, 0x00},
551 {0x329e, 0x08},
552 {0x329f, 0x00},
553 {0x32a0, 0x7f},
554 {0x32a1, 0xff},
555 {0x32a2, 0x40},
556 {0x32a3, 0x00},
557 {0x32a4, 0x20},
558 {0x32a5, 0x00},
559 {0x32a6, 0x10},
560 {0x32a7, 0x00},
561 {0x32a8, 0x00},
562 {0x32a9, 0x00},
563 {0x32aa, 0x00},
564 {0x32ab, 0x00},
565 {0x32ac, 0x00},
566 {0x32ad, 0x00},
567 {0x32ae, 0x00},
568 {0x32af, 0x00},
569 {0x32b0, 0x00},
570 {0x32b1, 0x00},
571 {0x32b2, 0x00},
572 {0x32b3, 0x00},
573 {0x32b4, 0x00},
574 {0x32b5, 0x00},
575 {0x32b6, 0x00},
576 {0x32b7, 0x00},
577 {0x32b8, 0x00},
578 {0x32b9, 0x00},
579 {0x32ba, 0x00},
580 {0x32bb, 0x00},
581 {0x32bc, 0x00},
582 {0x32bd, 0x00},
583 {0x32be, 0x00},
584 {0x32bf, 0x00},
585 {0x32c0, 0x00},
586 {0x32c1, 0x00},
587 {0x32c2, 0x00},
588 {0x32c3, 0x00},
589 {0x32c4, 0x00},
590 {0x32c5, 0x00},
591 {0x32c6, 0x00},
592 {0x32c7, 0x00},
593 {0x32c8, 0x87},
594 {0x32c9, 0x00},
595 {0x3330, 0x03},
596 {0x3331, 0xc8},
597 {0x3332, 0x02},
598 {0x3333, 0x24},
599 {0x3334, 0x00},
600 {0x3335, 0x00},
601 {0x3336, 0x00},
602 {0x3337, 0x00},
603 {0x3338, 0x03},
604 {0x3339, 0xc8},
605 {0x333a, 0x02},
606 {0x333b, 0x24},
607 {0x333c, 0x00},
608 {0x333d, 0x00},
609 {0x333e, 0x00},
610 {0x333f, 0x00},
611 {0x3340, 0x03},
612 {0x3341, 0xc8},
613 {0x3342, 0x02},
614 {0x3343, 0x24},
615 {0x3344, 0x00},
616 {0x3345, 0x00},
617 {0x3346, 0x00},
618 {0x3347, 0x00},
619 {0x3348, 0x40},
620 {0x3349, 0x00},
621 {0x334a, 0x00},
622 {0x334b, 0x00},
623 {0x334c, 0x00},
624 {0x334d, 0x00},
625 {0x334e, 0x80},
626 {0x3360, 0x01},
627 {0x3361, 0x00},
628 {0x3362, 0x01},
629 {0x3363, 0x00},
630 {0x3364, 0x01},
631 {0x3365, 0x00},
632 {0x3366, 0x01},
633 {0x3367, 0x00},
634 {0x3368, 0x01},
635 {0x3369, 0x00},
636 {0x336a, 0x01},
637 {0x336b, 0x00},
638 {0x336c, 0x01},
639 {0x336d, 0x00},
640 {0x336e, 0x01},
641 {0x336f, 0x00},
642 {0x3370, 0x01},
643 {0x3371, 0x00},
644 {0x3372, 0x01},
645 {0x3373, 0x00},
646 {0x3374, 0x01},
647 {0x3375, 0x00},
648 {0x3376, 0x01},
649 {0x3377, 0x00},
650 {0x3378, 0x00},
651 {0x3379, 0x00},
652 {0x337a, 0x00},
653 {0x337b, 0x00},
654 {0x337c, 0x00},
655 {0x337d, 0x00},
656 {0x337e, 0x00},
657 {0x337f, 0x00},
658 {0x3380, 0x00},
659 {0x3381, 0x00},
660 {0x3382, 0x00},
661 {0x3383, 0x00},
662 {0x3384, 0x00},
663 {0x3385, 0x00},
664 {0x3386, 0x00},
665 {0x3387, 0x00},
666 {0x3388, 0x00},
667 {0x3389, 0x00},
668 {0x338a, 0x00},
669 {0x338b, 0x00},
670 {0x338c, 0x00},
671 {0x338d, 0x00},
672 {0x338e, 0x00},
673 {0x338f, 0x00},
674 {0x3390, 0x00},
675 {0x3391, 0x00},
676 {0x3392, 0x00},
677 {0x3393, 0x00},
678 {0x3394, 0x00},
679 {0x3395, 0x00},
680 {0x3396, 0x00},
681 {0x3397, 0x00},
682 {0x3398, 0x00},
683 {0x3399, 0x00},
684 {0x339a, 0x00},
685 {0x339b, 0x00},
686 {0x33b0, 0x00},
687 {0x33b1, 0x50},
688 {0x33b2, 0x01},
689 {0x33b3, 0xff},
690 {0x33b4, 0xe0},
691 {0x33b5, 0x6b},
692 {0x33b6, 0x00},
693 {0x33b7, 0x00},
694 {0x33b8, 0x00},
695 {0x33b9, 0x00},
696 {0x33ba, 0x00},
697 {0x33bb, 0x1f},
698 {0x33bc, 0x01},
699 {0x33bd, 0x01},
700 {0x33be, 0x01},
701 {0x33bf, 0x01},
702 {0x33c0, 0x00},
703 {0x33c1, 0x00},
704 {0x33c2, 0x00},
705 {0x33c3, 0x00},
706 {0x33e0, 0x14},
707 {0x33e1, 0x0f},
708 {0x33e2, 0x02},
709 {0x33e3, 0x01},
710 {0x33e4, 0x01},
711 {0x33e5, 0x01},
712 {0x33e6, 0x00},
713 {0x33e7, 0x04},
714 {0x33e8, 0x0c},
715 {0x33e9, 0x02},
716 {0x33ea, 0x02},
717 {0x33eb, 0x02},
718 {0x33ec, 0x03},
719 {0x33ed, 0x01},
720 {0x33ee, 0x02},
721 {0x33ef, 0x08},
722 {0x33f0, 0x08},
723 {0x33f1, 0x04},
724 {0x33f2, 0x04},
725 {0x33f3, 0x00},
726 {0x33f4, 0x03},
727 {0x33f5, 0x14},
728 {0x33f6, 0x0f},
729 {0x33f7, 0x02},
730 {0x33f8, 0x01},
731 {0x33f9, 0x01},
732 {0x33fa, 0x01},
733 {0x33fb, 0x00},
734 {0x33fc, 0x04},
735 {0x33fd, 0x0c},
736 {0x33fe, 0x02},
737 {0x33ff, 0x02},
738 {0x3400, 0x02},
739 {0x3401, 0x03},
740 {0x3402, 0x01},
741 {0x3403, 0x02},
742 {0x3404, 0x08},
743 {0x3405, 0x08},
744 {0x3406, 0x04},
745 {0x3407, 0x04},
746 {0x3408, 0x00},
747 {0x3409, 0x03},
748 {0x340a, 0x14},
749 {0x340b, 0x0f},
750 {0x340c, 0x04},
751 {0x340d, 0x02},
752 {0x340e, 0x01},
753 {0x340f, 0x01},
754 {0x3410, 0x00},
755 {0x3411, 0x04},
756 {0x3412, 0x0c},
757 {0x3413, 0x00},
758 {0x3414, 0x01},
759 {0x3415, 0x02},
760 {0x3416, 0x03},
761 {0x3417, 0x02},
762 {0x3418, 0x05},
763 {0x3419, 0x0a},
764 {0x341a, 0x08},
765 {0x341b, 0x04},
766 {0x341c, 0x04},
767 {0x341d, 0x00},
768 {0x341e, 0x03},
769 {0x3440, 0x00},
770 {0x3441, 0x00},
771 {0x3442, 0x00},
772 {0x3443, 0x00},
773 {0x3444, 0x02},
774 {0x3445, 0xf0},
775 {0x3446, 0x02},
776 {0x3447, 0x08},
777 {0x3448, 0x00},
778 {0x3460, 0x40},
779 {0x3461, 0x40},
780 {0x3462, 0x40},
781 {0x3463, 0x40},
782 {0x3464, 0x03},
783 {0x3465, 0x01},
784 {0x3466, 0x01},
785 {0x3467, 0x02},
786 {0x3468, 0x30},
787 {0x3469, 0x00},
788 {0x346a, 0x33},
789 {0x346b, 0xbf},
790 {0x3480, 0x40},
791 {0x3481, 0x00},
792 {0x3482, 0x00},
793 {0x3483, 0x00},
794 {0x3484, 0x0d},
795 {0x3485, 0x00},
796 {0x3486, 0x00},
797 {0x3487, 0x00},
798 {0x3488, 0x00},
799 {0x3489, 0x00},
800 {0x348a, 0x00},
801 {0x348b, 0x04},
802 {0x348c, 0x00},
803 {0x348d, 0x01},
804 {0x348f, 0x01},
805 {0x3030, 0x0a},
806 {0x3030, 0x02},
807 {0x7000, 0x58},
808 {0x7001, 0x7a},
809 {0x7002, 0x1a},
810 {0x7003, 0xc1},
811 {0x7004, 0x03},
812 {0x7005, 0xda},
813 {0x7006, 0xbd},
814 {0x7007, 0x03},
815 {0x7008, 0xbd},
816 {0x7009, 0x06},
817 {0x700a, 0xe6},
818 {0x700b, 0xec},
819 {0x700c, 0xbc},
820 {0x700d, 0xff},
821 {0x700e, 0xbc},
822 {0x700f, 0x73},
823 {0x7010, 0xda},
824 {0x7011, 0x72},
825 {0x7012, 0x76},
826 {0x7013, 0xb6},
827 {0x7014, 0xee},
828 {0x7015, 0xcf},
829 {0x7016, 0xac},
830 {0x7017, 0xd0},
831 {0x7018, 0xac},
832 {0x7019, 0xd1},
833 {0x701a, 0x50},
834 {0x701b, 0xac},
835 {0x701c, 0xd2},
836 {0x701d, 0xbc},
837 {0x701e, 0x2e},
838 {0x701f, 0xb4},
839 {0x7020, 0x00},
840 {0x7021, 0xdc},
841 {0x7022, 0xdf},
842 {0x7023, 0xb0},
843 {0x7024, 0x6e},
844 {0x7025, 0xbd},
845 {0x7026, 0x01},
846 {0x7027, 0xd7},
847 {0x7028, 0xed},
848 {0x7029, 0xe1},
849 {0x702a, 0x36},
850 {0x702b, 0x30},
851 {0x702c, 0xd3},
852 {0x702d, 0x2e},
853 {0x702e, 0x54},
854 {0x702f, 0x46},
855 {0x7030, 0xbc},
856 {0x7031, 0x22},
857 {0x7032, 0x66},
858 {0x7033, 0xbc},
859 {0x7034, 0x24},
860 {0x7035, 0x2c},
861 {0x7036, 0x28},
862 {0x7037, 0xbc},
863 {0x7038, 0x3c},
864 {0x7039, 0xa1},
865 {0x703a, 0xac},
866 {0x703b, 0xd8},
867 {0x703c, 0xd6},
868 {0x703d, 0xb4},
869 {0x703e, 0x04},
870 {0x703f, 0x46},
871 {0x7040, 0xb7},
872 {0x7041, 0x04},
873 {0x7042, 0xbe},
874 {0x7043, 0x08},
875 {0x7044, 0xc3},
876 {0x7045, 0xd9},
877 {0x7046, 0xad},
878 {0x7047, 0xc3},
879 {0x7048, 0xbc},
880 {0x7049, 0x19},
881 {0x704a, 0xc1},
882 {0x704b, 0x27},
883 {0x704c, 0xe7},
884 {0x704d, 0x00},
885 {0x704e, 0x50},
886 {0x704f, 0x20},
887 {0x7050, 0xb8},
888 {0x7051, 0x02},
889 {0x7052, 0xbc},
890 {0x7053, 0x17},
891 {0x7054, 0xdb},
892 {0x7055, 0xc7},
893 {0x7056, 0xb8},
894 {0x7057, 0x00},
895 {0x7058, 0x28},
896 {0x7059, 0x54},
897 {0x705a, 0xb4},
898 {0x705b, 0x14},
899 {0x705c, 0xab},
900 {0x705d, 0xbe},
901 {0x705e, 0x06},
902 {0x705f, 0xd8},
903 {0x7060, 0xd6},
904 {0x7061, 0x00},
905 {0x7062, 0xb4},
906 {0x7063, 0xc7},
907 {0x7064, 0x07},
908 {0x7065, 0xb9},
909 {0x7066, 0x05},
910 {0x7067, 0xee},
911 {0x7068, 0xe6},
912 {0x7069, 0xad},
913 {0x706a, 0xb4},
914 {0x706b, 0x26},
915 {0x706c, 0x19},
916 {0x706d, 0xc1},
917 {0x706e, 0x3a},
918 {0x706f, 0xc3},
919 {0x7070, 0xaf},
920 {0x7071, 0x00},
921 {0x7072, 0xc0},
922 {0x7073, 0x3c},
923 {0x7074, 0xc3},
924 {0x7075, 0xbe},
925 {0x7076, 0xe7},
926 {0x7077, 0x00},
927 {0x7078, 0x15},
928 {0x7079, 0xc2},
929 {0x707a, 0x40},
930 {0x707b, 0xc3},
931 {0x707c, 0xa4},
932 {0x707d, 0xc0},
933 {0x707e, 0x3c},
934 {0x707f, 0x00},
935 {0x7080, 0xb9},
936 {0x7081, 0x64},
937 {0x7082, 0x29},
938 {0x7083, 0x00},
939 {0x7084, 0xb8},
940 {0x7085, 0x12},
941 {0x7086, 0xbe},
942 {0x7087, 0x01},
943 {0x7088, 0xd0},
944 {0x7089, 0xbc},
945 {0x708a, 0x01},
946 {0x708b, 0xac},
947 {0x708c, 0x37},
948 {0x708d, 0xd2},
949 {0x708e, 0xac},
950 {0x708f, 0x45},
951 {0x7090, 0xad},
952 {0x7091, 0x28},
953 {0x7092, 0x00},
954 {0x7093, 0xb8},
955 {0x7094, 0x00},
956 {0x7095, 0xbc},
957 {0x7096, 0x01},
958 {0x7097, 0x36},
959 {0x7098, 0xd3},
960 {0x7099, 0x30},
961 {0x709a, 0x04},
962 {0x709b, 0xe0},
963 {0x709c, 0xd8},
964 {0x709d, 0xb4},
965 {0x709e, 0xe9},
966 {0x709f, 0x00},
967 {0x70a0, 0xbe},
968 {0x70a1, 0x05},
969 {0x70a2, 0x62},
970 {0x70a3, 0x07},
971 {0x70a4, 0xb9},
972 {0x70a5, 0x05},
973 {0x70a6, 0xad},
974 {0x70a7, 0xc3},
975 {0x70a8, 0xcf},
976 {0x70a9, 0x00},
977 {0x70aa, 0x15},
978 {0x70ab, 0xc2},
979 {0x70ac, 0x59},
980 {0x70ad, 0xc3},
981 {0x70ae, 0xc9},
982 {0x70af, 0xc0},
983 {0x70b0, 0x55},
984 {0x70b1, 0x00},
985 {0x70b2, 0x46},
986 {0x70b3, 0xa1},
987 {0x70b4, 0xb9},
988 {0x70b5, 0x64},
989 {0x70b6, 0x29},
990 {0x70b7, 0x00},
991 {0x70b8, 0xb8},
992 {0x70b9, 0x02},
993 {0x70ba, 0xbe},
994 {0x70bb, 0x02},
995 {0x70bc, 0xd0},
996 {0x70bd, 0xdc},
997 {0x70be, 0xac},
998 {0x70bf, 0xbc},
999 {0x70c0, 0x01},
1000 {0x70c1, 0x37},
1001 {0x70c2, 0xac},
1002 {0x70c3, 0xd2},
1003 {0x70c4, 0x45},
1004 {0x70c5, 0xad},
1005 {0x70c6, 0x28},
1006 {0x70c7, 0x00},
1007 {0x70c8, 0xb8},
1008 {0x70c9, 0x00},
1009 {0x70ca, 0xbc},
1010 {0x70cb, 0x01},
1011 {0x70cc, 0x36},
1012 {0x70cd, 0x30},
1013 {0x70ce, 0xe0},
1014 {0x70cf, 0xd8},
1015 {0x70d0, 0xb5},
1016 {0x70d1, 0x0b},
1017 {0x70d2, 0xd6},
1018 {0x70d3, 0xbe},
1019 {0x70d4, 0x07},
1020 {0x70d5, 0x00},
1021 {0x70d6, 0x62},
1022 {0x70d7, 0x07},
1023 {0x70d8, 0xb9},
1024 {0x70d9, 0x05},
1025 {0x70da, 0xad},
1026 {0x70db, 0xc3},
1027 {0x70dc, 0xcf},
1028 {0x70dd, 0x46},
1029 {0x70de, 0xcd},
1030 {0x70df, 0x07},
1031 {0x70e0, 0xcd},
1032 {0x70e1, 0x00},
1033 {0x70e2, 0xe3},
1034 {0x70e3, 0x18},
1035 {0x70e4, 0xc2},
1036 {0x70e5, 0xa2},
1037 {0x70e6, 0xb9},
1038 {0x70e7, 0x64},
1039 {0x70e8, 0xd1},
1040 {0x70e9, 0xdd},
1041 {0x70ea, 0xac},
1042 {0x70eb, 0xcf},
1043 {0x70ec, 0xdf},
1044 {0x70ed, 0xb5},
1045 {0x70ee, 0x19},
1046 {0x70ef, 0x46},
1047 {0x70f0, 0x50},
1048 {0x70f1, 0xb6},
1049 {0x70f2, 0xee},
1050 {0x70f3, 0xe8},
1051 {0x70f4, 0xe6},
1052 {0x70f5, 0xbc},
1053 {0x70f6, 0x31},
1054 {0x70f7, 0xe1},
1055 {0x70f8, 0x36},
1056 {0x70f9, 0x30},
1057 {0x70fa, 0xd3},
1058 {0x70fb, 0x2e},
1059 {0x70fc, 0x54},
1060 {0x70fd, 0xbd},
1061 {0x70fe, 0x03},
1062 {0x70ff, 0xec},
1063 {0x7100, 0x2c},
1064 {0x7101, 0x50},
1065 {0x7102, 0x20},
1066 {0x7103, 0x04},
1067 {0x7104, 0xb8},
1068 {0x7105, 0x02},
1069 {0x7106, 0xbc},
1070 {0x7107, 0x18},
1071 {0x7108, 0xc7},
1072 {0x7109, 0xb8},
1073 {0x710a, 0x00},
1074 {0x710b, 0x28},
1075 {0x710c, 0x54},
1076 {0x710d, 0xbc},
1077 {0x710e, 0x02},
1078 {0x710f, 0xb4},
1079 {0x7110, 0xda},
1080 {0x7111, 0xbe},
1081 {0x7112, 0x04},
1082 {0x7113, 0xd6},
1083 {0x7114, 0xd8},
1084 {0x7115, 0xab},
1085 {0x7116, 0x00},
1086 {0x7117, 0x62},
1087 {0x7118, 0x07},
1088 {0x7119, 0xb9},
1089 {0x711a, 0x05},
1090 {0x711b, 0xad},
1091 {0x711c, 0xc3},
1092 {0x711d, 0xbc},
1093 {0x711e, 0xe7},
1094 {0x711f, 0xb9},
1095 {0x7120, 0x64},
1096 {0x7121, 0x29},
1097 {0x7122, 0x00},
1098 {0x7123, 0xb8},
1099 {0x7124, 0x02},
1100 {0x7125, 0xbe},
1101 {0x7126, 0x00},
1102 {0x7127, 0x45},
1103 {0x7128, 0xad},
1104 {0x7129, 0xe2},
1105 {0x712a, 0x28},
1106 {0x712b, 0x00},
1107 {0x712c, 0xb8},
1108 {0x712d, 0x00},
1109 {0x712e, 0xe0},
1110 {0x712f, 0xd8},
1111 {0x7130, 0xb4},
1112 {0x7131, 0xe9},
1113 {0x7132, 0xbe},
1114 {0x7133, 0x03},
1115 {0x7134, 0x00},
1116 {0x7135, 0x30},
1117 {0x7136, 0x62},
1118 {0x7137, 0x07},
1119 {0x7138, 0xb9},
1120 {0x7139, 0x05},
1121 {0x713a, 0xad},
1122 {0x713b, 0xc3},
1123 {0x713c, 0xcf},
1124 {0x713d, 0x42},
1125 {0x713e, 0xe4},
1126 {0x713f, 0xcd},
1127 {0x7140, 0x07},
1128 {0x7141, 0xcd},
1129 {0x7142, 0x00},
1130 {0x7143, 0x00},
1131 {0x7144, 0x17},
1132 {0x7145, 0xc2},
1133 {0x7146, 0xbb},
1134 {0x7147, 0xde},
1135 {0x7148, 0xcf},
1136 {0x7149, 0xdf},
1137 {0x714a, 0xac},
1138 {0x714b, 0xd1},
1139 {0x714c, 0x44},
1140 {0x714d, 0xac},
1141 {0x714e, 0xb9},
1142 {0x714f, 0x76},
1143 {0x7150, 0xb8},
1144 {0x7151, 0x08},
1145 {0x7152, 0xb6},
1146 {0x7153, 0xfe},
1147 {0x7154, 0xb4},
1148 {0x7155, 0xca},
1149 {0x7156, 0xd6},
1150 {0x7157, 0xd8},
1151 {0x7158, 0xab},
1152 {0x7159, 0x00},
1153 {0x715a, 0xe1},
1154 {0x715b, 0x36},
1155 {0x715c, 0x30},
1156 {0x715d, 0xd3},
1157 {0x715e, 0xbc},
1158 {0x715f, 0x29},
1159 {0x7160, 0xb4},
1160 {0x7161, 0x1f},
1161 {0x7162, 0xaa},
1162 {0x7163, 0xbd},
1163 {0x7164, 0x01},
1164 {0x7165, 0xb8},
1165 {0x7166, 0x0c},
1166 {0x7167, 0x45},
1167 {0x7168, 0xa4},
1168 {0x7169, 0xbd},
1169 {0x716a, 0x03},
1170 {0x716b, 0xec},
1171 {0x716c, 0xbc},
1172 {0x716d, 0x3d},
1173 {0x716e, 0xc3},
1174 {0x716f, 0xcf},
1175 {0x7170, 0x42},
1176 {0x7171, 0xb8},
1177 {0x7172, 0x00},
1178 {0x7173, 0xe4},
1179 {0x7174, 0xd5},
1180 {0x7175, 0x00},
1181 {0x7176, 0xb6},
1182 {0x7177, 0x00},
1183 {0x7178, 0x74},
1184 {0x7179, 0xbd},
1185 {0x717a, 0x03},
1186 {0x717b, 0x40},
1187 {0x717c, 0xb5},
1188 {0x717d, 0x39},
1189 {0x717e, 0x58},
1190 {0x717f, 0xdd},
1191 {0x7180, 0x19},
1192 {0x7181, 0xc1},
1193 {0x7182, 0xc8},
1194 {0x7183, 0xbd},
1195 {0x7184, 0x06},
1196 {0x7185, 0x17},
1197 {0x7186, 0xc1},
1198 {0x7187, 0xc6},
1199 {0x7188, 0xe8},
1200 {0x7189, 0x00},
1201 {0x718a, 0xc0},
1202 {0x718b, 0xc8},
1203 {0x718c, 0xe6},
1204 {0x718d, 0x95},
1205 {0x718e, 0x15},
1206 {0x718f, 0x00},
1207 {0x7190, 0xbc},
1208 {0x7191, 0x19},
1209 {0x7192, 0xb9},
1210 {0x7193, 0xf6},
1211 {0x7194, 0x14},
1212 {0x7195, 0xc1},
1213 {0x7196, 0xd0},
1214 {0x7197, 0xd1},
1215 {0x7198, 0xac},
1216 {0x7199, 0x37},
1217 {0x719a, 0xbc},
1218 {0x719b, 0x35},
1219 {0x719c, 0x36},
1220 {0x719d, 0x30},
1221 {0x719e, 0xe1},
1222 {0x719f, 0xd3},
1223 {0x71a0, 0x7a},
1224 {0x71a1, 0xb6},
1225 {0x71a2, 0x0c},
1226 {0x71a3, 0xff},
1227 {0x71a4, 0xb4},
1228 {0x71a5, 0xc7},
1229 {0x71a6, 0xd9},
1230 {0x71a7, 0x00},
1231 {0x71a8, 0xbd},
1232 {0x71a9, 0x01},
1233 {0x71aa, 0x56},
1234 {0x71ab, 0xc0},
1235 {0x71ac, 0xda},
1236 {0x71ad, 0xb4},
1237 {0x71ae, 0x1f},
1238 {0x71af, 0x56},
1239 {0x71b0, 0xaa},
1240 {0x71b1, 0xbc},
1241 {0x71b2, 0x08},
1242 {0x71b3, 0x00},
1243 {0x71b4, 0x57},
1244 {0x71b5, 0xe8},
1245 {0x71b6, 0xb5},
1246 {0x71b7, 0x36},
1247 {0x71b8, 0x00},
1248 {0x71b9, 0x54},
1249 {0x71ba, 0xe7},
1250 {0x71bb, 0xc8},
1251 {0x71bc, 0xb4},
1252 {0x71bd, 0x1f},
1253 {0x71be, 0x56},
1254 {0x71bf, 0xaa},
1255 {0x71c0, 0xbc},
1256 {0x71c1, 0x08},
1257 {0x71c2, 0x57},
1258 {0x71c3, 0x00},
1259 {0x71c4, 0xb5},
1260 {0x71c5, 0x36},
1261 {0x71c6, 0x00},
1262 {0x71c7, 0x54},
1263 {0x71c8, 0xc8},
1264 {0x71c9, 0xb5},
1265 {0x71ca, 0x18},
1266 {0x71cb, 0xd9},
1267 {0x71cc, 0x00},
1268 {0x71cd, 0xbd},
1269 {0x71ce, 0x01},
1270 {0x71cf, 0x56},
1271 {0x71d0, 0x08},
1272 {0x71d1, 0x57},
1273 {0x71d2, 0xe8},
1274 {0x71d3, 0xb4},
1275 {0x71d4, 0x42},
1276 {0x71d5, 0x00},
1277 {0x71d6, 0x54},
1278 {0x71d7, 0xe7},
1279 {0x71d8, 0xc8},
1280 {0x71d9, 0xab},
1281 {0x71da, 0x00},
1282 {0x71db, 0x66},
1283 {0x71dc, 0x62},
1284 {0x71dd, 0x06},
1285 {0x71de, 0x74},
1286 {0x71df, 0xb9},
1287 {0x71e0, 0x05},
1288 {0x71e1, 0xb7},
1289 {0x71e2, 0x14},
1290 {0x71e3, 0x0e},
1291 {0x71e4, 0xb7},
1292 {0x71e5, 0x04},
1293 {0x71e6, 0xc8},
1294 {0x7600, 0x04},
1295 {0x7601, 0x80},
1296 {0x7602, 0x07},
1297 {0x7603, 0x44},
1298 {0x7604, 0x05},
1299 {0x7605, 0x33},
1300 {0x7606, 0x0f},
1301 {0x7607, 0x00},
1302 {0x7608, 0x07},
1303 {0x7609, 0x40},
1304 {0x760a, 0x04},
1305 {0x760b, 0xe5},
1306 {0x760c, 0x06},
1307 {0x760d, 0x50},
1308 {0x760e, 0x04},
1309 {0x760f, 0xe4},
1310 {0x7610, 0x00},
1311 {0x7611, 0x00},
1312 {0x7612, 0x06},
1313 {0x7613, 0x5c},
1314 {0x7614, 0x00},
1315 {0x7615, 0x0f},
1316 {0x7616, 0x06},
1317 {0x7617, 0x1c},
1318 {0x7618, 0x00},
1319 {0x7619, 0x02},
1320 {0x761a, 0x06},
1321 {0x761b, 0xa2},
1322 {0x761c, 0x00},
1323 {0x761d, 0x01},
1324 {0x761e, 0x06},
1325 {0x761f, 0xae},
1326 {0x7620, 0x00},
1327 {0x7621, 0x0e},
1328 {0x7622, 0x05},
1329 {0x7623, 0x30},
1330 {0x7624, 0x07},
1331 {0x7625, 0x00},
1332 {0x7626, 0x0f},
1333 {0x7627, 0x00},
1334 {0x7628, 0x04},
1335 {0x7629, 0xe5},
1336 {0x762a, 0x05},
1337 {0x762b, 0x33},
1338 {0x762c, 0x06},
1339 {0x762d, 0x12},
1340 {0x762e, 0x00},
1341 {0x762f, 0x01},
1342 {0x7630, 0x06},
1343 {0x7631, 0x52},
1344 {0x7632, 0x00},
1345 {0x7633, 0x01},
1346 {0x7634, 0x06},
1347 {0x7635, 0x5e},
1348 {0x7636, 0x04},
1349 {0x7637, 0xe4},
1350 {0x7638, 0x00},
1351 {0x7639, 0x01},
1352 {0x763a, 0x05},
1353 {0x763b, 0x30},
1354 {0x763c, 0x0f},
1355 {0x763d, 0x00},
1356 {0x763e, 0x06},
1357 {0x763f, 0xa6},
1358 {0x7640, 0x00},
1359 {0x7641, 0x02},
1360 {0x7642, 0x06},
1361 {0x7643, 0x26},
1362 {0x7644, 0x00},
1363 {0x7645, 0x02},
1364 {0x7646, 0x05},
1365 {0x7647, 0x33},
1366 {0x7648, 0x06},
1367 {0x7649, 0x20},
1368 {0x764a, 0x0f},
1369 {0x764b, 0x00},
1370 {0x764c, 0x06},
1371 {0x764d, 0x56},
1372 {0x764e, 0x00},
1373 {0x764f, 0x02},
1374 {0x7650, 0x06},
1375 {0x7651, 0x16},
1376 {0x7652, 0x05},
1377 {0x7653, 0x33},
1378 {0x7654, 0x06},
1379 {0x7655, 0x10},
1380 {0x7656, 0x0f},
1381 {0x7657, 0x00},
1382 {0x7658, 0x06},
1383 {0x7659, 0x10},
1384 {0x765a, 0x0f},
1385 {0x765b, 0x00},
1386 {0x765c, 0x06},
1387 {0x765d, 0x20},
1388 {0x765e, 0x0f},
1389 {0x765f, 0x00},
1390 {0x7660, 0x00},
1391 {0x7661, 0x00},
1392 {0x7662, 0x00},
1393 {0x7663, 0x02},
1394 {0x7664, 0x04},
1395 {0x7665, 0xe5},
1396 {0x7666, 0x04},
1397 {0x7667, 0xe4},
1398 {0x7668, 0x0f},
1399 {0x7669, 0x00},
1400 {0x766a, 0x00},
1401 {0x766b, 0x00},
1402 {0x766c, 0x00},
1403 {0x766d, 0x01},
1404 {0x766e, 0x04},
1405 {0x766f, 0xe5},
1406 {0x7670, 0x04},
1407 {0x7671, 0xe4},
1408 {0x7672, 0x0f},
1409 {0x7673, 0x00},
1410 {0x7674, 0x00},
1411 {0x7675, 0x02},
1412 {0x7676, 0x04},
1413 {0x7677, 0xe4},
1414 {0x7678, 0x00},
1415 {0x7679, 0x02},
1416 {0x767a, 0x04},
1417 {0x767b, 0xc4},
1418 {0x767c, 0x00},
1419 {0x767d, 0x02},
1420 {0x767e, 0x04},
1421 {0x767f, 0xc4},
1422 {0x7680, 0x05},
1423 {0x7681, 0x83},
1424 {0x7682, 0x0f},
1425 {0x7683, 0x00},
1426 {0x7684, 0x00},
1427 {0x7685, 0x02},
1428 {0x7686, 0x04},
1429 {0x7687, 0xe4},
1430 {0x7688, 0x00},
1431 {0x7689, 0x02},
1432 {0x768a, 0x04},
1433 {0x768b, 0xc4},
1434 {0x768c, 0x00},
1435 {0x768d, 0x02},
1436 {0x768e, 0x04},
1437 {0x768f, 0xc4},
1438 {0x7690, 0x05},
1439 {0x7691, 0x83},
1440 {0x7692, 0x03},
1441 {0x7693, 0x0b},
1442 {0x7694, 0x05},
1443 {0x7695, 0x83},
1444 {0x7696, 0x00},
1445 {0x7697, 0x07},
1446 {0x7698, 0x05},
1447 {0x7699, 0x03},
1448 {0x769a, 0x00},
1449 {0x769b, 0x05},
1450 {0x769c, 0x05},
1451 {0x769d, 0x32},
1452 {0x769e, 0x05},
1453 {0x769f, 0x30},
1454 {0x76a0, 0x00},
1455 {0x76a1, 0x02},
1456 {0x76a2, 0x05},
1457 {0x76a3, 0x78},
1458 {0x76a4, 0x00},
1459 {0x76a5, 0x01},
1460 {0x76a6, 0x05},
1461 {0x76a7, 0x7c},
1462 {0x76a8, 0x03},
1463 {0x76a9, 0x9a},
1464 {0x76aa, 0x05},
1465 {0x76ab, 0x83},
1466 {0x76ac, 0x00},
1467 {0x76ad, 0x04},
1468 {0x76ae, 0x05},
1469 {0x76af, 0x03},
1470 {0x76b0, 0x00},
1471 {0x76b1, 0x03},
1472 {0x76b2, 0x05},
1473 {0x76b3, 0x32},
1474 {0x76b4, 0x05},
1475 {0x76b5, 0x30},
1476 {0x76b6, 0x00},
1477 {0x76b7, 0x02},
1478 {0x76b8, 0x05},
1479 {0x76b9, 0x78},
1480 {0x76ba, 0x00},
1481 {0x76bb, 0x01},
1482 {0x76bc, 0x05},
1483 {0x76bd, 0x7c},
1484 {0x76be, 0x03},
1485 {0x76bf, 0x99},
1486 {0x76c0, 0x05},
1487 {0x76c1, 0x83},
1488 {0x76c2, 0x00},
1489 {0x76c3, 0x03},
1490 {0x76c4, 0x05},
1491 {0x76c5, 0x03},
1492 {0x76c6, 0x00},
1493 {0x76c7, 0x01},
1494 {0x76c8, 0x05},
1495 {0x76c9, 0x32},
1496 {0x76ca, 0x05},
1497 {0x76cb, 0x30},
1498 {0x76cc, 0x00},
1499 {0x76cd, 0x02},
1500 {0x76ce, 0x05},
1501 {0x76cf, 0x78},
1502 {0x76d0, 0x00},
1503 {0x76d1, 0x01},
1504 {0x76d2, 0x05},
1505 {0x76d3, 0x7c},
1506 {0x76d4, 0x03},
1507 {0x76d5, 0x98},
1508 {0x76d6, 0x05},
1509 {0x76d7, 0x83},
1510 {0x76d8, 0x00},
1511 {0x76d9, 0x00},
1512 {0x76da, 0x05},
1513 {0x76db, 0x03},
1514 {0x76dc, 0x00},
1515 {0x76dd, 0x01},
1516 {0x76de, 0x05},
1517 {0x76df, 0x32},
1518 {0x76e0, 0x05},
1519 {0x76e1, 0x30},
1520 {0x76e2, 0x00},
1521 {0x76e3, 0x02},
1522 {0x76e4, 0x05},
1523 {0x76e5, 0x78},
1524 {0x76e6, 0x00},
1525 {0x76e7, 0x01},
1526 {0x76e8, 0x05},
1527 {0x76e9, 0x7c},
1528 {0x76ea, 0x03},
1529 {0x76eb, 0x97},
1530 {0x76ec, 0x05},
1531 {0x76ed, 0x83},
1532 {0x76ee, 0x00},
1533 {0x76ef, 0x00},
1534 {0x76f0, 0x05},
1535 {0x76f1, 0x03},
1536 {0x76f2, 0x05},
1537 {0x76f3, 0x32},
1538 {0x76f4, 0x05},
1539 {0x76f5, 0x30},
1540 {0x76f6, 0x00},
1541 {0x76f7, 0x02},
1542 {0x76f8, 0x05},
1543 {0x76f9, 0x78},
1544 {0x76fa, 0x00},
1545 {0x76fb, 0x01},
1546 {0x76fc, 0x05},
1547 {0x76fd, 0x7c},
1548 {0x76fe, 0x03},
1549 {0x76ff, 0x96},
1550 {0x7700, 0x05},
1551 {0x7701, 0x83},
1552 {0x7702, 0x05},
1553 {0x7703, 0x03},
1554 {0x7704, 0x05},
1555 {0x7705, 0x32},
1556 {0x7706, 0x05},
1557 {0x7707, 0x30},
1558 {0x7708, 0x00},
1559 {0x7709, 0x02},
1560 {0x770a, 0x05},
1561 {0x770b, 0x78},
1562 {0x770c, 0x00},
1563 {0x770d, 0x01},
1564 {0x770e, 0x05},
1565 {0x770f, 0x7c},
1566 {0x7710, 0x03},
1567 {0x7711, 0x95},
1568 {0x7712, 0x05},
1569 {0x7713, 0x83},
1570 {0x7714, 0x05},
1571 {0x7715, 0x03},
1572 {0x7716, 0x05},
1573 {0x7717, 0x32},
1574 {0x7718, 0x05},
1575 {0x7719, 0x30},
1576 {0x771a, 0x00},
1577 {0x771b, 0x02},
1578 {0x771c, 0x05},
1579 {0x771d, 0x78},
1580 {0x771e, 0x00},
1581 {0x771f, 0x01},
1582 {0x7720, 0x05},
1583 {0x7721, 0x7c},
1584 {0x7722, 0x03},
1585 {0x7723, 0x94},
1586 {0x7724, 0x05},
1587 {0x7725, 0x83},
1588 {0x7726, 0x00},
1589 {0x7727, 0x01},
1590 {0x7728, 0x05},
1591 {0x7729, 0x03},
1592 {0x772a, 0x00},
1593 {0x772b, 0x01},
1594 {0x772c, 0x05},
1595 {0x772d, 0x32},
1596 {0x772e, 0x05},
1597 {0x772f, 0x30},
1598 {0x7730, 0x00},
1599 {0x7731, 0x02},
1600 {0x7732, 0x05},
1601 {0x7733, 0x78},
1602 {0x7734, 0x00},
1603 {0x7735, 0x01},
1604 {0x7736, 0x05},
1605 {0x7737, 0x7c},
1606 {0x7738, 0x03},
1607 {0x7739, 0x93},
1608 {0x773a, 0x05},
1609 {0x773b, 0x83},
1610 {0x773c, 0x00},
1611 {0x773d, 0x00},
1612 {0x773e, 0x05},
1613 {0x773f, 0x03},
1614 {0x7740, 0x00},
1615 {0x7741, 0x00},
1616 {0x7742, 0x05},
1617 {0x7743, 0x32},
1618 {0x7744, 0x05},
1619 {0x7745, 0x30},
1620 {0x7746, 0x00},
1621 {0x7747, 0x02},
1622 {0x7748, 0x05},
1623 {0x7749, 0x78},
1624 {0x774a, 0x00},
1625 {0x774b, 0x01},
1626 {0x774c, 0x05},
1627 {0x774d, 0x7c},
1628 {0x774e, 0x03},
1629 {0x774f, 0x92},
1630 {0x7750, 0x05},
1631 {0x7751, 0x83},
1632 {0x7752, 0x05},
1633 {0x7753, 0x03},
1634 {0x7754, 0x00},
1635 {0x7755, 0x00},
1636 {0x7756, 0x05},
1637 {0x7757, 0x32},
1638 {0x7758, 0x05},
1639 {0x7759, 0x30},
1640 {0x775a, 0x00},
1641 {0x775b, 0x02},
1642 {0x775c, 0x05},
1643 {0x775d, 0x78},
1644 {0x775e, 0x00},
1645 {0x775f, 0x01},
1646 {0x7760, 0x05},
1647 {0x7761, 0x7c},
1648 {0x7762, 0x03},
1649 {0x7763, 0x91},
1650 {0x7764, 0x05},
1651 {0x7765, 0x83},
1652 {0x7766, 0x05},
1653 {0x7767, 0x03},
1654 {0x7768, 0x05},
1655 {0x7769, 0x32},
1656 {0x776a, 0x05},
1657 {0x776b, 0x30},
1658 {0x776c, 0x00},
1659 {0x776d, 0x02},
1660 {0x776e, 0x05},
1661 {0x776f, 0x78},
1662 {0x7770, 0x00},
1663 {0x7771, 0x01},
1664 {0x7772, 0x05},
1665 {0x7773, 0x7c},
1666 {0x7774, 0x03},
1667 {0x7775, 0x90},
1668 {0x7776, 0x05},
1669 {0x7777, 0x83},
1670 {0x7778, 0x05},
1671 {0x7779, 0x03},
1672 {0x777a, 0x05},
1673 {0x777b, 0x32},
1674 {0x777c, 0x05},
1675 {0x777d, 0x30},
1676 {0x777e, 0x00},
1677 {0x777f, 0x02},
1678 {0x7780, 0x05},
1679 {0x7781, 0x78},
1680 {0x7782, 0x00},
1681 {0x7783, 0x01},
1682 {0x7784, 0x05},
1683 {0x7785, 0x7c},
1684 {0x7786, 0x02},
1685 {0x7787, 0x90},
1686 {0x7788, 0x05},
1687 {0x7789, 0x03},
1688 {0x778a, 0x07},
1689 {0x778b, 0x00},
1690 {0x778c, 0x0f},
1691 {0x778d, 0x00},
1692 {0x778e, 0x08},
1693 {0x778f, 0x30},
1694 {0x7790, 0x08},
1695 {0x7791, 0xee},
1696 {0x7792, 0x0f},
1697 {0x7793, 0x00},
1698 {0x7794, 0x05},
1699 {0x7795, 0x33},
1700 {0x7796, 0x04},
1701 {0x7797, 0xe5},
1702 {0x7798, 0x06},
1703 {0x7799, 0x52},
1704 {0x779a, 0x04},
1705 {0x779b, 0xe4},
1706 {0x779c, 0x00},
1707 {0x779d, 0x00},
1708 {0x779e, 0x06},
1709 {0x779f, 0x5e},
1710 {0x77a0, 0x00},
1711 {0x77a1, 0x0f},
1712 {0x77a2, 0x06},
1713 {0x77a3, 0x1e},
1714 {0x77a4, 0x00},
1715 {0x77a5, 0x02},
1716 {0x77a6, 0x06},
1717 {0x77a7, 0xa2},
1718 {0x77a8, 0x00},
1719 {0x77a9, 0x01},
1720 {0x77aa, 0x06},
1721 {0x77ab, 0xae},
1722 {0x77ac, 0x00},
1723 {0x77ad, 0x03},
1724 {0x77ae, 0x05},
1725 {0x77af, 0x30},
1726 {0x77b0, 0x09},
1727 {0x77b1, 0x19},
1728 {0x77b2, 0x0f},
1729 {0x77b3, 0x00},
1730 {0x77b4, 0x05},
1731 {0x77b5, 0x33},
1732 {0x77b6, 0x04},
1733 {0x77b7, 0xe5},
1734 {0x77b8, 0x06},
1735 {0x77b9, 0x52},
1736 {0x77ba, 0x04},
1737 {0x77bb, 0xe4},
1738 {0x77bc, 0x00},
1739 {0x77bd, 0x00},
1740 {0x77be, 0x06},
1741 {0x77bf, 0x5e},
1742 {0x77c0, 0x00},
1743 {0x77c1, 0x0f},
1744 {0x77c2, 0x06},
1745 {0x77c3, 0x1e},
1746 {0x77c4, 0x00},
1747 {0x77c5, 0x02},
1748 {0x77c6, 0x06},
1749 {0x77c7, 0xa2},
1750 {0x77c8, 0x00},
1751 {0x77c9, 0x01},
1752 {0x77ca, 0x06},
1753 {0x77cb, 0xae},
1754 {0x77cc, 0x00},
1755 {0x77cd, 0x03},
1756 {0x77ce, 0x05},
1757 {0x77cf, 0x30},
1758 {0x77d0, 0x0f},
1759 {0x77d1, 0x00},
1760 {0x77d2, 0x00},
1761 {0x77d3, 0x00},
1762 {0x77d4, 0x00},
1763 {0x77d5, 0x02},
1764 {0x77d6, 0x04},
1765 {0x77d7, 0xe5},
1766 {0x77d8, 0x04},
1767 {0x77d9, 0xe4},
1768 {0x77da, 0x05},
1769 {0x77db, 0x33},
1770 {0x77dc, 0x07},
1771 {0x77dd, 0x10},
1772 {0x77de, 0x00},
1773 {0x77df, 0x00},
1774 {0x77e0, 0x01},
1775 {0x77e1, 0xbb},
1776 {0x77e2, 0x00},
1777 {0x77e3, 0x00},
1778 {0x77e4, 0x01},
1779 {0x77e5, 0xaa},
1780 {0x77e6, 0x00},
1781 {0x77e7, 0x00},
1782 {0x77e8, 0x01},
1783 {0x77e9, 0x99},
1784 {0x77ea, 0x00},
1785 {0x77eb, 0x00},
1786 {0x77ec, 0x01},
1787 {0x77ed, 0x88},
1788 {0x77ee, 0x00},
1789 {0x77ef, 0x00},
1790 {0x77f0, 0x01},
1791 {0x77f1, 0x77},
1792 {0x77f2, 0x00},
1793 {0x77f3, 0x00},
1794 {0x77f4, 0x01},
1795 {0x77f5, 0x66},
1796 {0x77f6, 0x00},
1797 {0x77f7, 0x00},
1798 {0x77f8, 0x01},
1799 {0x77f9, 0x55},
1800 {0x77fa, 0x00},
1801 {0x77fb, 0x00},
1802 {0x77fc, 0x01},
1803 {0x77fd, 0x44},
1804 {0x77fe, 0x00},
1805 {0x77ff, 0x00},
1806 {0x7800, 0x01},
1807 {0x7801, 0x33},
1808 {0x7802, 0x00},
1809 {0x7803, 0x00},
1810 {0x7804, 0x01},
1811 {0x7805, 0x22},
1812 {0x7806, 0x00},
1813 {0x7807, 0x00},
1814 {0x7808, 0x01},
1815 {0x7809, 0x11},
1816 {0x780a, 0x00},
1817 {0x780b, 0x00},
1818 {0x780c, 0x01},
1819 {0x780d, 0x00},
1820 {0x780e, 0x01},
1821 {0x780f, 0xff},
1822 {0x7810, 0x07},
1823 {0x7811, 0x00},
1824 {0x7812, 0x02},
1825 {0x7813, 0xa0},
1826 {0x7814, 0x0f},
1827 {0x7815, 0x00},
1828 {0x7816, 0x08},
1829 {0x7817, 0x35},
1830 {0x7818, 0x06},
1831 {0x7819, 0x52},
1832 {0x781a, 0x04},
1833 {0x781b, 0xe4},
1834 {0x781c, 0x00},
1835 {0x781d, 0x00},
1836 {0x781e, 0x06},
1837 {0x781f, 0x5e},
1838 {0x7820, 0x05},
1839 {0x7821, 0x33},
1840 {0x7822, 0x09},
1841 {0x7823, 0x19},
1842 {0x7824, 0x06},
1843 {0x7825, 0x1e},
1844 {0x7826, 0x05},
1845 {0x7827, 0x33},
1846 {0x7828, 0x00},
1847 {0x7829, 0x01},
1848 {0x782a, 0x06},
1849 {0x782b, 0x24},
1850 {0x782c, 0x06},
1851 {0x782d, 0x20},
1852 {0x782e, 0x0f},
1853 {0x782f, 0x00},
1854 {0x7830, 0x08},
1855 {0x7831, 0x35},
1856 {0x7832, 0x07},
1857 {0x7833, 0x10},
1858 {0x7834, 0x00},
1859 {0x7835, 0x00},
1860 {0x7836, 0x01},
1861 {0x7837, 0xbb},
1862 {0x7838, 0x00},
1863 {0x7839, 0x00},
1864 {0x783a, 0x01},
1865 {0x783b, 0xaa},
1866 {0x783c, 0x00},
1867 {0x783d, 0x00},
1868 {0x783e, 0x01},
1869 {0x783f, 0x99},
1870 {0x7840, 0x00},
1871 {0x7841, 0x00},
1872 {0x7842, 0x01},
1873 {0x7843, 0x88},
1874 {0x7844, 0x00},
1875 {0x7845, 0x00},
1876 {0x7846, 0x01},
1877 {0x7847, 0x77},
1878 {0x7848, 0x00},
1879 {0x7849, 0x00},
1880 {0x784a, 0x01},
1881 {0x784b, 0x66},
1882 {0x784c, 0x00},
1883 {0x784d, 0x00},
1884 {0x784e, 0x01},
1885 {0x784f, 0x55},
1886 {0x7850, 0x00},
1887 {0x7851, 0x00},
1888 {0x7852, 0x01},
1889 {0x7853, 0x44},
1890 {0x7854, 0x00},
1891 {0x7855, 0x00},
1892 {0x7856, 0x01},
1893 {0x7857, 0x33},
1894 {0x7858, 0x00},
1895 {0x7859, 0x00},
1896 {0x785a, 0x01},
1897 {0x785b, 0x22},
1898 {0x785c, 0x00},
1899 {0x785d, 0x00},
1900 {0x785e, 0x01},
1901 {0x785f, 0x11},
1902 {0x7860, 0x00},
1903 {0x7861, 0x00},
1904 {0x7862, 0x01},
1905 {0x7863, 0x00},
1906 {0x7864, 0x07},
1907 {0x7865, 0x00},
1908 {0x7866, 0x01},
1909 {0x7867, 0xff},
1910 {0x7868, 0x02},
1911 {0x7869, 0xa0},
1912 {0x786a, 0x0f},
1913 {0x786b, 0x00},
1914 {0x786c, 0x08},
1915 {0x786d, 0x3a},
1916 {0x786e, 0x08},
1917 {0x786f, 0x6a},
1918 {0x7870, 0x0f},
1919 {0x7871, 0x00},
1920 {0x7872, 0x04},
1921 {0x7873, 0xc0},
1922 {0x7874, 0x09},
1923 {0x7875, 0x19},
1924 {0x7876, 0x04},
1925 {0x7877, 0x99},
1926 {0x7878, 0x07},
1927 {0x7879, 0x14},
1928 {0x787a, 0x00},
1929 {0x787b, 0x01},
1930 {0x787c, 0x04},
1931 {0x787d, 0xa4},
1932 {0x787e, 0x00},
1933 {0x787f, 0x0f},
1934 {0x7880, 0x00},
1935 {0x7881, 0x0f},
1936 {0x7882, 0x04},
1937 {0x7883, 0xa6},
1938 {0x7884, 0x00},
1939 {0x7885, 0x00},
1940 {0x7886, 0x04},
1941 {0x7887, 0xa0},
1942 {0x7888, 0x04},
1943 {0x7889, 0x80},
1944 {0x788a, 0x04},
1945 {0x788b, 0x00},
1946 {0x788c, 0x05},
1947 {0x788d, 0x03},
1948 {0x788e, 0x06},
1949 {0x788f, 0x00},
1950 {0x7890, 0x0f},
1951 {0x7891, 0x00},
1952 {0x7892, 0x0f},
1953 {0x7893, 0x00},
1954 {0x7894, 0x0f},
1955 {0x7895, 0x00},
1956 {0x30a0, 0x00},
1957 {0x30a1, 0x04},
1958 {0x30a2, 0x00},
1959 {0x30a3, 0x04},
1960 {0x30a4, 0x07},
1961 {0x30a5, 0x8B},
1962 {0x30a6, 0x04},
1963 {0x30a7, 0x43},
1964 {0x30a8, 0x00},
1965 {0x30a9, 0x04},
1966 {0x30aa, 0x00},
1967 {0x30ab, 0x04},
1968 {0x30ac, 0x07},
1969 {0x30ad, 0x80},
1970 {0x30ae, 0x04},
1971 {0x30af, 0x38},
1972 {0x30b0, 0x0d},
1973 {0x30b1, 0xde},
1974 {0x30b2, 0x04},
1975 {0x30b3, 0x66},
1976 {0x3196, 0x00},
1977 {0x3197, 0x0a},
1978 {0x3195, 0x29},
1979 {0x315a, 0x01},
1980 {0x315b, 0x80},
1981 {0x30bb, 0x01},
1982 {0x3250, 0xf7},
1983 {REG_NULL, 0x00}
1984 };
1985
1986 /* 4 lanes,raw 12bit hdr */
1987 static const struct regval ov2775_hdr12bit_init_tab_1920_1080[] = {
1988 {0x3013, 0x01},
1989 {REG_DELAY, 0x10},
1990 {0x3000, 0x02},
1991 {0x3001, 0x28},
1992 {0x3002, 0x03},
1993 {0x3003, 0x01},
1994 {0x3004, 0x02},
1995 {0x3005, 0x26},
1996 {0x3006, 0x00},
1997 {0x3007, 0x07},
1998 {0x3008, 0x01},
1999 {0x3009, 0x00},
2000 {0x300c, 0x6c},
2001 {0x300e, 0x80},
2002 {0x300f, 0x00},
2003 {0x3012, 0x00},
2004 {0x3013, 0x00},
2005 {0x3014, 0xc4},
2006 {0x3015, 0x00},
2007 {0x3017, 0x00},
2008 {0x3018, 0x00},
2009 {0x3019, 0x00},
2010 {0x301a, 0x00},
2011 {0x301b, 0x01},
2012 {0x301e, 0x17},
2013 {0x301f, 0xe1},
2014 {0x3030, 0x02},
2015 {0x3031, 0x72},
2016 {0x3032, 0xf0},
2017 {0x3033, 0x30},
2018 {0x3034, 0x3f},
2019 {0x3035, 0x5f},
2020 {0x3036, 0x02},
2021 {0x3037, 0x9f},
2022 {0x3038, 0x04},
2023 {0x3039, 0xb7},
2024 {0x303a, 0x04},
2025 {0x303b, 0x07},
2026 {0x303c, 0xf0},
2027 {0x303d, 0x00},
2028 {0x303e, 0x0b},
2029 {0x303f, 0xe3},
2030 {0x3040, 0xf3},
2031 {0x3041, 0x29},
2032 {0x3042, 0xf6},
2033 {0x3043, 0x65},
2034 {0x3044, 0x06},
2035 {0x3045, 0x0f},
2036 {0x3046, 0x59},
2037 {0x3047, 0x07},
2038 {0x3048, 0x82},
2039 {0x3049, 0xcf},
2040 {0x304a, 0x12},
2041 {0x304b, 0x40},
2042 {0x304c, 0x33},
2043 {0x304d, 0xa4},
2044 {0x304e, 0x0b},
2045 {0x304f, 0x3d},
2046 {0x3050, 0x10},
2047 {0x3060, 0x00},
2048 {0x3061, 0x64},
2049 {0x3062, 0x00},
2050 {0x3063, 0xe4},
2051 {0x3066, 0x80},
2052 {0x3080, 0x00},
2053 {0x3081, 0x00},
2054 {0x3082, 0x01},
2055 {0x3083, 0xe3},
2056 {0x3084, 0x06},
2057 {0x3085, 0x00},
2058 {0x3086, 0x10},
2059 {0x3087, 0x10},
2060 {0x3089, 0x00},
2061 {0x308a, 0x01},
2062 {0x3093, 0x00},
2063 {0x30a0, 0x00},
2064 {0x30a1, 0x00},
2065 {0x30a2, 0x00},
2066 {0x30a3, 0x00},
2067 {0x30a4, 0x07},
2068 {0x30a5, 0x8f},
2069 {0x30a6, 0x04},
2070 {0x30a7, 0x47},
2071 {0x30a8, 0x00},
2072 {0x30a9, 0x00},
2073 {0x30aa, 0x00},
2074 {0x30ab, 0x00},
2075 {0x30ac, 0x07},
2076 {0x30ad, 0x90},
2077 {0x30ae, 0x04},
2078 {0x30af, 0x48},
2079 {0x30b0, 0x08},
2080 {0x30b1, 0xae},
2081 {0x30b2, 0x04},
2082 {0x30b3, 0x65},
2083 {0x30b4, 0x00},
2084 {0x30b5, 0x00},
2085 {0x30b6, 0x00},
2086 {0x30b7, 0x10},
2087 {0x30b8, 0x00},
2088 {0x30b9, 0x02},
2089 {0x30ba, 0x10},
2090 {0x30bb, 0x00},
2091 {0x30bc, 0x00},
2092 {0x30bd, 0x03},
2093 {0x30be, 0x5c},
2094 {0x30bf, 0x00},
2095 {0x30c0, 0x01},
2096 {0x30c1, 0x00},
2097 {0x30c2, 0x20},
2098 {0x30c3, 0x00},
2099 {0x30c4, 0x4a},
2100 {0x30c5, 0x00},
2101 {0x30c7, 0x00},
2102 {0x30c8, 0x00},
2103 {0x30d1, 0x00},
2104 {0x30d2, 0x00},
2105 {0x30d3, 0x80},
2106 {0x30d4, 0x00},
2107 {0x30d9, 0x09},
2108 {0x30da, 0x64},
2109 {0x30dd, 0x00},
2110 {0x30de, 0x16},
2111 {0x30df, 0x00},
2112 {0x30e0, 0x17},
2113 {0x30e1, 0x00},
2114 {0x30e2, 0x18},
2115 {0x30e3, 0x10},
2116 {0x30e4, 0x04},
2117 {0x30e5, 0x00},
2118 {0x30e6, 0x00},
2119 {0x30e7, 0x00},
2120 {0x30e8, 0x00},
2121 {0x30e9, 0x00},
2122 {0x30ea, 0x00},
2123 {0x30eb, 0x00},
2124 {0x30ec, 0x00},
2125 {0x30ed, 0x00},
2126 {0x3101, 0x00},
2127 {0x3102, 0x00},
2128 {0x3103, 0x00},
2129 {0x3104, 0x00},
2130 {0x3105, 0x8c},
2131 {0x3106, 0x87},
2132 {0x3107, 0xc0},
2133 {0x3108, 0x9d},
2134 {0x3109, 0x8d},
2135 {0x310a, 0x8d},
2136 {0x310b, 0x6a},
2137 {0x310c, 0x3a},
2138 {0x310d, 0x5a},
2139 {0x310e, 0x00},
2140 {0x3120, 0x00},
2141 {0x3121, 0x00},
2142 {0x3122, 0x00},
2143 {0x3123, 0x00},
2144 {0x3124, 0x00},
2145 {0x3125, 0x70},
2146 {0x3126, 0x1f},
2147 {0x3127, 0x0f},
2148 {0x3128, 0x00},
2149 {0x3129, 0x3a},
2150 {0x312a, 0x02},
2151 {0x312b, 0x0f},
2152 {0x312c, 0x00},
2153 {0x312d, 0x0f},
2154 {0x312e, 0x1d},
2155 {0x312f, 0x00},
2156 {0x3130, 0x00},
2157 {0x3131, 0x00},
2158 {0x3132, 0x00},
2159 {0x3140, 0x0a},
2160 {0x3141, 0x03},
2161 {0x3142, 0x00},
2162 {0x3143, 0x00},
2163 {0x3144, 0x00},
2164 {0x3145, 0x00},
2165 {0x3146, 0x00},
2166 {0x3147, 0x00},
2167 {0x3148, 0x00},
2168 {0x3149, 0x00},
2169 {0x314a, 0x00},
2170 {0x314b, 0x00},
2171 {0x314c, 0x00},
2172 {0x314d, 0x00},
2173 {0x314e, 0x1c},
2174 {0x314f, 0xff},
2175 {0x3150, 0xff},
2176 {0x3151, 0xff},
2177 {0x3152, 0x10},
2178 {0x3153, 0x10},
2179 {0x3154, 0x10},
2180 {0x3155, 0x00},
2181 {0x3156, 0x03},
2182 {0x3157, 0x00},
2183 {0x3158, 0x0f},
2184 {0x3159, 0xff},
2185 {0x315a, 0x01},
2186 {0x315b, 0x00},
2187 {0x315c, 0x01},
2188 {0x315d, 0x00},
2189 {0x315e, 0x01},
2190 {0x315f, 0x00},
2191 {0x3160, 0x00},
2192 {0x3161, 0x40},
2193 {0x3162, 0x00},
2194 {0x3163, 0x40},
2195 {0x3164, 0x00},
2196 {0x3165, 0x40},
2197 {0x3190, 0x01},
2198 {0x3191, 0x99},
2199 {0x3193, 0x08},
2200 {0x3194, 0x13},
2201 {0x3195, 0x33},
2202 {0x3196, 0x00},
2203 {0x3197, 0x10},
2204 {0x3198, 0x00},
2205 {0x3199, 0x3f},
2206 {0x319a, 0x40},
2207 {0x319b, 0x7f},
2208 {0x319c, 0x80},
2209 {0x319d, 0xbf},
2210 {0x319e, 0xc0},
2211 {0x319f, 0xff},
2212 {0x31a0, 0x24},
2213 {0x31a1, 0x55},
2214 {0x31a2, 0x00},
2215 {0x31a3, 0x00},
2216 {0x31a6, 0x00},
2217 {0x31a7, 0x00},
2218 {0x31b0, 0x00},
2219 {0x31b1, 0x00},
2220 {0x31b2, 0x02},
2221 {0x31b3, 0x00},
2222 {0x31b4, 0x00},
2223 {0x31b5, 0x01},
2224 {0x31b6, 0x00},
2225 {0x31b7, 0x00},
2226 {0x31b8, 0x00},
2227 {0x31b9, 0x00},
2228 {0x31ba, 0x00},
2229 {0x31d0, 0x3c},
2230 {0x31d1, 0x34},
2231 {0x31d2, 0x3c},
2232 {0x31d3, 0x00},
2233 {0x31d4, 0x2d},
2234 {0x31d5, 0x00},
2235 {0x31d6, 0x01},
2236 {0x31d7, 0x06},
2237 {0x31d8, 0x00},
2238 {0x31d9, 0x64},
2239 {0x31da, 0x00},
2240 {0x31db, 0x30},
2241 {0x31dc, 0x04},
2242 {0x31dd, 0x69},
2243 {0x31de, 0x0a},
2244 {0x31df, 0x3c},
2245 {0x31e0, 0x04},
2246 {0x31e1, 0x32},
2247 {0x31e2, 0x00},
2248 {0x31e3, 0x00},
2249 {0x31e4, 0x08},
2250 {0x31e5, 0x80},
2251 {0x31e6, 0x00},
2252 {0x31e7, 0x2c},
2253 {0x31e8, 0x6c},
2254 {0x31e9, 0xac},
2255 {0x31ea, 0xec},
2256 {0x31eb, 0x3f},
2257 {0x31ec, 0x0f},
2258 {0x31ed, 0x20},
2259 {0x31ee, 0x04},
2260 {0x31ef, 0x48},
2261 {0x31f0, 0x07},
2262 {0x31f1, 0x90},
2263 {0x31f2, 0x04},
2264 {0x31f3, 0x48},
2265 {0x31f4, 0x07},
2266 {0x31f5, 0x90},
2267 {0x31f6, 0x04},
2268 {0x31f7, 0x48},
2269 {0x31f8, 0x07},
2270 {0x31f9, 0x90},
2271 {0x31fa, 0x04},
2272 {0x31fb, 0x48},
2273 {0x31fd, 0xcb},
2274 {0x31fe, 0x0f},
2275 {0x31ff, 0x03},
2276 {0x3200, 0x00},
2277 {0x3201, 0xff},
2278 {0x3202, 0x00},
2279 {0x3203, 0xff},
2280 {0x3204, 0xff},
2281 {0x3205, 0xff},
2282 {0x3206, 0xff},
2283 {0x3207, 0xff},
2284 {0x3208, 0xff},
2285 {0x3209, 0xff},
2286 {0x320a, 0xff},
2287 {0x320b, 0x1b},
2288 {0x320c, 0x1f},
2289 {0x320d, 0x1e},
2290 {0x320e, 0x30},
2291 {0x320f, 0x2d},
2292 {0x3210, 0x2c},
2293 {0x3211, 0x2b},
2294 {0x3212, 0x2a},
2295 {0x3213, 0x24},
2296 {0x3214, 0x22},
2297 {0x3215, 0x00},
2298 {0x3216, 0x04},
2299 {0x3217, 0x2c},
2300 {0x3218, 0x6c},
2301 {0x3219, 0xac},
2302 {0x321a, 0xec},
2303 {0x321b, 0x00},
2304 {0x3230, 0x3a},
2305 {0x3231, 0x00},
2306 {0x3232, 0x80},
2307 {0x3233, 0x00},
2308 {0x3234, 0x10},
2309 {0x3235, 0xaa},
2310 {0x3236, 0x55},
2311 {0x3237, 0x99},
2312 {0x3238, 0x66},
2313 {0x3239, 0x08},
2314 {0x323a, 0x88},
2315 {0x323b, 0x00},
2316 {0x323c, 0x00},
2317 {0x323d, 0x03},
2318 {0x3250, 0x33},
2319 {0x3251, 0x00},
2320 {0x3252, 0x20},
2321 {0x3253, 0x00},
2322 {0x3254, 0x11},
2323 {0x3255, 0x01},
2324 {0x3256, 0x00},
2325 {0x3257, 0x00},
2326 {0x3258, 0x00},
2327 {0x3270, 0x01},
2328 {0x3271, 0x60},
2329 {0x3272, 0xc0},
2330 {0x3273, 0x00},
2331 {0x3274, 0x80},
2332 {0x3275, 0x40},
2333 {0x3276, 0x02},
2334 {0x3277, 0x08},
2335 {0x3278, 0x10},
2336 {0x3279, 0x04},
2337 {0x327a, 0x00},
2338 {0x327b, 0x03},
2339 {0x327c, 0x10},
2340 {0x327d, 0x60},
2341 {0x327e, 0xc0},
2342 {0x327f, 0x06},
2343 {0x3288, 0x10},
2344 {0x3289, 0x00},
2345 {0x328a, 0x08},
2346 {0x328b, 0x00},
2347 {0x328c, 0x04},
2348 {0x328d, 0x00},
2349 {0x328e, 0x02},
2350 {0x328f, 0x00},
2351 {0x3290, 0x20},
2352 {0x3291, 0x00},
2353 {0x3292, 0x10},
2354 {0x3293, 0x00},
2355 {0x3294, 0x08},
2356 {0x3295, 0x00},
2357 {0x3296, 0x04},
2358 {0x3297, 0x00},
2359 {0x3298, 0x40},
2360 {0x3299, 0x00},
2361 {0x329a, 0x20},
2362 {0x329b, 0x00},
2363 {0x329c, 0x10},
2364 {0x329d, 0x00},
2365 {0x329e, 0x08},
2366 {0x329f, 0x00},
2367 {0x32a0, 0x7f},
2368 {0x32a1, 0xff},
2369 {0x32a2, 0x40},
2370 {0x32a3, 0x00},
2371 {0x32a4, 0x20},
2372 {0x32a5, 0x00},
2373 {0x32a6, 0x10},
2374 {0x32a7, 0x00},
2375 {0x32a8, 0x00},
2376 {0x32a9, 0x00},
2377 {0x32aa, 0x00},
2378 {0x32ab, 0x00},
2379 {0x32ac, 0x00},
2380 {0x32ad, 0x00},
2381 {0x32ae, 0x00},
2382 {0x32af, 0x00},
2383 {0x32b0, 0x00},
2384 {0x32b1, 0x00},
2385 {0x32b2, 0x00},
2386 {0x32b3, 0x00},
2387 {0x32b4, 0x00},
2388 {0x32b5, 0x00},
2389 {0x32b6, 0x00},
2390 {0x32b7, 0x00},
2391 {0x32b8, 0x00},
2392 {0x32b9, 0x00},
2393 {0x32ba, 0x00},
2394 {0x32bb, 0x00},
2395 {0x32bc, 0x00},
2396 {0x32bd, 0x00},
2397 {0x32be, 0x00},
2398 {0x32bf, 0x00},
2399 {0x32c0, 0x00},
2400 {0x32c1, 0x00},
2401 {0x32c2, 0x00},
2402 {0x32c3, 0x00},
2403 {0x32c4, 0x00},
2404 {0x32c5, 0x00},
2405 {0x32c6, 0x00},
2406 {0x32c7, 0x00},
2407 {0x32c8, 0x87},
2408 {0x32c9, 0x00},
2409 {0x3330, 0x03},
2410 {0x3331, 0xc8},
2411 {0x3332, 0x02},
2412 {0x3333, 0x24},
2413 {0x3334, 0x00},
2414 {0x3335, 0x00},
2415 {0x3336, 0x00},
2416 {0x3337, 0x00},
2417 {0x3338, 0x03},
2418 {0x3339, 0xc8},
2419 {0x333a, 0x02},
2420 {0x333b, 0x24},
2421 {0x333c, 0x00},
2422 {0x333d, 0x00},
2423 {0x333e, 0x00},
2424 {0x333f, 0x00},
2425 {0x3340, 0x03},
2426 {0x3341, 0xc8},
2427 {0x3342, 0x02},
2428 {0x3343, 0x24},
2429 {0x3344, 0x00},
2430 {0x3345, 0x00},
2431 {0x3346, 0x00},
2432 {0x3347, 0x00},
2433 {0x3348, 0x40},
2434 {0x3349, 0x00},
2435 {0x334a, 0x00},
2436 {0x334b, 0x00},
2437 {0x334c, 0x00},
2438 {0x334d, 0x00},
2439 {0x334e, 0x80},
2440 {0x3360, 0x01},
2441 {0x3361, 0x00},
2442 {0x3362, 0x01},
2443 {0x3363, 0x00},
2444 {0x3364, 0x01},
2445 {0x3365, 0x00},
2446 {0x3366, 0x01},
2447 {0x3367, 0x00},
2448 {0x3368, 0x01},
2449 {0x3369, 0x00},
2450 {0x336a, 0x01},
2451 {0x336b, 0x00},
2452 {0x336c, 0x01},
2453 {0x336d, 0x00},
2454 {0x336e, 0x01},
2455 {0x336f, 0x00},
2456 {0x3370, 0x01},
2457 {0x3371, 0x00},
2458 {0x3372, 0x01},
2459 {0x3373, 0x00},
2460 {0x3374, 0x01},
2461 {0x3375, 0x00},
2462 {0x3376, 0x01},
2463 {0x3377, 0x00},
2464 {0x3378, 0x00},
2465 {0x3379, 0x00},
2466 {0x337a, 0x00},
2467 {0x337b, 0x00},
2468 {0x337c, 0x00},
2469 {0x337d, 0x00},
2470 {0x337e, 0x00},
2471 {0x337f, 0x00},
2472 {0x3380, 0x00},
2473 {0x3381, 0x00},
2474 {0x3382, 0x00},
2475 {0x3383, 0x00},
2476 {0x3384, 0x00},
2477 {0x3385, 0x00},
2478 {0x3386, 0x00},
2479 {0x3387, 0x00},
2480 {0x3388, 0x00},
2481 {0x3389, 0x00},
2482 {0x338a, 0x00},
2483 {0x338b, 0x00},
2484 {0x338c, 0x00},
2485 {0x338d, 0x00},
2486 {0x338e, 0x00},
2487 {0x338f, 0x00},
2488 {0x3390, 0x00},
2489 {0x3391, 0x00},
2490 {0x3392, 0x00},
2491 {0x3393, 0x00},
2492 {0x3394, 0x00},
2493 {0x3395, 0x00},
2494 {0x3396, 0x00},
2495 {0x3397, 0x00},
2496 {0x3398, 0x00},
2497 {0x3399, 0x00},
2498 {0x339a, 0x00},
2499 {0x339b, 0x00},
2500 {0x33b0, 0x00},
2501 {0x33b1, 0x50},
2502 {0x33b2, 0x01},
2503 {0x33b3, 0xff},
2504 {0x33b4, 0xe0},
2505 {0x33b5, 0x6b},
2506 {0x33b6, 0x00},
2507 {0x33b7, 0x00},
2508 {0x33b8, 0x00},
2509 {0x33b9, 0x00},
2510 {0x33ba, 0x00},
2511 {0x33bb, 0x1f},
2512 {0x33bc, 0x01},
2513 {0x33bd, 0x01},
2514 {0x33be, 0x01},
2515 {0x33bf, 0x01},
2516 {0x33c0, 0x00},
2517 {0x33c1, 0x00},
2518 {0x33c2, 0x00},
2519 {0x33c3, 0x00},
2520 {0x33e0, 0x14},
2521 {0x33e1, 0x0f},
2522 {0x33e2, 0x04},
2523 {0x33e3, 0x02},
2524 {0x33e4, 0x01},
2525 {0x33e5, 0x01},
2526 {0x33e6, 0x00},
2527 {0x33e7, 0x04},
2528 {0x33e8, 0x0c},
2529 {0x33e9, 0x00},
2530 {0x33ea, 0x01},
2531 {0x33eb, 0x02},
2532 {0x33ec, 0x03},
2533 {0x33ed, 0x02},
2534 {0x33ee, 0x05},
2535 {0x33ef, 0x0a},
2536 {0x33f0, 0x08},
2537 {0x33f1, 0x04},
2538 {0x33f2, 0x04},
2539 {0x33f3, 0x00},
2540 {0x33f4, 0x03},
2541 {0x33f5, 0x14},
2542 {0x33f6, 0x0f},
2543 {0x33f7, 0x02},
2544 {0x33f8, 0x01},
2545 {0x33f9, 0x01},
2546 {0x33fa, 0x01},
2547 {0x33fb, 0x00},
2548 {0x33fc, 0x04},
2549 {0x33fd, 0x0c},
2550 {0x33fe, 0x00},
2551 {0x33ff, 0x01},
2552 {0x3400, 0x02},
2553 {0x3401, 0x03},
2554 {0x3402, 0x01},
2555 {0x3403, 0x02},
2556 {0x3404, 0x08},
2557 {0x3405, 0x08},
2558 {0x3406, 0x04},
2559 {0x3407, 0x04},
2560 {0x3408, 0x00},
2561 {0x3409, 0x03},
2562 {0x340a, 0x14},
2563 {0x340b, 0x0f},
2564 {0x340c, 0x04},
2565 {0x340d, 0x02},
2566 {0x340e, 0x01},
2567 {0x340f, 0x01},
2568 {0x3410, 0x00},
2569 {0x3411, 0x04},
2570 {0x3412, 0x0c},
2571 {0x3413, 0x00},
2572 {0x3414, 0x01},
2573 {0x3415, 0x02},
2574 {0x3416, 0x03},
2575 {0x3417, 0x02},
2576 {0x3418, 0x05},
2577 {0x3419, 0x0a},
2578 {0x341a, 0x08},
2579 {0x341b, 0x04},
2580 {0x341c, 0x04},
2581 {0x341d, 0x00},
2582 {0x341e, 0x03},
2583 {0x3440, 0x00},
2584 {0x3441, 0x00},
2585 {0x3442, 0x00},
2586 {0x3443, 0x00},
2587 {0x3444, 0x02},
2588 {0x3445, 0xf0},
2589 {0x3446, 0x02},
2590 {0x3447, 0x08},
2591 {0x3448, 0x00},
2592 {0x3460, 0x40},
2593 {0x3461, 0x40},
2594 {0x3462, 0x40},
2595 {0x3463, 0x40},
2596 {0x3464, 0x03},
2597 {0x3465, 0x01},
2598 {0x3466, 0x01},
2599 {0x3467, 0x02},
2600 {0x3468, 0x30},
2601 {0x3469, 0x00},
2602 {0x346a, 0x35},
2603 {0x346b, 0x00},
2604 {0x3480, 0x40},
2605 {0x3481, 0x00},
2606 {0x3482, 0x00},
2607 {0x3483, 0x00},
2608 {0x3484, 0x0d},
2609 {0x3485, 0x00},
2610 {0x3486, 0x00},
2611 {0x3487, 0x00},
2612 {0x3488, 0x00},
2613 {0x3489, 0x00},
2614 {0x348a, 0x00},
2615 {0x348b, 0x04},
2616 {0x348c, 0x00},
2617 {0x348d, 0x01},
2618 {0x348f, 0x01},
2619 {0x3030, 0x0a},
2620 {0x3030, 0x02},
2621 {0x7000, 0x58},
2622 {0x7001, 0x7a},
2623 {0x7002, 0x1a},
2624 {0x7003, 0xc1},
2625 {0x7004, 0x03},
2626 {0x7005, 0xda},
2627 {0x7006, 0xbd},
2628 {0x7007, 0x03},
2629 {0x7008, 0xbd},
2630 {0x7009, 0x06},
2631 {0x700a, 0xe6},
2632 {0x700b, 0xec},
2633 {0x700c, 0xbc},
2634 {0x700d, 0xff},
2635 {0x700e, 0xbc},
2636 {0x700f, 0x73},
2637 {0x7010, 0xda},
2638 {0x7011, 0x72},
2639 {0x7012, 0x76},
2640 {0x7013, 0xb6},
2641 {0x7014, 0xee},
2642 {0x7015, 0xcf},
2643 {0x7016, 0xac},
2644 {0x7017, 0xd0},
2645 {0x7018, 0xac},
2646 {0x7019, 0xd1},
2647 {0x701a, 0x50},
2648 {0x701b, 0xac},
2649 {0x701c, 0xd2},
2650 {0x701d, 0xbc},
2651 {0x701e, 0x2e},
2652 {0x701f, 0xb4},
2653 {0x7020, 0x00},
2654 {0x7021, 0xdc},
2655 {0x7022, 0xdf},
2656 {0x7023, 0xb0},
2657 {0x7024, 0x6e},
2658 {0x7025, 0xbd},
2659 {0x7026, 0x01},
2660 {0x7027, 0xd7},
2661 {0x7028, 0xed},
2662 {0x7029, 0xe1},
2663 {0x702a, 0x36},
2664 {0x702b, 0x30},
2665 {0x702c, 0xd3},
2666 {0x702d, 0x2e},
2667 {0x702e, 0x54},
2668 {0x702f, 0x46},
2669 {0x7030, 0xbc},
2670 {0x7031, 0x22},
2671 {0x7032, 0x66},
2672 {0x7033, 0xbc},
2673 {0x7034, 0x24},
2674 {0x7035, 0x2c},
2675 {0x7036, 0x28},
2676 {0x7037, 0xbc},
2677 {0x7038, 0x3c},
2678 {0x7039, 0xa1},
2679 {0x703a, 0xac},
2680 {0x703b, 0xd8},
2681 {0x703c, 0xd6},
2682 {0x703d, 0xb4},
2683 {0x703e, 0x04},
2684 {0x703f, 0x46},
2685 {0x7040, 0xb7},
2686 {0x7041, 0x04},
2687 {0x7042, 0xbe},
2688 {0x7043, 0x08},
2689 {0x7044, 0xc3},
2690 {0x7045, 0xd9},
2691 {0x7046, 0xad},
2692 {0x7047, 0xc3},
2693 {0x7048, 0xbc},
2694 {0x7049, 0x19},
2695 {0x704a, 0xc1},
2696 {0x704b, 0x27},
2697 {0x704c, 0xe7},
2698 {0x704d, 0x00},
2699 {0x704e, 0x50},
2700 {0x704f, 0x20},
2701 {0x7050, 0xb8},
2702 {0x7051, 0x02},
2703 {0x7052, 0xbc},
2704 {0x7053, 0x17},
2705 {0x7054, 0xdb},
2706 {0x7055, 0xc7},
2707 {0x7056, 0xb8},
2708 {0x7057, 0x00},
2709 {0x7058, 0x28},
2710 {0x7059, 0x54},
2711 {0x705a, 0xb4},
2712 {0x705b, 0x14},
2713 {0x705c, 0xab},
2714 {0x705d, 0xbe},
2715 {0x705e, 0x06},
2716 {0x705f, 0xd8},
2717 {0x7060, 0xd6},
2718 {0x7061, 0x00},
2719 {0x7062, 0xb4},
2720 {0x7063, 0xc7},
2721 {0x7064, 0x07},
2722 {0x7065, 0xb9},
2723 {0x7066, 0x05},
2724 {0x7067, 0xee},
2725 {0x7068, 0xe6},
2726 {0x7069, 0xad},
2727 {0x706a, 0xb4},
2728 {0x706b, 0x26},
2729 {0x706c, 0x19},
2730 {0x706d, 0xc1},
2731 {0x706e, 0x3a},
2732 {0x706f, 0xc3},
2733 {0x7070, 0xaf},
2734 {0x7071, 0x00},
2735 {0x7072, 0xc0},
2736 {0x7073, 0x3c},
2737 {0x7074, 0xc3},
2738 {0x7075, 0xbe},
2739 {0x7076, 0xe7},
2740 {0x7077, 0x00},
2741 {0x7078, 0x15},
2742 {0x7079, 0xc2},
2743 {0x707a, 0x40},
2744 {0x707b, 0xc3},
2745 {0x707c, 0xa4},
2746 {0x707d, 0xc0},
2747 {0x707e, 0x3c},
2748 {0x707f, 0x00},
2749 {0x7080, 0xb9},
2750 {0x7081, 0x64},
2751 {0x7082, 0x29},
2752 {0x7083, 0x00},
2753 {0x7084, 0xb8},
2754 {0x7085, 0x12},
2755 {0x7086, 0xbe},
2756 {0x7087, 0x01},
2757 {0x7088, 0xd0},
2758 {0x7089, 0xbc},
2759 {0x708a, 0x01},
2760 {0x708b, 0xac},
2761 {0x708c, 0x37},
2762 {0x708d, 0xd2},
2763 {0x708e, 0xac},
2764 {0x708f, 0x45},
2765 {0x7090, 0xad},
2766 {0x7091, 0x28},
2767 {0x7092, 0x00},
2768 {0x7093, 0xb8},
2769 {0x7094, 0x00},
2770 {0x7095, 0xbc},
2771 {0x7096, 0x01},
2772 {0x7097, 0x36},
2773 {0x7098, 0xd3},
2774 {0x7099, 0x30},
2775 {0x709a, 0x04},
2776 {0x709b, 0xe0},
2777 {0x709c, 0xd8},
2778 {0x709d, 0xb4},
2779 {0x709e, 0xe9},
2780 {0x709f, 0x00},
2781 {0x70a0, 0xbe},
2782 {0x70a1, 0x05},
2783 {0x70a2, 0x62},
2784 {0x70a3, 0x07},
2785 {0x70a4, 0xb9},
2786 {0x70a5, 0x05},
2787 {0x70a6, 0xad},
2788 {0x70a7, 0xc3},
2789 {0x70a8, 0xcf},
2790 {0x70a9, 0x00},
2791 {0x70aa, 0x15},
2792 {0x70ab, 0xc2},
2793 {0x70ac, 0x59},
2794 {0x70ad, 0xc3},
2795 {0x70ae, 0xc9},
2796 {0x70af, 0xc0},
2797 {0x70b0, 0x55},
2798 {0x70b1, 0x00},
2799 {0x70b2, 0x46},
2800 {0x70b3, 0xa1},
2801 {0x70b4, 0xb9},
2802 {0x70b5, 0x64},
2803 {0x70b6, 0x29},
2804 {0x70b7, 0x00},
2805 {0x70b8, 0xb8},
2806 {0x70b9, 0x02},
2807 {0x70ba, 0xbe},
2808 {0x70bb, 0x02},
2809 {0x70bc, 0xd0},
2810 {0x70bd, 0xdc},
2811 {0x70be, 0xac},
2812 {0x70bf, 0xbc},
2813 {0x70c0, 0x01},
2814 {0x70c1, 0x37},
2815 {0x70c2, 0xac},
2816 {0x70c3, 0xd2},
2817 {0x70c4, 0x45},
2818 {0x70c5, 0xad},
2819 {0x70c6, 0x28},
2820 {0x70c7, 0x00},
2821 {0x70c8, 0xb8},
2822 {0x70c9, 0x00},
2823 {0x70ca, 0xbc},
2824 {0x70cb, 0x01},
2825 {0x70cc, 0x36},
2826 {0x70cd, 0x30},
2827 {0x70ce, 0xe0},
2828 {0x70cf, 0xd8},
2829 {0x70d0, 0xb5},
2830 {0x70d1, 0x0b},
2831 {0x70d2, 0xd6},
2832 {0x70d3, 0xbe},
2833 {0x70d4, 0x07},
2834 {0x70d5, 0x00},
2835 {0x70d6, 0x62},
2836 {0x70d7, 0x07},
2837 {0x70d8, 0xb9},
2838 {0x70d9, 0x05},
2839 {0x70da, 0xad},
2840 {0x70db, 0xc3},
2841 {0x70dc, 0xcf},
2842 {0x70dd, 0x46},
2843 {0x70de, 0xcd},
2844 {0x70df, 0x07},
2845 {0x70e0, 0xcd},
2846 {0x70e1, 0x00},
2847 {0x70e2, 0xe3},
2848 {0x70e3, 0x18},
2849 {0x70e4, 0xc2},
2850 {0x70e5, 0xa2},
2851 {0x70e6, 0xb9},
2852 {0x70e7, 0x64},
2853 {0x70e8, 0xd1},
2854 {0x70e9, 0xdd},
2855 {0x70ea, 0xac},
2856 {0x70eb, 0xcf},
2857 {0x70ec, 0xdf},
2858 {0x70ed, 0xb5},
2859 {0x70ee, 0x19},
2860 {0x70ef, 0x46},
2861 {0x70f0, 0x50},
2862 {0x70f1, 0xb6},
2863 {0x70f2, 0xee},
2864 {0x70f3, 0xe8},
2865 {0x70f4, 0xe6},
2866 {0x70f5, 0xbc},
2867 {0x70f6, 0x31},
2868 {0x70f7, 0xe1},
2869 {0x70f8, 0x36},
2870 {0x70f9, 0x30},
2871 {0x70fa, 0xd3},
2872 {0x70fb, 0x2e},
2873 {0x70fc, 0x54},
2874 {0x70fd, 0xbd},
2875 {0x70fe, 0x03},
2876 {0x70ff, 0xec},
2877 {0x7100, 0x2c},
2878 {0x7101, 0x50},
2879 {0x7102, 0x20},
2880 {0x7103, 0x04},
2881 {0x7104, 0xb8},
2882 {0x7105, 0x02},
2883 {0x7106, 0xbc},
2884 {0x7107, 0x18},
2885 {0x7108, 0xc7},
2886 {0x7109, 0xb8},
2887 {0x710a, 0x00},
2888 {0x710b, 0x28},
2889 {0x710c, 0x54},
2890 {0x710d, 0xbc},
2891 {0x710e, 0x02},
2892 {0x710f, 0xb4},
2893 {0x7110, 0xda},
2894 {0x7111, 0xbe},
2895 {0x7112, 0x04},
2896 {0x7113, 0xd6},
2897 {0x7114, 0xd8},
2898 {0x7115, 0xab},
2899 {0x7116, 0x00},
2900 {0x7117, 0x62},
2901 {0x7118, 0x07},
2902 {0x7119, 0xb9},
2903 {0x711a, 0x05},
2904 {0x711b, 0xad},
2905 {0x711c, 0xc3},
2906 {0x711d, 0xbc},
2907 {0x711e, 0xe7},
2908 {0x711f, 0xb9},
2909 {0x7120, 0x64},
2910 {0x7121, 0x29},
2911 {0x7122, 0x00},
2912 {0x7123, 0xb8},
2913 {0x7124, 0x02},
2914 {0x7125, 0xbe},
2915 {0x7126, 0x00},
2916 {0x7127, 0x45},
2917 {0x7128, 0xad},
2918 {0x7129, 0xe2},
2919 {0x712a, 0x28},
2920 {0x712b, 0x00},
2921 {0x712c, 0xb8},
2922 {0x712d, 0x00},
2923 {0x712e, 0xe0},
2924 {0x712f, 0xd8},
2925 {0x7130, 0xb4},
2926 {0x7131, 0xe9},
2927 {0x7132, 0xbe},
2928 {0x7133, 0x03},
2929 {0x7134, 0x00},
2930 {0x7135, 0x30},
2931 {0x7136, 0x62},
2932 {0x7137, 0x07},
2933 {0x7138, 0xb9},
2934 {0x7139, 0x05},
2935 {0x713a, 0xad},
2936 {0x713b, 0xc3},
2937 {0x713c, 0xcf},
2938 {0x713d, 0x42},
2939 {0x713e, 0xe4},
2940 {0x713f, 0xcd},
2941 {0x7140, 0x07},
2942 {0x7141, 0xcd},
2943 {0x7142, 0x00},
2944 {0x7143, 0x00},
2945 {0x7144, 0x17},
2946 {0x7145, 0xc2},
2947 {0x7146, 0xbb},
2948 {0x7147, 0xde},
2949 {0x7148, 0xcf},
2950 {0x7149, 0xdf},
2951 {0x714a, 0xac},
2952 {0x714b, 0xd1},
2953 {0x714c, 0x44},
2954 {0x714d, 0xac},
2955 {0x714e, 0xb9},
2956 {0x714f, 0x76},
2957 {0x7150, 0xb8},
2958 {0x7151, 0x08},
2959 {0x7152, 0xb6},
2960 {0x7153, 0xfe},
2961 {0x7154, 0xb4},
2962 {0x7155, 0xca},
2963 {0x7156, 0xd6},
2964 {0x7157, 0xd8},
2965 {0x7158, 0xab},
2966 {0x7159, 0x00},
2967 {0x715a, 0xe1},
2968 {0x715b, 0x36},
2969 {0x715c, 0x30},
2970 {0x715d, 0xd3},
2971 {0x715e, 0xbc},
2972 {0x715f, 0x29},
2973 {0x7160, 0xb4},
2974 {0x7161, 0x1f},
2975 {0x7162, 0xaa},
2976 {0x7163, 0xbd},
2977 {0x7164, 0x01},
2978 {0x7165, 0xb8},
2979 {0x7166, 0x0c},
2980 {0x7167, 0x45},
2981 {0x7168, 0xa4},
2982 {0x7169, 0xbd},
2983 {0x716a, 0x03},
2984 {0x716b, 0xec},
2985 {0x716c, 0xbc},
2986 {0x716d, 0x3d},
2987 {0x716e, 0xc3},
2988 {0x716f, 0xcf},
2989 {0x7170, 0x42},
2990 {0x7171, 0xb8},
2991 {0x7172, 0x00},
2992 {0x7173, 0xe4},
2993 {0x7174, 0xd5},
2994 {0x7175, 0x00},
2995 {0x7176, 0xb6},
2996 {0x7177, 0x00},
2997 {0x7178, 0x74},
2998 {0x7179, 0xbd},
2999 {0x717a, 0x03},
3000 {0x717b, 0x40},
3001 {0x717c, 0xb5},
3002 {0x717d, 0x39},
3003 {0x717e, 0x58},
3004 {0x717f, 0xdd},
3005 {0x7180, 0x19},
3006 {0x7181, 0xc1},
3007 {0x7182, 0xc8},
3008 {0x7183, 0xbd},
3009 {0x7184, 0x06},
3010 {0x7185, 0x17},
3011 {0x7186, 0xc1},
3012 {0x7187, 0xc6},
3013 {0x7188, 0xe8},
3014 {0x7189, 0x00},
3015 {0x718a, 0xc0},
3016 {0x718b, 0xc8},
3017 {0x718c, 0xe6},
3018 {0x718d, 0x95},
3019 {0x718e, 0x15},
3020 {0x718f, 0x00},
3021 {0x7190, 0xbc},
3022 {0x7191, 0x19},
3023 {0x7192, 0xb9},
3024 {0x7193, 0xf6},
3025 {0x7194, 0x14},
3026 {0x7195, 0xc1},
3027 {0x7196, 0xd0},
3028 {0x7197, 0xd1},
3029 {0x7198, 0xac},
3030 {0x7199, 0x37},
3031 {0x719a, 0xbc},
3032 {0x719b, 0x35},
3033 {0x719c, 0x36},
3034 {0x719d, 0x30},
3035 {0x719e, 0xe1},
3036 {0x719f, 0xd3},
3037 {0x71a0, 0x7a},
3038 {0x71a1, 0xb6},
3039 {0x71a2, 0x0c},
3040 {0x71a3, 0xff},
3041 {0x71a4, 0xb4},
3042 {0x71a5, 0xc7},
3043 {0x71a6, 0xd9},
3044 {0x71a7, 0x00},
3045 {0x71a8, 0xbd},
3046 {0x71a9, 0x01},
3047 {0x71aa, 0x56},
3048 {0x71ab, 0xc0},
3049 {0x71ac, 0xda},
3050 {0x71ad, 0xb4},
3051 {0x71ae, 0x1f},
3052 {0x71af, 0x56},
3053 {0x71b0, 0xaa},
3054 {0x71b1, 0xbc},
3055 {0x71b2, 0x08},
3056 {0x71b3, 0x00},
3057 {0x71b4, 0x57},
3058 {0x71b5, 0xe8},
3059 {0x71b6, 0xb5},
3060 {0x71b7, 0x36},
3061 {0x71b8, 0x00},
3062 {0x71b9, 0x54},
3063 {0x71ba, 0xe7},
3064 {0x71bb, 0xc8},
3065 {0x71bc, 0xb4},
3066 {0x71bd, 0x1f},
3067 {0x71be, 0x56},
3068 {0x71bf, 0xaa},
3069 {0x71c0, 0xbc},
3070 {0x71c1, 0x08},
3071 {0x71c2, 0x57},
3072 {0x71c3, 0x00},
3073 {0x71c4, 0xb5},
3074 {0x71c5, 0x36},
3075 {0x71c6, 0x00},
3076 {0x71c7, 0x54},
3077 {0x71c8, 0xc8},
3078 {0x71c9, 0xb5},
3079 {0x71ca, 0x18},
3080 {0x71cb, 0xd9},
3081 {0x71cc, 0x00},
3082 {0x71cd, 0xbd},
3083 {0x71ce, 0x01},
3084 {0x71cf, 0x56},
3085 {0x71d0, 0x08},
3086 {0x71d1, 0x57},
3087 {0x71d2, 0xe8},
3088 {0x71d3, 0xb4},
3089 {0x71d4, 0x42},
3090 {0x71d5, 0x00},
3091 {0x71d6, 0x54},
3092 {0x71d7, 0xe7},
3093 {0x71d8, 0xc8},
3094 {0x71d9, 0xab},
3095 {0x71da, 0x00},
3096 {0x71db, 0x66},
3097 {0x71dc, 0x62},
3098 {0x71dd, 0x06},
3099 {0x71de, 0x74},
3100 {0x71df, 0xb9},
3101 {0x71e0, 0x05},
3102 {0x71e1, 0xb7},
3103 {0x71e2, 0x14},
3104 {0x71e3, 0x0e},
3105 {0x71e4, 0xb7},
3106 {0x71e5, 0x04},
3107 {0x71e6, 0xc8},
3108 {0x7600, 0x04},
3109 {0x7601, 0x80},
3110 {0x7602, 0x07},
3111 {0x7603, 0x44},
3112 {0x7604, 0x05},
3113 {0x7605, 0x33},
3114 {0x7606, 0x0f},
3115 {0x7607, 0x00},
3116 {0x7608, 0x07},
3117 {0x7609, 0x40},
3118 {0x760a, 0x04},
3119 {0x760b, 0xe5},
3120 {0x760c, 0x06},
3121 {0x760d, 0x50},
3122 {0x760e, 0x04},
3123 {0x760f, 0xe4},
3124 {0x7610, 0x00},
3125 {0x7611, 0x00},
3126 {0x7612, 0x06},
3127 {0x7613, 0x5c},
3128 {0x7614, 0x00},
3129 {0x7615, 0x0f},
3130 {0x7616, 0x06},
3131 {0x7617, 0x1c},
3132 {0x7618, 0x00},
3133 {0x7619, 0x02},
3134 {0x761a, 0x06},
3135 {0x761b, 0xa2},
3136 {0x761c, 0x00},
3137 {0x761d, 0x01},
3138 {0x761e, 0x06},
3139 {0x761f, 0xae},
3140 {0x7620, 0x00},
3141 {0x7621, 0x0e},
3142 {0x7622, 0x05},
3143 {0x7623, 0x30},
3144 {0x7624, 0x07},
3145 {0x7625, 0x00},
3146 {0x7626, 0x0f},
3147 {0x7627, 0x00},
3148 {0x7628, 0x04},
3149 {0x7629, 0xe5},
3150 {0x762a, 0x05},
3151 {0x762b, 0x33},
3152 {0x762c, 0x06},
3153 {0x762d, 0x12},
3154 {0x762e, 0x00},
3155 {0x762f, 0x01},
3156 {0x7630, 0x06},
3157 {0x7631, 0x52},
3158 {0x7632, 0x00},
3159 {0x7633, 0x01},
3160 {0x7634, 0x06},
3161 {0x7635, 0x5e},
3162 {0x7636, 0x04},
3163 {0x7637, 0xe4},
3164 {0x7638, 0x00},
3165 {0x7639, 0x01},
3166 {0x763a, 0x05},
3167 {0x763b, 0x30},
3168 {0x763c, 0x0f},
3169 {0x763d, 0x00},
3170 {0x763e, 0x06},
3171 {0x763f, 0xa6},
3172 {0x7640, 0x00},
3173 {0x7641, 0x02},
3174 {0x7642, 0x06},
3175 {0x7643, 0x26},
3176 {0x7644, 0x00},
3177 {0x7645, 0x02},
3178 {0x7646, 0x05},
3179 {0x7647, 0x33},
3180 {0x7648, 0x06},
3181 {0x7649, 0x20},
3182 {0x764a, 0x0f},
3183 {0x764b, 0x00},
3184 {0x764c, 0x06},
3185 {0x764d, 0x56},
3186 {0x764e, 0x00},
3187 {0x764f, 0x02},
3188 {0x7650, 0x06},
3189 {0x7651, 0x16},
3190 {0x7652, 0x05},
3191 {0x7653, 0x33},
3192 {0x7654, 0x06},
3193 {0x7655, 0x10},
3194 {0x7656, 0x0f},
3195 {0x7657, 0x00},
3196 {0x7658, 0x06},
3197 {0x7659, 0x10},
3198 {0x765a, 0x0f},
3199 {0x765b, 0x00},
3200 {0x765c, 0x06},
3201 {0x765d, 0x20},
3202 {0x765e, 0x0f},
3203 {0x765f, 0x00},
3204 {0x7660, 0x00},
3205 {0x7661, 0x00},
3206 {0x7662, 0x00},
3207 {0x7663, 0x02},
3208 {0x7664, 0x04},
3209 {0x7665, 0xe5},
3210 {0x7666, 0x04},
3211 {0x7667, 0xe4},
3212 {0x7668, 0x0f},
3213 {0x7669, 0x00},
3214 {0x766a, 0x00},
3215 {0x766b, 0x00},
3216 {0x766c, 0x00},
3217 {0x766d, 0x01},
3218 {0x766e, 0x04},
3219 {0x766f, 0xe5},
3220 {0x7670, 0x04},
3221 {0x7671, 0xe4},
3222 {0x7672, 0x0f},
3223 {0x7673, 0x00},
3224 {0x7674, 0x00},
3225 {0x7675, 0x02},
3226 {0x7676, 0x04},
3227 {0x7677, 0xe4},
3228 {0x7678, 0x00},
3229 {0x7679, 0x02},
3230 {0x767a, 0x04},
3231 {0x767b, 0xc4},
3232 {0x767c, 0x00},
3233 {0x767d, 0x02},
3234 {0x767e, 0x04},
3235 {0x767f, 0xc4},
3236 {0x7680, 0x05},
3237 {0x7681, 0x83},
3238 {0x7682, 0x0f},
3239 {0x7683, 0x00},
3240 {0x7684, 0x00},
3241 {0x7685, 0x02},
3242 {0x7686, 0x04},
3243 {0x7687, 0xe4},
3244 {0x7688, 0x00},
3245 {0x7689, 0x02},
3246 {0x768a, 0x04},
3247 {0x768b, 0xc4},
3248 {0x768c, 0x00},
3249 {0x768d, 0x02},
3250 {0x768e, 0x04},
3251 {0x768f, 0xc4},
3252 {0x7690, 0x05},
3253 {0x7691, 0x83},
3254 {0x7692, 0x03},
3255 {0x7693, 0x0b},
3256 {0x7694, 0x05},
3257 {0x7695, 0x83},
3258 {0x7696, 0x00},
3259 {0x7697, 0x07},
3260 {0x7698, 0x05},
3261 {0x7699, 0x03},
3262 {0x769a, 0x00},
3263 {0x769b, 0x05},
3264 {0x769c, 0x05},
3265 {0x769d, 0x32},
3266 {0x769e, 0x05},
3267 {0x769f, 0x30},
3268 {0x76a0, 0x00},
3269 {0x76a1, 0x02},
3270 {0x76a2, 0x05},
3271 {0x76a3, 0x78},
3272 {0x76a4, 0x00},
3273 {0x76a5, 0x01},
3274 {0x76a6, 0x05},
3275 {0x76a7, 0x7c},
3276 {0x76a8, 0x03},
3277 {0x76a9, 0x9a},
3278 {0x76aa, 0x05},
3279 {0x76ab, 0x83},
3280 {0x76ac, 0x00},
3281 {0x76ad, 0x04},
3282 {0x76ae, 0x05},
3283 {0x76af, 0x03},
3284 {0x76b0, 0x00},
3285 {0x76b1, 0x03},
3286 {0x76b2, 0x05},
3287 {0x76b3, 0x32},
3288 {0x76b4, 0x05},
3289 {0x76b5, 0x30},
3290 {0x76b6, 0x00},
3291 {0x76b7, 0x02},
3292 {0x76b8, 0x05},
3293 {0x76b9, 0x78},
3294 {0x76ba, 0x00},
3295 {0x76bb, 0x01},
3296 {0x76bc, 0x05},
3297 {0x76bd, 0x7c},
3298 {0x76be, 0x03},
3299 {0x76bf, 0x99},
3300 {0x76c0, 0x05},
3301 {0x76c1, 0x83},
3302 {0x76c2, 0x00},
3303 {0x76c3, 0x03},
3304 {0x76c4, 0x05},
3305 {0x76c5, 0x03},
3306 {0x76c6, 0x00},
3307 {0x76c7, 0x01},
3308 {0x76c8, 0x05},
3309 {0x76c9, 0x32},
3310 {0x76ca, 0x05},
3311 {0x76cb, 0x30},
3312 {0x76cc, 0x00},
3313 {0x76cd, 0x02},
3314 {0x76ce, 0x05},
3315 {0x76cf, 0x78},
3316 {0x76d0, 0x00},
3317 {0x76d1, 0x01},
3318 {0x76d2, 0x05},
3319 {0x76d3, 0x7c},
3320 {0x76d4, 0x03},
3321 {0x76d5, 0x98},
3322 {0x76d6, 0x05},
3323 {0x76d7, 0x83},
3324 {0x76d8, 0x00},
3325 {0x76d9, 0x00},
3326 {0x76da, 0x05},
3327 {0x76db, 0x03},
3328 {0x76dc, 0x00},
3329 {0x76dd, 0x01},
3330 {0x76de, 0x05},
3331 {0x76df, 0x32},
3332 {0x76e0, 0x05},
3333 {0x76e1, 0x30},
3334 {0x76e2, 0x00},
3335 {0x76e3, 0x02},
3336 {0x76e4, 0x05},
3337 {0x76e5, 0x78},
3338 {0x76e6, 0x00},
3339 {0x76e7, 0x01},
3340 {0x76e8, 0x05},
3341 {0x76e9, 0x7c},
3342 {0x76ea, 0x03},
3343 {0x76eb, 0x97},
3344 {0x76ec, 0x05},
3345 {0x76ed, 0x83},
3346 {0x76ee, 0x00},
3347 {0x76ef, 0x00},
3348 {0x76f0, 0x05},
3349 {0x76f1, 0x03},
3350 {0x76f2, 0x05},
3351 {0x76f3, 0x32},
3352 {0x76f4, 0x05},
3353 {0x76f5, 0x30},
3354 {0x76f6, 0x00},
3355 {0x76f7, 0x02},
3356 {0x76f8, 0x05},
3357 {0x76f9, 0x78},
3358 {0x76fa, 0x00},
3359 {0x76fb, 0x01},
3360 {0x76fc, 0x05},
3361 {0x76fd, 0x7c},
3362 {0x76fe, 0x03},
3363 {0x76ff, 0x96},
3364 {0x7700, 0x05},
3365 {0x7701, 0x83},
3366 {0x7702, 0x05},
3367 {0x7703, 0x03},
3368 {0x7704, 0x05},
3369 {0x7705, 0x32},
3370 {0x7706, 0x05},
3371 {0x7707, 0x30},
3372 {0x7708, 0x00},
3373 {0x7709, 0x02},
3374 {0x770a, 0x05},
3375 {0x770b, 0x78},
3376 {0x770c, 0x00},
3377 {0x770d, 0x01},
3378 {0x770e, 0x05},
3379 {0x770f, 0x7c},
3380 {0x7710, 0x03},
3381 {0x7711, 0x95},
3382 {0x7712, 0x05},
3383 {0x7713, 0x83},
3384 {0x7714, 0x05},
3385 {0x7715, 0x03},
3386 {0x7716, 0x05},
3387 {0x7717, 0x32},
3388 {0x7718, 0x05},
3389 {0x7719, 0x30},
3390 {0x771a, 0x00},
3391 {0x771b, 0x02},
3392 {0x771c, 0x05},
3393 {0x771d, 0x78},
3394 {0x771e, 0x00},
3395 {0x771f, 0x01},
3396 {0x7720, 0x05},
3397 {0x7721, 0x7c},
3398 {0x7722, 0x03},
3399 {0x7723, 0x94},
3400 {0x7724, 0x05},
3401 {0x7725, 0x83},
3402 {0x7726, 0x00},
3403 {0x7727, 0x01},
3404 {0x7728, 0x05},
3405 {0x7729, 0x03},
3406 {0x772a, 0x00},
3407 {0x772b, 0x01},
3408 {0x772c, 0x05},
3409 {0x772d, 0x32},
3410 {0x772e, 0x05},
3411 {0x772f, 0x30},
3412 {0x7730, 0x00},
3413 {0x7731, 0x02},
3414 {0x7732, 0x05},
3415 {0x7733, 0x78},
3416 {0x7734, 0x00},
3417 {0x7735, 0x01},
3418 {0x7736, 0x05},
3419 {0x7737, 0x7c},
3420 {0x7738, 0x03},
3421 {0x7739, 0x93},
3422 {0x773a, 0x05},
3423 {0x773b, 0x83},
3424 {0x773c, 0x00},
3425 {0x773d, 0x00},
3426 {0x773e, 0x05},
3427 {0x773f, 0x03},
3428 {0x7740, 0x00},
3429 {0x7741, 0x00},
3430 {0x7742, 0x05},
3431 {0x7743, 0x32},
3432 {0x7744, 0x05},
3433 {0x7745, 0x30},
3434 {0x7746, 0x00},
3435 {0x7747, 0x02},
3436 {0x7748, 0x05},
3437 {0x7749, 0x78},
3438 {0x774a, 0x00},
3439 {0x774b, 0x01},
3440 {0x774c, 0x05},
3441 {0x774d, 0x7c},
3442 {0x774e, 0x03},
3443 {0x774f, 0x92},
3444 {0x7750, 0x05},
3445 {0x7751, 0x83},
3446 {0x7752, 0x05},
3447 {0x7753, 0x03},
3448 {0x7754, 0x00},
3449 {0x7755, 0x00},
3450 {0x7756, 0x05},
3451 {0x7757, 0x32},
3452 {0x7758, 0x05},
3453 {0x7759, 0x30},
3454 {0x775a, 0x00},
3455 {0x775b, 0x02},
3456 {0x775c, 0x05},
3457 {0x775d, 0x78},
3458 {0x775e, 0x00},
3459 {0x775f, 0x01},
3460 {0x7760, 0x05},
3461 {0x7761, 0x7c},
3462 {0x7762, 0x03},
3463 {0x7763, 0x91},
3464 {0x7764, 0x05},
3465 {0x7765, 0x83},
3466 {0x7766, 0x05},
3467 {0x7767, 0x03},
3468 {0x7768, 0x05},
3469 {0x7769, 0x32},
3470 {0x776a, 0x05},
3471 {0x776b, 0x30},
3472 {0x776c, 0x00},
3473 {0x776d, 0x02},
3474 {0x776e, 0x05},
3475 {0x776f, 0x78},
3476 {0x7770, 0x00},
3477 {0x7771, 0x01},
3478 {0x7772, 0x05},
3479 {0x7773, 0x7c},
3480 {0x7774, 0x03},
3481 {0x7775, 0x90},
3482 {0x7776, 0x05},
3483 {0x7777, 0x83},
3484 {0x7778, 0x05},
3485 {0x7779, 0x03},
3486 {0x777a, 0x05},
3487 {0x777b, 0x32},
3488 {0x777c, 0x05},
3489 {0x777d, 0x30},
3490 {0x777e, 0x00},
3491 {0x777f, 0x02},
3492 {0x7780, 0x05},
3493 {0x7781, 0x78},
3494 {0x7782, 0x00},
3495 {0x7783, 0x01},
3496 {0x7784, 0x05},
3497 {0x7785, 0x7c},
3498 {0x7786, 0x02},
3499 {0x7787, 0x90},
3500 {0x7788, 0x05},
3501 {0x7789, 0x03},
3502 {0x778a, 0x07},
3503 {0x778b, 0x00},
3504 {0x778c, 0x0f},
3505 {0x778d, 0x00},
3506 {0x778e, 0x08},
3507 {0x778f, 0x30},
3508 {0x7790, 0x08},
3509 {0x7791, 0xee},
3510 {0x7792, 0x0f},
3511 {0x7793, 0x00},
3512 {0x7794, 0x05},
3513 {0x7795, 0x33},
3514 {0x7796, 0x04},
3515 {0x7797, 0xe5},
3516 {0x7798, 0x06},
3517 {0x7799, 0x52},
3518 {0x779a, 0x04},
3519 {0x779b, 0xe4},
3520 {0x779c, 0x00},
3521 {0x779d, 0x00},
3522 {0x779e, 0x06},
3523 {0x779f, 0x5e},
3524 {0x77a0, 0x00},
3525 {0x77a1, 0x0f},
3526 {0x77a2, 0x06},
3527 {0x77a3, 0x1e},
3528 {0x77a4, 0x00},
3529 {0x77a5, 0x02},
3530 {0x77a6, 0x06},
3531 {0x77a7, 0xa2},
3532 {0x77a8, 0x00},
3533 {0x77a9, 0x01},
3534 {0x77aa, 0x06},
3535 {0x77ab, 0xae},
3536 {0x77ac, 0x00},
3537 {0x77ad, 0x03},
3538 {0x77ae, 0x05},
3539 {0x77af, 0x30},
3540 {0x77b0, 0x09},
3541 {0x77b1, 0x19},
3542 {0x77b2, 0x0f},
3543 {0x77b3, 0x00},
3544 {0x77b4, 0x05},
3545 {0x77b5, 0x33},
3546 {0x77b6, 0x04},
3547 {0x77b7, 0xe5},
3548 {0x77b8, 0x06},
3549 {0x77b9, 0x52},
3550 {0x77ba, 0x04},
3551 {0x77bb, 0xe4},
3552 {0x77bc, 0x00},
3553 {0x77bd, 0x00},
3554 {0x77be, 0x06},
3555 {0x77bf, 0x5e},
3556 {0x77c0, 0x00},
3557 {0x77c1, 0x0f},
3558 {0x77c2, 0x06},
3559 {0x77c3, 0x1e},
3560 {0x77c4, 0x00},
3561 {0x77c5, 0x02},
3562 {0x77c6, 0x06},
3563 {0x77c7, 0xa2},
3564 {0x77c8, 0x00},
3565 {0x77c9, 0x01},
3566 {0x77ca, 0x06},
3567 {0x77cb, 0xae},
3568 {0x77cc, 0x00},
3569 {0x77cd, 0x03},
3570 {0x77ce, 0x05},
3571 {0x77cf, 0x30},
3572 {0x77d0, 0x0f},
3573 {0x77d1, 0x00},
3574 {0x77d2, 0x00},
3575 {0x77d3, 0x00},
3576 {0x77d4, 0x00},
3577 {0x77d5, 0x02},
3578 {0x77d6, 0x04},
3579 {0x77d7, 0xe5},
3580 {0x77d8, 0x04},
3581 {0x77d9, 0xe4},
3582 {0x77da, 0x05},
3583 {0x77db, 0x33},
3584 {0x77dc, 0x07},
3585 {0x77dd, 0x10},
3586 {0x77de, 0x00},
3587 {0x77df, 0x00},
3588 {0x77e0, 0x01},
3589 {0x77e1, 0xbb},
3590 {0x77e2, 0x00},
3591 {0x77e3, 0x00},
3592 {0x77e4, 0x01},
3593 {0x77e5, 0xaa},
3594 {0x77e6, 0x00},
3595 {0x77e7, 0x00},
3596 {0x77e8, 0x01},
3597 {0x77e9, 0x99},
3598 {0x77ea, 0x00},
3599 {0x77eb, 0x00},
3600 {0x77ec, 0x01},
3601 {0x77ed, 0x88},
3602 {0x77ee, 0x00},
3603 {0x77ef, 0x00},
3604 {0x77f0, 0x01},
3605 {0x77f1, 0x77},
3606 {0x77f2, 0x00},
3607 {0x77f3, 0x00},
3608 {0x77f4, 0x01},
3609 {0x77f5, 0x66},
3610 {0x77f6, 0x00},
3611 {0x77f7, 0x00},
3612 {0x77f8, 0x01},
3613 {0x77f9, 0x55},
3614 {0x77fa, 0x00},
3615 {0x77fb, 0x00},
3616 {0x77fc, 0x01},
3617 {0x77fd, 0x44},
3618 {0x77fe, 0x00},
3619 {0x77ff, 0x00},
3620 {0x7800, 0x01},
3621 {0x7801, 0x33},
3622 {0x7802, 0x00},
3623 {0x7803, 0x00},
3624 {0x7804, 0x01},
3625 {0x7805, 0x22},
3626 {0x7806, 0x00},
3627 {0x7807, 0x00},
3628 {0x7808, 0x01},
3629 {0x7809, 0x11},
3630 {0x780a, 0x00},
3631 {0x780b, 0x00},
3632 {0x780c, 0x01},
3633 {0x780d, 0x00},
3634 {0x780e, 0x01},
3635 {0x780f, 0xff},
3636 {0x7810, 0x07},
3637 {0x7811, 0x00},
3638 {0x7812, 0x02},
3639 {0x7813, 0xa0},
3640 {0x7814, 0x0f},
3641 {0x7815, 0x00},
3642 {0x7816, 0x08},
3643 {0x7817, 0x35},
3644 {0x7818, 0x06},
3645 {0x7819, 0x52},
3646 {0x781a, 0x04},
3647 {0x781b, 0xe4},
3648 {0x781c, 0x00},
3649 {0x781d, 0x00},
3650 {0x781e, 0x06},
3651 {0x781f, 0x5e},
3652 {0x7820, 0x05},
3653 {0x7821, 0x33},
3654 {0x7822, 0x09},
3655 {0x7823, 0x19},
3656 {0x7824, 0x06},
3657 {0x7825, 0x1e},
3658 {0x7826, 0x05},
3659 {0x7827, 0x33},
3660 {0x7828, 0x00},
3661 {0x7829, 0x01},
3662 {0x782a, 0x06},
3663 {0x782b, 0x24},
3664 {0x782c, 0x06},
3665 {0x782d, 0x20},
3666 {0x782e, 0x0f},
3667 {0x782f, 0x00},
3668 {0x7830, 0x08},
3669 {0x7831, 0x35},
3670 {0x7832, 0x07},
3671 {0x7833, 0x10},
3672 {0x7834, 0x00},
3673 {0x7835, 0x00},
3674 {0x7836, 0x01},
3675 {0x7837, 0xbb},
3676 {0x7838, 0x00},
3677 {0x7839, 0x00},
3678 {0x783a, 0x01},
3679 {0x783b, 0xaa},
3680 {0x783c, 0x00},
3681 {0x783d, 0x00},
3682 {0x783e, 0x01},
3683 {0x783f, 0x99},
3684 {0x7840, 0x00},
3685 {0x7841, 0x00},
3686 {0x7842, 0x01},
3687 {0x7843, 0x88},
3688 {0x7844, 0x00},
3689 {0x7845, 0x00},
3690 {0x7846, 0x01},
3691 {0x7847, 0x77},
3692 {0x7848, 0x00},
3693 {0x7849, 0x00},
3694 {0x784a, 0x01},
3695 {0x784b, 0x66},
3696 {0x784c, 0x00},
3697 {0x784d, 0x00},
3698 {0x784e, 0x01},
3699 {0x784f, 0x55},
3700 {0x7850, 0x00},
3701 {0x7851, 0x00},
3702 {0x7852, 0x01},
3703 {0x7853, 0x44},
3704 {0x7854, 0x00},
3705 {0x7855, 0x00},
3706 {0x7856, 0x01},
3707 {0x7857, 0x33},
3708 {0x7858, 0x00},
3709 {0x7859, 0x00},
3710 {0x785a, 0x01},
3711 {0x785b, 0x22},
3712 {0x785c, 0x00},
3713 {0x785d, 0x00},
3714 {0x785e, 0x01},
3715 {0x785f, 0x11},
3716 {0x7860, 0x00},
3717 {0x7861, 0x00},
3718 {0x7862, 0x01},
3719 {0x7863, 0x00},
3720 {0x7864, 0x07},
3721 {0x7865, 0x00},
3722 {0x7866, 0x01},
3723 {0x7867, 0xff},
3724 {0x7868, 0x02},
3725 {0x7869, 0xa0},
3726 {0x786a, 0x0f},
3727 {0x786b, 0x00},
3728 {0x786c, 0x08},
3729 {0x786d, 0x3a},
3730 {0x786e, 0x08},
3731 {0x786f, 0x6a},
3732 {0x7870, 0x0f},
3733 {0x7871, 0x00},
3734 {0x7872, 0x04},
3735 {0x7873, 0xc0},
3736 {0x7874, 0x09},
3737 {0x7875, 0x19},
3738 {0x7876, 0x04},
3739 {0x7877, 0x99},
3740 {0x7878, 0x07},
3741 {0x7879, 0x14},
3742 {0x787a, 0x00},
3743 {0x787b, 0x01},
3744 {0x787c, 0x04},
3745 {0x787d, 0xa4},
3746 {0x787e, 0x00},
3747 {0x787f, 0x0f},
3748 {0x7880, 0x00},
3749 {0x7881, 0x0f},
3750 {0x7882, 0x04},
3751 {0x7883, 0xa6},
3752 {0x7884, 0x00},
3753 {0x7885, 0x00},
3754 {0x7886, 0x04},
3755 {0x7887, 0xa0},
3756 {0x7888, 0x04},
3757 {0x7889, 0x80},
3758 {0x788a, 0x04},
3759 {0x788b, 0x00},
3760 {0x788c, 0x05},
3761 {0x788d, 0x03},
3762 {0x788e, 0x06},
3763 {0x788f, 0x00},
3764 {0x7890, 0x0f},
3765 {0x7891, 0x00},
3766 {0x7892, 0x0f},
3767 {0x7893, 0x00},
3768 {0x7894, 0x0f},
3769 {0x7895, 0x00},
3770 {0x30a0, 0x00},
3771 {0x30a1, 0x04},
3772 {0x30a2, 0x00},
3773 {0x30a3, 0x04},
3774 {0x30a4, 0x07},
3775 {0x30a5, 0x8B},
3776 {0x30a6, 0x04},
3777 {0x30a7, 0x43},
3778 {0x30a8, 0x00},
3779 {0x30a9, 0x04},
3780 {0x30aa, 0x00},
3781 {0x30ab, 0x04},
3782 {0x30ac, 0x07},
3783 {0x30ad, 0x80},
3784 {0x30ae, 0x04},
3785 {0x30af, 0x38},
3786 {0x30b0, 0x0d},
3787 {0x30b1, 0xde},
3788 {0x30b2, 0x04},
3789 {0x30b3, 0x66},
3790 {0x3196, 0x00},
3791 {0x3197, 0x0a},
3792 {0x3195, 0x29},
3793 {0x30bb, 0x14},
3794 {0x315a, 0x02},
3795 {0x315b, 0x00},
3796 {0x315c, 0x01},
3797 {0x315d, 0x80},
3798 {0x315e, 0x01},
3799 {0x315f, 0x80},
3800 {0x3250, 0xf7},
3801 {REG_NULL, 0x00},
3802 };
3803
3804 static const struct ov2775_mode supported_modes[] = {
3805 {
3806 .bus_fmt = MEDIA_BUS_FMT_SBGGR12_1X12,
3807 .width = 1920,
3808 .height = 1080,
3809 .max_fps = {
3810 .numerator = 10000,
3811 .denominator = 300000,
3812 },
3813 .exp_def = 0x0010,
3814 .hts_def = 0x0dde,
3815 .vts_def = 0x0466,
3816 .hdr_mode = NO_HDR,
3817 .bpp = 12,
3818 .lane = 4,
3819 .reg_list = ov2775_linear12bit_init_tab_1920_1080,
3820 .vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
3821 },
3822 {
3823 .bus_fmt = MEDIA_BUS_FMT_SBGGR12_1X12,
3824 .width = 1920,
3825 .height = 1080,
3826 .max_fps = {
3827 .numerator = 10000,
3828 .denominator = 300000,
3829 },
3830 .exp_def = 0x0010,
3831 .hts_def = 0x0dde,
3832 .vts_def = 0x0466,
3833 .hdr_mode = HDR_X2,
3834 .bpp = 12,
3835 .lane = 4,
3836 .reg_list = ov2775_hdr12bit_init_tab_1920_1080,
3837 .vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_1,
3838 .vc[PAD1] = V4L2_MBUS_CSI2_CHANNEL_0,
3839 .vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_1,
3840 .vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_1,
3841 },
3842 };
3843
3844 static const s64 link_freq_menu_items[] = {
3845 OV2775_LINK_FREQ_480MHZ
3846 };
3847
3848 static const char * const ov2775_test_pattern_menu[] = {
3849 "Disabled",
3850 "Vertical Color Bar Type 1",
3851 "Vertical Color Bar Type 2",
3852 "Vertical Color Bar Type 3",
3853 "Vertical Color Bar Type 4"
3854 };
3855
ov2775_write_reg(struct i2c_client * client,u16 reg,u32 len,u32 val)3856 static int ov2775_write_reg(struct i2c_client *client, u16 reg,
3857 u32 len, u32 val)
3858 {
3859 int ret = -1;
3860 struct i2c_msg msg[1];
3861 unsigned char data[5];
3862 int retries;
3863
3864 for (retries = 0; retries < 5; retries++) {
3865 msg->addr = client->addr;
3866 msg->flags = 0;
3867 msg->len = 3;
3868 msg->buf = data;
3869
3870 /* high byte goes out first */
3871 data[0] = (u8)(reg >> 8);
3872 data[1] = (u8)(reg & 0xff);
3873
3874 switch (len) {
3875 case OV2775_REG_VALUE_08BIT:
3876 data[2] = val;
3877 break;
3878 case OV2775_REG_VALUE_16BIT:
3879 data[2] = (u8)(val >> 8);
3880 data[3] = (u8)(val & 0xff);
3881 break;
3882 case OV2775_REG_VALUE_24BIT:
3883 data[2] = (u8)(val >> 16);
3884 data[3] = (u8)(val >> 8);
3885 data[3] = (u8)(val & 0xff);
3886 break;
3887 }
3888
3889 ret = i2c_transfer(client->adapter, msg, 1);
3890 if (ret == 1)
3891 return 0;
3892
3893 set_current_state(TASK_UNINTERRUPTIBLE);
3894 schedule_timeout(msecs_to_jiffies(20));
3895 }
3896
3897 return ret;
3898 }
3899
ov2775_write_array(struct i2c_client * client,const struct regval * regs)3900 static int ov2775_write_array(struct i2c_client *client,
3901 const struct regval *regs)
3902 {
3903 u32 i;
3904 int ret = 0;
3905
3906 for (i = 0; ret == 0 && regs[i].addr != REG_NULL; i++) {
3907 if (unlikely(regs[i].addr == REG_DELAY))
3908 usleep_range(regs[i].val, regs[i].val * 2);
3909 else
3910 ret = ov2775_write_reg(client, regs[i].addr,
3911 OV2775_REG_VALUE_08BIT,
3912 regs[i].val);
3913 }
3914
3915 return ret;
3916 }
3917
ov2775_read_reg(struct i2c_client * client,u16 reg,u32 len,u32 * val)3918 static int ov2775_read_reg(struct i2c_client *client, u16 reg,
3919 u32 len, u32 *val)
3920 {
3921 int ret = 0;
3922 struct i2c_msg msg[1];
3923 unsigned char data[4] = { 0, 0, 0, 0 };
3924
3925 msg->addr = client->addr;
3926 msg->flags = 0;
3927 msg->buf = data;
3928
3929 /* High byte goes out first */
3930 data[0] = (u8)(reg >> 8);
3931 data[1] = (u8)(reg & 0xff);
3932 msg->len = 2;
3933 ret = i2c_transfer(client->adapter, msg, 1);
3934 if (ret >= 0) {
3935 usleep_range(3000, 4000);
3936 msg->flags = I2C_M_RD;
3937 msg->len = len;
3938 i2c_transfer(client->adapter, msg, 1);
3939 }
3940 if (ret >= 0) {
3941 *val = 0;
3942 /* High byte comes first */
3943 if (len == 1)
3944 *val = data[0];
3945 else if (len == 2)
3946 *val = data[1] + (data[0] << 8);
3947 else
3948 *val = data[3] + (data[2] << 8) +
3949 (data[1] << 16) + (data[0] << 24);
3950 return 0;
3951 }
3952
3953 return ret;
3954 }
3955
ov2775_get_reso_dist(const struct ov2775_mode * mode,struct v4l2_mbus_framefmt * framefmt)3956 static int ov2775_get_reso_dist(const struct ov2775_mode *mode,
3957 struct v4l2_mbus_framefmt *framefmt)
3958 {
3959 return abs(mode->width - framefmt->width) +
3960 abs(mode->height - framefmt->height);
3961 }
3962
3963 static const struct ov2775_mode *
ov2775_find_best_fit(struct v4l2_subdev * sd,struct v4l2_subdev_format * fmt)3964 ov2775_find_best_fit(struct v4l2_subdev *sd,
3965 struct v4l2_subdev_format *fmt)
3966 {
3967 struct ov2775 *ov2775 = to_ov2775(sd);
3968 struct v4l2_mbus_framefmt *framefmt = &fmt->format;
3969 int dist;
3970 int cur_best_fit = 0;
3971 int cur_best_fit_dist = -1;
3972 unsigned int i;
3973
3974 for (i = 0; i < ov2775->support_modes_num; i++) {
3975 dist = ov2775_get_reso_dist(&ov2775->support_modes[i],
3976 framefmt);
3977 if (cur_best_fit_dist == -1 || dist < cur_best_fit_dist) {
3978 cur_best_fit_dist = dist;
3979 cur_best_fit = i;
3980 }
3981 }
3982
3983 return &ov2775->support_modes[cur_best_fit];
3984 }
3985
ov2775_set_fmt(struct v4l2_subdev * sd,struct v4l2_subdev_pad_config * cfg,struct v4l2_subdev_format * fmt)3986 static int ov2775_set_fmt(struct v4l2_subdev *sd,
3987 struct v4l2_subdev_pad_config *cfg,
3988 struct v4l2_subdev_format *fmt)
3989 {
3990 struct ov2775 *ov2775 = to_ov2775(sd);
3991 const struct ov2775_mode *mode;
3992 s64 h_blank, vblank_def;
3993
3994 mutex_lock(&ov2775->mutex);
3995
3996 mode = ov2775_find_best_fit(sd, fmt);
3997 fmt->format.code = mode->bus_fmt;
3998 fmt->format.width = mode->width;
3999 fmt->format.height = mode->height;
4000 fmt->format.field = V4L2_FIELD_NONE;
4001 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
4002 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
4003 *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
4004 #else
4005 mutex_unlock(&ov2775->mutex);
4006 return -ENOTTY;
4007 #endif
4008 } else {
4009 ov2775->cur_mode = mode;
4010 h_blank = mode->hts_def - mode->width;
4011 __v4l2_ctrl_modify_range(ov2775->hblank, h_blank,
4012 h_blank, 1, h_blank);
4013 vblank_def = mode->vts_def - mode->height;
4014 __v4l2_ctrl_modify_range(ov2775->vblank, vblank_def,
4015 OV2775_VTS_MAX - mode->height,
4016 1, vblank_def);
4017 }
4018
4019 mutex_unlock(&ov2775->mutex);
4020
4021 return 0;
4022 }
4023
ov2775_get_fmt(struct v4l2_subdev * sd,struct v4l2_subdev_pad_config * cfg,struct v4l2_subdev_format * fmt)4024 static int ov2775_get_fmt(struct v4l2_subdev *sd,
4025 struct v4l2_subdev_pad_config *cfg,
4026 struct v4l2_subdev_format *fmt)
4027 {
4028 struct ov2775 *ov2775 = to_ov2775(sd);
4029 const struct ov2775_mode *mode = ov2775->cur_mode;
4030
4031 mutex_lock(&ov2775->mutex);
4032 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
4033 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
4034 fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
4035 #else
4036 mutex_unlock(&ov2775->mutex);
4037 return -ENOTTY;
4038 #endif
4039 } else {
4040 fmt->format.width = mode->width;
4041 fmt->format.height = mode->height;
4042 fmt->format.code = mode->bus_fmt;
4043 fmt->format.field = V4L2_FIELD_NONE;
4044 if (fmt->pad < PAD_MAX && mode->hdr_mode != NO_HDR)
4045 fmt->reserved[0] = mode->vc[fmt->pad];
4046 else
4047 fmt->reserved[0] = mode->vc[PAD0];
4048 }
4049 mutex_unlock(&ov2775->mutex);
4050
4051 return 0;
4052 }
4053
ov2775_enum_mbus_code(struct v4l2_subdev * sd,struct v4l2_subdev_pad_config * cfg,struct v4l2_subdev_mbus_code_enum * code)4054 static int ov2775_enum_mbus_code(struct v4l2_subdev *sd,
4055 struct v4l2_subdev_pad_config *cfg,
4056 struct v4l2_subdev_mbus_code_enum *code)
4057 {
4058 struct ov2775 *ov2775 = to_ov2775(sd);
4059
4060 if (code->index != 0)
4061 return -EINVAL;
4062 code->code = ov2775->support_modes[0].bus_fmt;
4063
4064 return 0;
4065 }
4066
ov2775_enum_frame_sizes(struct v4l2_subdev * sd,struct v4l2_subdev_pad_config * cfg,struct v4l2_subdev_frame_size_enum * fse)4067 static int ov2775_enum_frame_sizes(struct v4l2_subdev *sd,
4068 struct v4l2_subdev_pad_config *cfg,
4069 struct v4l2_subdev_frame_size_enum *fse)
4070 {
4071 struct ov2775 *ov2775 = to_ov2775(sd);
4072
4073 if (fse->index >= ov2775->support_modes_num)
4074 return -EINVAL;
4075
4076 if (fse->code != ov2775->support_modes[0].bus_fmt)
4077 return -EINVAL;
4078
4079 fse->min_width = ov2775->support_modes[fse->index].width;
4080 fse->max_width = ov2775->support_modes[fse->index].width;
4081 fse->max_height = ov2775->support_modes[fse->index].height;
4082 fse->min_height = ov2775->support_modes[fse->index].height;
4083
4084 return 0;
4085 }
4086
ov2775_enable_test_pattern(struct ov2775 * ov2775,u32 pattern)4087 static int ov2775_enable_test_pattern(struct ov2775 *ov2775, u32 pattern)
4088 {
4089 u32 val;
4090
4091 if (pattern)
4092 val = (pattern - 1) | OV2775_TEST_PATTERN_ENABLE;
4093 else
4094 val = OV2775_TEST_PATTERN_DISABLE;
4095
4096 return ov2775_write_reg(ov2775->client, OV2775_REG_TEST_PATTERN,
4097 OV2775_REG_VALUE_08BIT, val);
4098 }
4099
ov2775_g_frame_interval(struct v4l2_subdev * sd,struct v4l2_subdev_frame_interval * fi)4100 static int ov2775_g_frame_interval(struct v4l2_subdev *sd,
4101 struct v4l2_subdev_frame_interval *fi)
4102 {
4103 struct ov2775 *ov2775 = to_ov2775(sd);
4104 const struct ov2775_mode *mode = ov2775->cur_mode;
4105
4106 fi->interval = mode->max_fps;
4107
4108 return 0;
4109 }
4110
ov2775_get_lcg_reg(u32 gain,u32 * again_reg,u32 * dgain_reg)4111 static void ov2775_get_lcg_reg(u32 gain, u32 *again_reg, u32 *dgain_reg)
4112 {
4113 u32 again;
4114 u32 dgain;
4115
4116 /* LCG,min A_gain is 2x,min D_gain is 1.09375x,min T_Gain is 3x */
4117 if (gain < 0x300) {
4118 /* T_Gain < 3, error */
4119 *again_reg = 0x01;
4120 *dgain_reg = 0x118;
4121 } else if (gain < 0x460) {
4122 /* A_gain is 2x */
4123 again = 0x200;
4124 *again_reg = 0x01;
4125 } else if (gain < 0x8c0) {
4126 /* T_Gain >= 4.375x, A_gain is 4x */
4127 again = 0x400;
4128 *again_reg = 0x02;
4129 } else {
4130 /* T_Gain >= 8.75x, A_gain is 8x */
4131 again = 0x800;
4132 *again_reg = 0x03;
4133 }
4134
4135 if (gain >= 0x300) {
4136 dgain = (gain * 0x100 + 0x80) / again;
4137 if (dgain < 0x118)
4138 dgain = 0x118;
4139
4140 *dgain_reg = dgain;
4141 }
4142 }
4143
ov2775_get_hcg_reg(u32 gain,u32 * again_reg,u32 * dgain_reg)4144 static void ov2775_get_hcg_reg(u32 gain, u32 *again_reg, u32 *dgain_reg)
4145 {
4146 u32 again;
4147 u32 dgain;
4148
4149 /* HCG,T_Gain >= 22x,min A_gain is 1x,min D_gain is 2.0x */
4150 if (gain < 0x200) {
4151 /* T_Gain < 22, error */
4152 *again_reg = 0x00;
4153 *dgain_reg = 0x200;
4154 } else if (gain < 0x400) {
4155 /* T_Gain >= 22x, A_gain is 1x */
4156 again = 0x100;
4157 *again_reg = 0x00;
4158 } else if (gain < 0x800) {
4159 /* T_Gain >= 44x, A_gain is 2x */
4160 again = 0x200;
4161 *again_reg = 0x01;
4162 } else if (gain < 0x1000) {
4163 /* T_Gain >= 88x, A_gain is 4x */
4164 again = 0x400;
4165 *again_reg = 0x02;
4166 } else {
4167 /* T_Gain >= 176x, A_gain is 8x */
4168 again = 0x800;
4169 *again_reg = 0x03;
4170 }
4171
4172 if (gain >= 0x200) {
4173 dgain = (gain * 0x100 + 0x80) / again;
4174 if (dgain < 0x200)
4175 dgain = 0x200;
4176
4177 *dgain_reg = dgain;
4178 }
4179 }
4180
ov2775_g_mbus_config(struct v4l2_subdev * sd,struct v4l2_mbus_config * config)4181 static int ov2775_g_mbus_config(struct v4l2_subdev *sd,
4182 struct v4l2_mbus_config *config)
4183 {
4184 struct ov2775 *ov2775 = to_ov2775(sd);
4185 const struct ov2775_mode *mode = ov2775->cur_mode;
4186 u32 val = 0;
4187
4188 if (mode->hdr_mode == NO_HDR)
4189 val = 1 << (mode->lane - 1) |
4190 V4L2_MBUS_CSI2_CHANNEL_0 |
4191 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
4192 if (mode->hdr_mode == HDR_X2)
4193 val = 1 << (mode->lane - 1) |
4194 V4L2_MBUS_CSI2_CHANNEL_0 |
4195 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK |
4196 V4L2_MBUS_CSI2_CHANNEL_1;
4197
4198 config->type = V4L2_MBUS_CSI2;
4199 config->flags = val;
4200
4201 return 0;
4202 }
4203
ov2775_get_module_inf(struct ov2775 * ov2775,struct rkmodule_inf * inf)4204 static void ov2775_get_module_inf(struct ov2775 *ov2775,
4205 struct rkmodule_inf *inf)
4206 {
4207 memset(inf, 0, sizeof(*inf));
4208 strlcpy(inf->base.sensor, OV2775_NAME, sizeof(inf->base.sensor));
4209 strlcpy(inf->base.module, ov2775->module_name,
4210 sizeof(inf->base.module));
4211 strlcpy(inf->base.lens, ov2775->len_name, sizeof(inf->base.lens));
4212 }
4213
ov2775_ioctl(struct v4l2_subdev * sd,unsigned int cmd,void * arg)4214 static long ov2775_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
4215 {
4216 struct ov2775 *ov2775 = to_ov2775(sd);
4217 struct i2c_client *client = ov2775->client;
4218 struct preisp_hdrae_exp_s *hdrae_exp = arg;
4219 struct rkmodule_hdr_cfg *hdr_cfg;
4220 u32 s_again, s_dgain, l_again, l_dgain;
4221 u32 again, i, h, w;
4222 long ret = 0;
4223 u32 stream = 0;
4224
4225 switch (cmd) {
4226 case PREISP_CMD_SET_HDRAE_EXP:
4227 if (!ov2775->has_init_exp && !ov2775->streaming) {
4228 ov2775->init_hdrae_exp = *hdrae_exp;
4229 ov2775->has_init_exp = true;
4230 dev_info(&client->dev, "ov2775 don't streaming, record exp for hdr!\n");
4231 break;
4232 }
4233 dev_dbg(&client->dev,
4234 "rev exp req: L_exp: 0x%x, 0x%x, S_exp: 0x%x, 0x%x\n",
4235 hdrae_exp->middle_exp_reg,
4236 hdrae_exp->middle_gain_reg,
4237 hdrae_exp->short_exp_reg,
4238 hdrae_exp->short_gain_reg);
4239
4240 ov2775_get_hcg_reg(hdrae_exp->middle_gain_reg,
4241 &l_again,
4242 &l_dgain);
4243 ov2775_get_lcg_reg(hdrae_exp->short_gain_reg,
4244 &s_again,
4245 &s_dgain);
4246
4247 again = s_again << 2 | l_again;
4248
4249 ret = ov2775_write_reg(ov2775->client,
4250 OV2775_REG_OPERATE_CTL,
4251 OV2775_REG_VALUE_08BIT,
4252 0x00);
4253
4254 /* group 0 */
4255 ret |= ov2775_write_reg(ov2775->client,
4256 OV2775_REG_GROUP_CTL,
4257 OV2775_REG_VALUE_08BIT,
4258 0x00);
4259
4260 ret |= ov2775_write_reg(ov2775->client,
4261 OV2775_REG_EXPOSURE_H |
4262 OV2775_REG_GROUP_BIT,
4263 OV2775_REG_VALUE_08BIT,
4264 (hdrae_exp->middle_exp_reg >> 8) & 0xFF);
4265
4266 ret |= ov2775_write_reg(ov2775->client,
4267 OV2775_REG_EXPOSURE_L |
4268 OV2775_REG_GROUP_BIT,
4269 OV2775_REG_VALUE_08BIT,
4270 hdrae_exp->middle_exp_reg & 0xFF);
4271
4272 ret |= ov2775_write_reg(ov2775->client,
4273 OV2775_REG_GAIN |
4274 OV2775_REG_GROUP_BIT,
4275 OV2775_REG_VALUE_08BIT,
4276 again);
4277
4278 ret |= ov2775_write_reg(ov2775->client,
4279 OV2775_REG_DIG_GAIN_HCG_H |
4280 OV2775_REG_GROUP_BIT,
4281 OV2775_REG_VALUE_08BIT,
4282 (l_dgain >> 8) & 0xFF);
4283
4284 ret |= ov2775_write_reg(ov2775->client,
4285 OV2775_REG_DIG_GAIN_HCG_L |
4286 OV2775_REG_GROUP_BIT,
4287 OV2775_REG_VALUE_08BIT,
4288 l_dgain & 0xFF);
4289
4290 ret |= ov2775_write_reg(ov2775->client,
4291 OV2775_REG_DIG_GAIN_LCG_H |
4292 OV2775_REG_GROUP_BIT,
4293 OV2775_REG_VALUE_08BIT,
4294 (s_dgain >> 8) & 0xFF);
4295
4296 ret |= ov2775_write_reg(ov2775->client,
4297 OV2775_REG_DIG_GAIN_LCG_L |
4298 OV2775_REG_GROUP_BIT,
4299 OV2775_REG_VALUE_08BIT,
4300 s_dgain & 0xFF);
4301
4302 /* launch immediately */
4303 ret |= ov2775_write_reg(ov2775->client,
4304 OV2775_REG_GROUP_CTL,
4305 OV2775_REG_VALUE_08BIT,
4306 0x40);
4307
4308 /* single start */
4309 ret |= ov2775_write_reg(ov2775->client,
4310 OV2775_REG_OPERATE_CTL,
4311 OV2775_REG_VALUE_08BIT,
4312 0x01);
4313
4314 dev_dbg(&client->dev, "set to reg, exp: 0x%02x, again: 0x%02x, l_dgain: 0x%02x, s_dgain: 0x%02x\n",
4315 hdrae_exp->middle_exp_reg,
4316 again,
4317 l_dgain,
4318 s_dgain);
4319 break;
4320 case RKMODULE_GET_HDR_CFG:
4321 hdr_cfg = (struct rkmodule_hdr_cfg *)arg;
4322 hdr_cfg->esp.mode = HDR_NORMAL_VC;
4323 hdr_cfg->hdr_mode = ov2775->cur_mode->hdr_mode;
4324 break;
4325 case RKMODULE_GET_MODULE_INFO:
4326 ov2775_get_module_inf(ov2775, (struct rkmodule_inf *)arg);
4327 break;
4328 case RKMODULE_SET_HDR_CFG:
4329 hdr_cfg = (struct rkmodule_hdr_cfg *)arg;
4330 w = ov2775->cur_mode->width;
4331 h = ov2775->cur_mode->height;
4332 for (i = 0; i < ov2775->support_modes_num; i++) {
4333 if (w == supported_modes[i].width &&
4334 h == supported_modes[i].height &&
4335 supported_modes[i].hdr_mode == hdr_cfg->hdr_mode) {
4336 ov2775->cur_mode = &supported_modes[i];
4337 break;
4338 }
4339 }
4340 if (i == ov2775->support_modes_num) {
4341 dev_err(&client->dev,
4342 "not find hdr mode:%d %dx%d config\n",
4343 hdr_cfg->hdr_mode, w, h);
4344 ret = -EINVAL;
4345 } else {
4346 w = ov2775->cur_mode->hts_def - ov2775->cur_mode->width;
4347 h = ov2775->cur_mode->vts_def - ov2775->cur_mode->height;
4348 __v4l2_ctrl_modify_range(ov2775->hblank, w, w, 1, w);
4349 __v4l2_ctrl_modify_range(ov2775->vblank, h,
4350 OV2775_VTS_MAX - ov2775->cur_mode->height,
4351 1, h);
4352
4353 dev_info(&client->dev,
4354 "sensor hdr mode: %d, supported_modes[%d]\n",
4355 ov2775->cur_mode->hdr_mode, i);
4356 }
4357 break;
4358 case RKMODULE_SET_QUICK_STREAM:
4359
4360 stream = *((u32 *)arg);
4361
4362 if (stream)
4363 ret = ov2775_write_reg(ov2775->client, OV2775_REG_CTRL_MODE,
4364 OV2775_REG_VALUE_08BIT, OV2775_MODE_STREAMING);
4365 else
4366 ret = ov2775_write_reg(ov2775->client, OV2775_REG_CTRL_MODE,
4367 OV2775_REG_VALUE_08BIT, OV2775_MODE_SW_STANDBY);
4368 break;
4369 default:
4370 return -ENOIOCTLCMD;
4371 }
4372
4373 return ret;
4374 }
4375
4376 #ifdef CONFIG_COMPAT
ov2775_compat_ioctl32(struct v4l2_subdev * sd,unsigned int cmd,unsigned long arg)4377 static long ov2775_compat_ioctl32(struct v4l2_subdev *sd,
4378 unsigned int cmd, unsigned long arg)
4379 {
4380 void __user *up = compat_ptr(arg);
4381 struct rkmodule_inf *inf;
4382 struct rkmodule_awb_cfg *cfg;
4383 struct rkmodule_hdr_cfg *hdr;
4384 struct preisp_hdrae_exp_s *hdrae;
4385 long ret;
4386 u32 stream = 0;
4387
4388 switch (cmd) {
4389 case RKMODULE_GET_MODULE_INFO:
4390 inf = kzalloc(sizeof(*inf), GFP_KERNEL);
4391 if (!inf) {
4392 ret = -ENOMEM;
4393 return ret;
4394 }
4395
4396 ret = ov2775_ioctl(sd, cmd, inf);
4397 if (!ret)
4398 ret = copy_to_user(up, inf, sizeof(*inf));
4399 kfree(inf);
4400 break;
4401 case RKMODULE_GET_HDR_CFG:
4402 hdr = kzalloc(sizeof(*hdr), GFP_KERNEL);
4403 if (!hdr) {
4404 ret = -ENOMEM;
4405 return ret;
4406 }
4407
4408 ret = ov2775_ioctl(sd, cmd, hdr);
4409 if (!ret)
4410 ret = copy_to_user(up, hdr, sizeof(*hdr));
4411 kfree(hdr);
4412 break;
4413 case RKMODULE_SET_HDR_CFG:
4414 hdr = kzalloc(sizeof(*hdr), GFP_KERNEL);
4415 if (!hdr) {
4416 ret = -ENOMEM;
4417 return ret;
4418 }
4419
4420 ret = copy_from_user(hdr, up, sizeof(*hdr));
4421 if (!ret)
4422 ret = ov2775_ioctl(sd, cmd, hdr);
4423 kfree(hdr);
4424 break;
4425 case RKMODULE_AWB_CFG:
4426 cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
4427 if (!cfg) {
4428 ret = -ENOMEM;
4429 return ret;
4430 }
4431
4432 ret = copy_from_user(cfg, up, sizeof(*cfg));
4433 if (!ret)
4434 ret = ov2775_ioctl(sd, cmd, cfg);
4435 kfree(cfg);
4436 break;
4437 case PREISP_CMD_SET_HDRAE_EXP:
4438 hdrae = kzalloc(sizeof(*hdrae), GFP_KERNEL);
4439 if (!hdrae) {
4440 ret = -ENOMEM;
4441 return ret;
4442 }
4443
4444 ret = copy_from_user(hdrae, up, sizeof(*hdrae));
4445 if (!ret)
4446 ret = ov2775_ioctl(sd, cmd, hdrae);
4447 kfree(hdrae);
4448 break;
4449 case RKMODULE_SET_QUICK_STREAM:
4450 ret = copy_from_user(&stream, up, sizeof(u32));
4451 if (!ret)
4452 ret = ov2775_ioctl(sd, cmd, &stream);
4453 break;
4454 default:
4455 ret = -ENOIOCTLCMD;
4456 break;
4457 }
4458
4459 return ret;
4460 }
4461 #endif
4462
ov2775_set_flip(struct ov2775 * ov2775,u32 flip)4463 static int ov2775_set_flip(struct ov2775 *ov2775, u32 flip)
4464 {
4465 u32 mode = 0;
4466 int ret = 0;
4467
4468 ret = ov2775_read_reg(ov2775->client, OV2775_READ_MODE,
4469 OV2775_REG_VALUE_08BIT, &mode);
4470
4471 mode &= ~(OV2775_MIRROR | OV2775_FLIP);
4472 mode |= flip;
4473
4474 ret |= ov2775_write_reg(ov2775->client,
4475 OV2775_REG_OPERATE_CTL,
4476 OV2775_REG_VALUE_08BIT,
4477 0x00);
4478 if (flip & OV2775_MIRROR) {
4479 ret |= ov2775_write_reg(ov2775->client,
4480 0x30a9 | OV2775_REG_GROUP_BIT,
4481 OV2775_REG_VALUE_08BIT, 0x3);
4482 ret |= ov2775_write_reg(ov2775->client,
4483 0x3252 | OV2775_REG_GROUP_BIT,
4484 OV2775_REG_VALUE_08BIT, 0x21);
4485 } else {
4486 ret |= ov2775_write_reg(ov2775->client,
4487 0x30a9 | OV2775_REG_GROUP_BIT,
4488 OV2775_REG_VALUE_08BIT, 0x4);
4489 ret |= ov2775_write_reg(ov2775->client,
4490 0x3252 | OV2775_REG_GROUP_BIT,
4491 OV2775_REG_VALUE_08BIT, 0x20);
4492 }
4493
4494 ret |= ov2775_write_reg(ov2775->client,
4495 OV2775_READ_MODE | OV2775_REG_GROUP_BIT,
4496 OV2775_REG_VALUE_08BIT, mode);
4497 /* launch immediately */
4498 ret |= ov2775_write_reg(ov2775->client,
4499 OV2775_REG_GROUP_CTL,
4500 OV2775_REG_VALUE_08BIT,
4501 0x20);
4502
4503 /* single start */
4504 ret |= ov2775_write_reg(ov2775->client,
4505 OV2775_REG_OPERATE_CTL,
4506 OV2775_REG_VALUE_08BIT,
4507 0x01);
4508
4509 return ret;
4510 }
4511
__ov2775_start_stream(struct ov2775 * ov2775)4512 static int __ov2775_start_stream(struct ov2775 *ov2775)
4513 {
4514 int ret;
4515
4516 ret = ov2775_write_array(ov2775->client,
4517 ov2775->cur_mode->reg_list);
4518 if (ret)
4519 return ret;
4520
4521 ret = __v4l2_ctrl_handler_setup(&ov2775->ctrl_handler);
4522 /* In case these controls are set before streaming */
4523 if (ov2775->has_init_exp && ov2775->cur_mode->hdr_mode != NO_HDR) {
4524 ret = ov2775_ioctl(&ov2775->subdev, PREISP_CMD_SET_HDRAE_EXP,
4525 &ov2775->init_hdrae_exp);
4526 if (ret) {
4527 dev_err(&ov2775->client->dev,
4528 "init exp fail in hdr mode\n");
4529 return ret;
4530 }
4531 }
4532
4533 return ov2775_write_reg(ov2775->client, OV2775_REG_CTRL_MODE,
4534 OV2775_REG_VALUE_08BIT, OV2775_MODE_STREAMING);
4535 }
4536
__ov2775_stop_stream(struct ov2775 * ov2775)4537 static int __ov2775_stop_stream(struct ov2775 *ov2775)
4538 {
4539 ov2775->has_init_exp = false;
4540 return ov2775_write_reg(ov2775->client, OV2775_REG_CTRL_MODE,
4541 OV2775_REG_VALUE_08BIT, OV2775_MODE_SW_STANDBY);
4542 }
4543
ov2775_s_stream(struct v4l2_subdev * sd,int on)4544 static int ov2775_s_stream(struct v4l2_subdev *sd, int on)
4545 {
4546 struct ov2775 *ov2775 = to_ov2775(sd);
4547 struct i2c_client *client = ov2775->client;
4548 int ret = 0;
4549
4550 mutex_lock(&ov2775->mutex);
4551 on = !!on;
4552 if (on == ov2775->streaming)
4553 goto unlock_and_return;
4554
4555 if (on) {
4556 ret = pm_runtime_get_sync(&client->dev);
4557 if (ret < 0) {
4558 pm_runtime_put_noidle(&client->dev);
4559 goto unlock_and_return;
4560 }
4561
4562 ret = __ov2775_start_stream(ov2775);
4563 if (ret) {
4564 v4l2_err(sd, "start stream failed while write regs\n");
4565 pm_runtime_put(&client->dev);
4566 goto unlock_and_return;
4567 }
4568 } else {
4569 __ov2775_stop_stream(ov2775);
4570 pm_runtime_put(&client->dev);
4571 }
4572
4573 ov2775->streaming = on;
4574
4575 unlock_and_return:
4576 mutex_unlock(&ov2775->mutex);
4577
4578 return ret;
4579 }
4580
ov2775_s_power(struct v4l2_subdev * sd,int on)4581 static int ov2775_s_power(struct v4l2_subdev *sd, int on)
4582 {
4583 struct ov2775 *ov2775 = to_ov2775(sd);
4584 struct i2c_client *client = ov2775->client;
4585 int ret = 0;
4586
4587 mutex_lock(&ov2775->mutex);
4588
4589 /* If the power state is not modified - no work to do. */
4590 if (ov2775->power_on == !!on)
4591 goto unlock_and_return;
4592
4593 if (on) {
4594 ret = pm_runtime_get_sync(&client->dev);
4595 if (ret < 0) {
4596 pm_runtime_put_noidle(&client->dev);
4597 goto unlock_and_return;
4598 }
4599
4600 ov2775->power_on = true;
4601 } else {
4602 pm_runtime_put(&client->dev);
4603 ov2775->power_on = false;
4604 }
4605
4606 unlock_and_return:
4607 mutex_unlock(&ov2775->mutex);
4608
4609 return ret;
4610 }
4611
4612 /* Calculate the delay in us by clock rate and clock cycles */
ov2775_cal_delay(u32 cycles)4613 static inline u32 ov2775_cal_delay(u32 cycles)
4614 {
4615 return DIV_ROUND_UP(cycles, OV2775_XVCLK_FREQ / 1000 / 1000);
4616 }
4617
__ov2775_power_on(struct ov2775 * ov2775)4618 static int __ov2775_power_on(struct ov2775 *ov2775)
4619 {
4620 int ret;
4621 u32 delay_us;
4622 struct device *dev = &ov2775->client->dev;
4623
4624 if (!IS_ERR_OR_NULL(ov2775->pins_default)) {
4625 ret = pinctrl_select_state(ov2775->pinctrl,
4626 ov2775->pins_default);
4627 if (ret < 0)
4628 dev_err(dev, "could not set pins\n");
4629 }
4630 ret = clk_set_rate(ov2775->xvclk, OV2775_XVCLK_FREQ);
4631 if (ret < 0)
4632 dev_warn(dev, "Failed to set xvclk rate (24MHz)\n");
4633 if (clk_get_rate(ov2775->xvclk) != OV2775_XVCLK_FREQ)
4634 dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n");
4635 ret = clk_prepare_enable(ov2775->xvclk);
4636 if (ret < 0) {
4637 dev_err(dev, "Failed to enable xvclk\n");
4638 return ret;
4639 }
4640 ret = regulator_bulk_enable(OV2775_NUM_SUPPLIES, ov2775->supplies);
4641 if (ret < 0) {
4642 dev_err(dev, "Failed to enable regulators\n");
4643 goto disable_clk;
4644 }
4645 usleep_range(5000, 5100);
4646 if (!IS_ERR(ov2775->pwd_gpio)) {
4647 gpiod_direction_output(ov2775->pwd_gpio, 0);
4648 usleep_range(100, 200);
4649 }
4650
4651 if (!IS_ERR(ov2775->pd_gpio)) {
4652 gpiod_direction_output(ov2775->pd_gpio, 1);
4653 usleep_range(100, 200);
4654 }
4655
4656 if (!IS_ERR(ov2775->rst_gpio)) {
4657 gpiod_direction_output(ov2775->rst_gpio, 1);
4658 usleep_range(100, 200);
4659 gpiod_direction_output(ov2775->rst_gpio, 0);
4660 }
4661 /* 8192 cycles prior to first SCCB transaction */
4662 delay_us = ov2775_cal_delay(8192);
4663 usleep_range(delay_us * 2, delay_us * 4);
4664
4665 return 0;
4666
4667 disable_clk:
4668 clk_disable_unprepare(ov2775->xvclk);
4669
4670 return ret;
4671 }
4672
__ov2775_power_off(struct ov2775 * ov2775)4673 static void __ov2775_power_off(struct ov2775 *ov2775)
4674 {
4675 int ret;
4676 struct device *dev = &ov2775->client->dev;
4677
4678 if (!IS_ERR(ov2775->pd_gpio))
4679 gpiod_direction_output(ov2775->pd_gpio, 0);
4680
4681 clk_disable_unprepare(ov2775->xvclk);
4682
4683 if (!IS_ERR(ov2775->rst_gpio))
4684 gpiod_direction_output(ov2775->rst_gpio, 1);
4685
4686 if (!IS_ERR(ov2775->pwd_gpio))
4687 gpiod_direction_output(ov2775->pwd_gpio, 1);
4688
4689 if (!IS_ERR_OR_NULL(ov2775->pins_sleep)) {
4690 ret = pinctrl_select_state(ov2775->pinctrl,
4691 ov2775->pins_sleep);
4692 if (ret < 0)
4693 dev_err(dev, "could not set pins\n");
4694 }
4695
4696 regulator_bulk_disable(OV2775_NUM_SUPPLIES, ov2775->supplies);
4697 }
4698
ov2775_runtime_resume(struct device * dev)4699 static int ov2775_runtime_resume(struct device *dev)
4700 {
4701 struct i2c_client *client = to_i2c_client(dev);
4702 struct v4l2_subdev *sd = i2c_get_clientdata(client);
4703 struct ov2775 *ov2775 = to_ov2775(sd);
4704
4705 return __ov2775_power_on(ov2775);
4706 }
4707
ov2775_runtime_suspend(struct device * dev)4708 static int ov2775_runtime_suspend(struct device *dev)
4709 {
4710 struct i2c_client *client = to_i2c_client(dev);
4711 struct v4l2_subdev *sd = i2c_get_clientdata(client);
4712 struct ov2775 *ov2775 = to_ov2775(sd);
4713
4714 __ov2775_power_off(ov2775);
4715
4716 return 0;
4717 }
4718
4719 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
ov2775_open(struct v4l2_subdev * sd,struct v4l2_subdev_fh * fh)4720 static int ov2775_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
4721 {
4722 struct ov2775 *ov2775 = to_ov2775(sd);
4723 struct v4l2_mbus_framefmt *try_fmt =
4724 v4l2_subdev_get_try_format(sd, fh->pad, 0);
4725 const struct ov2775_mode *def_mode = &ov2775->support_modes[0];
4726
4727 mutex_lock(&ov2775->mutex);
4728 /* Initialize try_fmt */
4729 try_fmt->width = def_mode->width;
4730 try_fmt->height = def_mode->height;
4731 try_fmt->code = def_mode->bus_fmt;
4732 try_fmt->field = V4L2_FIELD_NONE;
4733
4734 mutex_unlock(&ov2775->mutex);
4735 /* No crop or compose */
4736
4737 return 0;
4738 }
4739 #endif
4740
ov2775_enum_frame_interval(struct v4l2_subdev * sd,struct v4l2_subdev_pad_config * cfg,struct v4l2_subdev_frame_interval_enum * fie)4741 static int ov2775_enum_frame_interval(struct v4l2_subdev *sd,
4742 struct v4l2_subdev_pad_config *cfg,
4743 struct v4l2_subdev_frame_interval_enum *fie)
4744 {
4745 struct ov2775 *ov2775 = to_ov2775(sd);
4746
4747 if (fie->index >= ov2775->support_modes_num)
4748 return -EINVAL;
4749
4750 fie->code = supported_modes[fie->index].bus_fmt;
4751 fie->width = ov2775->support_modes[fie->index].width;
4752 fie->height = ov2775->support_modes[fie->index].height;
4753 fie->interval = ov2775->support_modes[fie->index].max_fps;
4754 fie->reserved[0] = supported_modes[fie->index].hdr_mode;
4755
4756 return 0;
4757 }
4758
4759 static const struct dev_pm_ops ov2775_pm_ops = {
4760 SET_RUNTIME_PM_OPS(ov2775_runtime_suspend,
4761 ov2775_runtime_resume, NULL)
4762 };
4763
4764 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
4765 static const struct v4l2_subdev_internal_ops ov2775_internal_ops = {
4766 .open = ov2775_open,
4767 };
4768 #endif
4769
4770 static const struct v4l2_subdev_video_ops ov2775_video_ops = {
4771 .s_stream = ov2775_s_stream,
4772 .g_frame_interval = ov2775_g_frame_interval,
4773 .g_mbus_config = ov2775_g_mbus_config,
4774 };
4775
4776 static const struct v4l2_subdev_pad_ops ov2775_pad_ops = {
4777 .enum_mbus_code = ov2775_enum_mbus_code,
4778 .enum_frame_size = ov2775_enum_frame_sizes,
4779 .enum_frame_interval = ov2775_enum_frame_interval,
4780 .get_fmt = ov2775_get_fmt,
4781 .set_fmt = ov2775_set_fmt,
4782 };
4783
4784 static const struct v4l2_subdev_core_ops ov2775_core_ops = {
4785 .s_power = ov2775_s_power,
4786 .ioctl = ov2775_ioctl,
4787 #ifdef CONFIG_COMPAT
4788 .compat_ioctl32 = ov2775_compat_ioctl32,
4789 #endif
4790 };
4791
4792 static const struct v4l2_subdev_ops ov2775_subdev_ops = {
4793 .core = &ov2775_core_ops,
4794 .video = &ov2775_video_ops,
4795 .pad = &ov2775_pad_ops,
4796 };
4797
ov2775_get_linear_reg(u32 gain,u32 * gain_a,u32 * gain_d)4798 static void ov2775_get_linear_reg(u32 gain, u32 *gain_a, u32 *gain_d)
4799 {
4800 if (gain < 0x300) {
4801 /* min T_Gain is 3x */
4802 *gain_a = 0x01;
4803 gain = 0x180;
4804 } else if (gain >= 0x300 && gain < 0x460) {
4805 /* 3X----4.375X, LCG 2*A gain */
4806 *gain_a = 0x01;
4807 gain = gain / 2;
4808 } else if (gain >= 0x460 && gain < 0x8c0) {
4809 /* 4.375X----8.750X, LCG 4*A gain */
4810 *gain_a = 0x02;
4811 gain = gain / 4;
4812 } else if (gain >= 0x8c0 && gain < 0x1600) {
4813 /* 8.750X----22X, LCG 8*A gain */
4814 *gain_a = 0x03;
4815 gain = gain / 8;
4816 } else if (gain >= 0x1600 && gain < 0x2c00) {
4817 /* 22X----44X, HCG 1*A gain */
4818 *gain_a = 0x40;
4819 gain = gain / 11;
4820 } else if (gain >= 0x2c00 && gain < 0x5800) {
4821 /* 44X----88X, HCG 2*A gain */
4822 *gain_a = 0x41;
4823 gain = gain / (11 * 2);
4824 } else if (gain >= 0x5800 && gain < 0xb000) {
4825 /* 88X----176X, HCG 4*A gain */
4826 *gain_a = 0x42;
4827 gain = gain / (11 * 4);
4828 } else {
4829 /* >=176X, HCG 8*A gain */
4830 *gain_a = 0x43;
4831 gain = gain / (11 * 8);
4832 }
4833
4834 *gain_d = gain;
4835 }
4836
ov2775_set_ctrl(struct v4l2_ctrl * ctrl)4837 static int ov2775_set_ctrl(struct v4l2_ctrl *ctrl)
4838 {
4839 struct ov2775 *ov2775 = container_of(ctrl->handler,
4840 struct ov2775, ctrl_handler);
4841 struct i2c_client *client = ov2775->client;
4842 s64 max;
4843 u32 gain_a, gain_d, val;
4844 int ret = 0;
4845
4846 /* Propagate change of current control to all related controls */
4847 switch (ctrl->id) {
4848 case V4L2_CID_VBLANK:
4849 /* Update max exposure while meeting expected vblanking */
4850 if (ov2775->cur_mode->hdr_mode == NO_HDR) {
4851 max = ov2775->cur_mode->height + ctrl->val - 4;
4852 __v4l2_ctrl_modify_range(ov2775->exposure,
4853 ov2775->exposure->minimum, max,
4854 ov2775->exposure->step,
4855 ov2775->exposure->default_value);
4856 }
4857 break;
4858 }
4859
4860 if (!pm_runtime_get_if_in_use(&client->dev))
4861 return 0;
4862
4863 switch (ctrl->id) {
4864 case V4L2_CID_EXPOSURE:
4865 if (ov2775->cur_mode->hdr_mode != NO_HDR)
4866 goto ctrl_end;
4867 ret = ov2775_write_reg(ov2775->client,
4868 OV2775_REG_EXPOSURE_H,
4869 OV2775_REG_VALUE_08BIT,
4870 (ctrl->val >> 8) & 0xFF);
4871
4872 ret |= ov2775_write_reg(ov2775->client,
4873 OV2775_REG_EXPOSURE_L,
4874 OV2775_REG_VALUE_08BIT,
4875 ctrl->val & 0xFF);
4876 dev_dbg(&client->dev,
4877 "set exp: 0x%x\n", ctrl->val);
4878 break;
4879 case V4L2_CID_ANALOGUE_GAIN:
4880 if (ov2775->cur_mode->hdr_mode != NO_HDR)
4881 goto ctrl_end;
4882 ov2775_get_linear_reg(ctrl->val, &gain_a, &gain_d);
4883 ret = ov2775_write_reg(ov2775->client,
4884 OV2775_REG_GAIN,
4885 OV2775_REG_VALUE_08BIT,
4886 gain_a);
4887
4888 ret |= ov2775_write_reg(ov2775->client,
4889 OV2775_REG_DIG_GAIN_HCG_H,
4890 OV2775_REG_VALUE_08BIT,
4891 (gain_d >> 8) & 0xFF);
4892
4893 ret |= ov2775_write_reg(ov2775->client,
4894 OV2775_REG_DIG_GAIN_HCG_L,
4895 OV2775_REG_VALUE_08BIT,
4896 gain_d & 0xFF);
4897 dev_dbg(&client->dev,
4898 "set gain: 0x%x, again: 0x%x, dgain: 0x%x\n",
4899 ctrl->val, gain_a, gain_d);
4900 break;
4901 case V4L2_CID_VBLANK:
4902 val = ctrl->val + ov2775->cur_mode->height;
4903 ret = ov2775_write_reg(ov2775->client,
4904 OV2775_REG_VTS_H,
4905 OV2775_REG_VALUE_08BIT,
4906 (val >> 8) & 0xFF);
4907
4908 ret |= ov2775_write_reg(ov2775->client,
4909 OV2775_REG_VTS_L,
4910 OV2775_REG_VALUE_08BIT,
4911 val & 0xFF);
4912 dev_dbg(&client->dev,
4913 "set vts: 0x%x, 0x%x\n", ctrl->val, val);
4914 break;
4915 case V4L2_CID_TEST_PATTERN:
4916 ret = ov2775_enable_test_pattern(ov2775, ctrl->val);
4917 break;
4918 case V4L2_CID_HFLIP:
4919 if (ctrl->val)
4920 ov2775->flip |= OV2775_MIRROR;
4921 else
4922 ov2775->flip &= ~OV2775_MIRROR;
4923 ov2775_set_flip(ov2775, ov2775->flip);
4924 break;
4925 case V4L2_CID_VFLIP:
4926 if (ctrl->val)
4927 ov2775->flip |= OV2775_FLIP;
4928 else
4929 ov2775->flip &= ~OV2775_FLIP;
4930 ov2775_set_flip(ov2775, ov2775->flip);
4931 break;
4932 default:
4933 dev_warn(&client->dev, "%s Unhandled id:0x%x, val:0x%x\n",
4934 __func__, ctrl->id, ctrl->val);
4935 break;
4936 }
4937
4938 ctrl_end:
4939 pm_runtime_put(&client->dev);
4940
4941 return ret;
4942 }
4943
4944 static const struct v4l2_ctrl_ops ov2775_ctrl_ops = {
4945 .s_ctrl = ov2775_set_ctrl,
4946 };
4947
ov2775_initialize_controls(struct ov2775 * ov2775)4948 static int ov2775_initialize_controls(struct ov2775 *ov2775)
4949 {
4950 const struct ov2775_mode *mode;
4951 struct v4l2_ctrl_handler *handler;
4952 struct v4l2_ctrl *ctrl;
4953 s64 exposure_max, vblank_def;
4954 u32 h_blank;
4955 int ret;
4956 u64 pixel_rate = 0;
4957
4958 handler = &ov2775->ctrl_handler;
4959 mode = ov2775->cur_mode;
4960 ret = v4l2_ctrl_handler_init(handler, 9);
4961 if (ret)
4962 return ret;
4963 handler->lock = &ov2775->mutex;
4964
4965 ctrl = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ,
4966 0, 0, link_freq_menu_items);
4967 if (ctrl)
4968 ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
4969
4970 pixel_rate = (u32)OV2775_LINK_FREQ_480MHZ * 2 * mode->lane / mode->bpp;
4971 ov2775->pixel_rate = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE,
4972 0, pixel_rate, 1, pixel_rate);
4973
4974 h_blank = mode->hts_def - mode->width;
4975 ov2775->hblank = v4l2_ctrl_new_std(handler, NULL, V4L2_CID_HBLANK,
4976 h_blank, h_blank, 1, h_blank);
4977 if (ov2775->hblank)
4978 ov2775->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
4979
4980 vblank_def = mode->vts_def - mode->height;
4981 ov2775->vblank = v4l2_ctrl_new_std(handler, &ov2775_ctrl_ops,
4982 V4L2_CID_VBLANK, vblank_def,
4983 OV2775_VTS_MAX - mode->height,
4984 1, vblank_def);
4985
4986 exposure_max = mode->vts_def - 4;
4987 ov2775->exposure = v4l2_ctrl_new_std(handler, &ov2775_ctrl_ops,
4988 V4L2_CID_EXPOSURE,
4989 OV2775_EXPOSURE_MIN,
4990 exposure_max,
4991 OV2775_EXPOSURE_STEP,
4992 mode->exp_def);
4993
4994 ov2775->anal_gain = v4l2_ctrl_new_std(handler, &ov2775_ctrl_ops,
4995 V4L2_CID_ANALOGUE_GAIN,
4996 OV2775_GAIN_MIN,
4997 OV2775_GAIN_MAX,
4998 OV2775_GAIN_STEP,
4999 OV2775_GAIN_DEFAULT);
5000
5001 ov2775->test_pattern =
5002 v4l2_ctrl_new_std_menu_items(handler,
5003 &ov2775_ctrl_ops,
5004 V4L2_CID_TEST_PATTERN,
5005 ARRAY_SIZE(ov2775_test_pattern_menu) - 1,
5006 0, 0, ov2775_test_pattern_menu);
5007
5008 ov2775->h_flip = v4l2_ctrl_new_std(handler, &ov2775_ctrl_ops,
5009 V4L2_CID_HFLIP, 0, 1, 1, 0);
5010
5011 ov2775->v_flip = v4l2_ctrl_new_std(handler, &ov2775_ctrl_ops,
5012 V4L2_CID_VFLIP, 0, 1, 1, 0);
5013 ov2775->flip = 0;
5014
5015 if (handler->error) {
5016 ret = handler->error;
5017 dev_err(&ov2775->client->dev,
5018 "Failed to init controls(%d)\n", ret);
5019 goto err_free_handler;
5020 }
5021
5022 ov2775->subdev.ctrl_handler = handler;
5023 ov2775->has_init_exp = false;
5024
5025 return 0;
5026
5027 err_free_handler:
5028 v4l2_ctrl_handler_free(handler);
5029
5030 return ret;
5031 }
5032
ov2775_check_sensor_id(struct ov2775 * ov2775,struct i2c_client * client)5033 static int ov2775_check_sensor_id(struct ov2775 *ov2775,
5034 struct i2c_client *client)
5035 {
5036 struct device *dev = &ov2775->client->dev;
5037 u32 id = 0;
5038 int i, ret;
5039
5040 for (i = 0; i < 5; i++) {
5041 ret = ov2775_read_reg(client, OV2775_REG_CHIP_ID,
5042 OV2775_REG_VALUE_16BIT, &id);
5043 if (id == CHIP_ID)
5044 break;
5045
5046 dev_err(dev, "Unexpected sensor id(%06x), ret(%d)\n",
5047 id, ret);
5048 usleep_range(1000, 2000);
5049 continue;
5050 }
5051
5052 if (id != CHIP_ID)
5053 return -ENODEV;
5054
5055 dev_info(dev, "Detected OV%06x sensor\n", CHIP_ID);
5056
5057 return 0;
5058 }
5059
ov2775_get_regulators(struct ov2775 * ov2775)5060 static int ov2775_get_regulators(struct ov2775 *ov2775)
5061 {
5062 unsigned int i;
5063
5064 for (i = 0; i < OV2775_NUM_SUPPLIES; i++)
5065 ov2775->supplies[i].supply = ov2775_supply_names[i];
5066
5067 return devm_regulator_bulk_get(&ov2775->client->dev,
5068 OV2775_NUM_SUPPLIES,
5069 ov2775->supplies);
5070 }
5071
ov2775_analyze_dts(struct ov2775 * ov2775)5072 static int ov2775_analyze_dts(struct ov2775 *ov2775)
5073 {
5074 struct device *dev = &ov2775->client->dev;
5075
5076 ov2775->xvclk = devm_clk_get(dev, "xvclk");
5077 if (IS_ERR(ov2775->xvclk)) {
5078 dev_err(dev, "Failed to get xvclk\n");
5079 return -EINVAL;
5080 }
5081
5082 ov2775->pinctrl = devm_pinctrl_get(dev);
5083 if (!IS_ERR(ov2775->pinctrl)) {
5084 ov2775->pins_default =
5085 pinctrl_lookup_state(ov2775->pinctrl,
5086 OF_CAMERA_PINCTRL_STATE_DEFAULT);
5087 if (IS_ERR(ov2775->pins_default))
5088 dev_err(dev, "could not get default pinstate\n");
5089
5090 ov2775->pins_sleep =
5091 pinctrl_lookup_state(ov2775->pinctrl,
5092 OF_CAMERA_PINCTRL_STATE_SLEEP);
5093 if (IS_ERR(ov2775->pins_sleep))
5094 dev_err(dev, "could not get sleep pinstate\n");
5095 } else {
5096 dev_err(dev, "no pinctrl\n");
5097 }
5098
5099 ov2775->pd_gpio = devm_gpiod_get(dev, "pd", GPIOD_OUT_LOW);
5100 if (IS_ERR(ov2775->pd_gpio))
5101 dev_warn(dev, "can not find pd-gpios, error %ld\n",
5102 PTR_ERR(ov2775->pd_gpio));
5103
5104 ov2775->rst_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
5105 if (IS_ERR(ov2775->rst_gpio))
5106 dev_warn(dev, "can not find rst-gpios, error %ld\n",
5107 PTR_ERR(ov2775->rst_gpio));
5108
5109 ov2775->pwd_gpio = devm_gpiod_get(dev, "pwd", GPIOD_OUT_HIGH);
5110 if (IS_ERR(ov2775->pwd_gpio))
5111 dev_warn(dev, "can not find pwd-gpios, error %ld\n",
5112 PTR_ERR(ov2775->pwd_gpio));
5113
5114 return ov2775_get_regulators(ov2775);
5115 }
5116
ov2775_probe(struct i2c_client * client,const struct i2c_device_id * id)5117 static int ov2775_probe(struct i2c_client *client,
5118 const struct i2c_device_id *id)
5119 {
5120 struct device *dev = &client->dev;
5121 struct device_node *node = dev->of_node;
5122 struct ov2775 *ov2775;
5123 struct v4l2_subdev *sd;
5124 char facing[2];
5125 int ret;
5126
5127 dev_info(dev, "driver version: %02x.%02x.%02x",
5128 DRIVER_VERSION >> 16,
5129 (DRIVER_VERSION & 0xff00) >> 8,
5130 DRIVER_VERSION & 0x00ff);
5131
5132 ov2775 = devm_kzalloc(dev, sizeof(*ov2775), GFP_KERNEL);
5133 if (!ov2775)
5134 return -ENOMEM;
5135
5136 ret = of_property_read_u32(node, RKMODULE_CAMERA_MODULE_INDEX,
5137 &ov2775->module_index);
5138 ret |= of_property_read_string(node, RKMODULE_CAMERA_MODULE_FACING,
5139 &ov2775->module_facing);
5140 ret |= of_property_read_string(node, RKMODULE_CAMERA_MODULE_NAME,
5141 &ov2775->module_name);
5142 ret |= of_property_read_string(node, RKMODULE_CAMERA_LENS_NAME,
5143 &ov2775->len_name);
5144 if (ret) {
5145 dev_err(dev, "could not get module information!\n");
5146 return -EINVAL;
5147 }
5148
5149 ov2775->client = client;
5150
5151 ret = ov2775_analyze_dts(ov2775);
5152 if (ret) {
5153 dev_err(dev, "Failed to analyze dts\n");
5154 return ret;
5155 }
5156
5157 mutex_init(&ov2775->mutex);
5158
5159 sd = &ov2775->subdev;
5160 v4l2_i2c_subdev_init(sd, client, &ov2775_subdev_ops);
5161
5162 ov2775->support_modes = supported_modes;
5163 ov2775->support_modes_num = ARRAY_SIZE(supported_modes);
5164 ov2775->cur_mode = &ov2775->support_modes[0];
5165
5166 ret = ov2775_initialize_controls(ov2775);
5167 if (ret)
5168 goto err_destroy_mutex;
5169
5170 ret = __ov2775_power_on(ov2775);
5171 if (ret)
5172 goto err_free_handler;
5173
5174 ret = ov2775_check_sensor_id(ov2775, client);
5175 if (ret)
5176 goto err_power_off;
5177
5178 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
5179 sd->internal_ops = &ov2775_internal_ops;
5180 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
5181 #endif
5182 #if defined(CONFIG_MEDIA_CONTROLLER)
5183 ov2775->pad.flags = MEDIA_PAD_FL_SOURCE;
5184 sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
5185 ret = media_entity_pads_init(&sd->entity, 1, &ov2775->pad);
5186 if (ret < 0)
5187 goto err_power_off;
5188 #endif
5189
5190 memset(facing, 0, sizeof(facing));
5191 if (strcmp(ov2775->module_facing, "back") == 0)
5192 facing[0] = 'b';
5193 else
5194 facing[0] = 'f';
5195
5196 snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s",
5197 ov2775->module_index, facing,
5198 OV2775_NAME, dev_name(sd->dev));
5199 ret = v4l2_async_register_subdev_sensor_common(sd);
5200 if (ret) {
5201 dev_err(dev, "v4l2 async register subdev failed\n");
5202 goto err_clean_entity;
5203 }
5204
5205 pm_runtime_set_active(dev);
5206 pm_runtime_enable(dev);
5207 pm_runtime_idle(dev);
5208
5209 return 0;
5210
5211 err_clean_entity:
5212 #if defined(CONFIG_MEDIA_CONTROLLER)
5213 media_entity_cleanup(&sd->entity);
5214 #endif
5215 err_power_off:
5216 __ov2775_power_off(ov2775);
5217 err_free_handler:
5218 v4l2_ctrl_handler_free(&ov2775->ctrl_handler);
5219 err_destroy_mutex:
5220 mutex_destroy(&ov2775->mutex);
5221
5222 return ret;
5223 }
5224
ov2775_remove(struct i2c_client * client)5225 static int ov2775_remove(struct i2c_client *client)
5226 {
5227 struct v4l2_subdev *sd = i2c_get_clientdata(client);
5228 struct ov2775 *ov2775 = to_ov2775(sd);
5229
5230 v4l2_async_unregister_subdev(sd);
5231 #if defined(CONFIG_MEDIA_CONTROLLER)
5232 media_entity_cleanup(&sd->entity);
5233 #endif
5234 v4l2_ctrl_handler_free(&ov2775->ctrl_handler);
5235 mutex_destroy(&ov2775->mutex);
5236
5237 pm_runtime_disable(&client->dev);
5238 if (!pm_runtime_status_suspended(&client->dev))
5239 __ov2775_power_off(ov2775);
5240 pm_runtime_set_suspended(&client->dev);
5241
5242 return 0;
5243 }
5244
5245 #if IS_ENABLED(CONFIG_OF)
5246 static const struct of_device_id ov2775_of_match[] = {
5247 { .compatible = "ovti,ov2775" },
5248 {},
5249 };
5250 MODULE_DEVICE_TABLE(of, ov2775_of_match);
5251 #endif
5252
5253 static const struct i2c_device_id ov2775_match_id[] = {
5254 { "ovti,ov2775", 0 },
5255 { },
5256 };
5257
5258 static struct i2c_driver ov2775_i2c_driver = {
5259 .driver = {
5260 .name = OV2775_NAME,
5261 .pm = &ov2775_pm_ops,
5262 .of_match_table = of_match_ptr(ov2775_of_match),
5263 },
5264 .probe = &ov2775_probe,
5265 .remove = &ov2775_remove,
5266 .id_table = ov2775_match_id,
5267 };
5268
sensor_mod_init(void)5269 static int __init sensor_mod_init(void)
5270 {
5271 return i2c_add_driver(&ov2775_i2c_driver);
5272 }
5273
sensor_mod_exit(void)5274 static void __exit sensor_mod_exit(void)
5275 {
5276 i2c_del_driver(&ov2775_i2c_driver);
5277 }
5278
5279 device_initcall_sync(sensor_mod_init);
5280 module_exit(sensor_mod_exit);
5281
5282 MODULE_DESCRIPTION("OmniVision ov2775 sensor driver");
5283 MODULE_LICENSE("GPL v2");
5284