camsys_drv : v0.9.0
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / gt2005.c
1 #include "generic_sensor.h"\r
2 /*
3 *      Driver Version Note\r
4 *v0.0.1: this driver is compatible with generic_sensor\r
5 *v0.0.3:\r
6 *        add sensor_focus_af_const_pause_usr_cb;\r
7 */\r
8 static int version = KERNEL_VERSION(0,0,3);\r
9 module_param(version, int, S_IRUGO);\r
10 \r
11 static int debug;\r
12 module_param(debug, int, S_IRUGO|S_IWUSR);\r
13 \r
14 #define dprintk(level, fmt, arg...) do {                        \\r
15         if (debug >= level)                                     \\r
16         printk(KERN_WARNING fmt , ## arg); } while (0)\r
17 \r
18 /* Sensor Driver Configuration Begin */\r
19 #define SENSOR_NAME RK29_CAM_SENSOR_GT2005\r
20 #define SENSOR_V4L2_IDENT V4L2_IDENT_GT2005\r
21 #define SENSOR_ID 0x5138\r
22 #define SENSOR_BUS_PARAM                                         (SOCAM_MASTER |\\r
23                                                                                          SOCAM_PCLK_SAMPLE_RISING|SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_HIGH|\\r
24                                                                                          SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8  |SOCAM_MCLK_24MHZ)\r
25 #define SENSOR_PREVIEW_W                                         640\r
26 #define SENSOR_PREVIEW_H                                         480\r
27 #define SENSOR_PREVIEW_FPS                                       15000     // 15fps \r
28 #define SENSOR_FULLRES_L_FPS                             7500      // 7.5fps\r
29 #define SENSOR_FULLRES_H_FPS                             7500      // 7.5fps\r
30 #define SENSOR_720P_FPS                                          0\r
31 #define SENSOR_1080P_FPS                                         0\r
32 \r
33 #define SENSOR_REGISTER_LEN                              2                 // sensor register address bytes\r
34 #define SENSOR_VALUE_LEN                                         1                 // sensor register value bytes\r
35                                                                         \r
36 static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene);\r
37 static unsigned int SensorChipID[] = {SENSOR_ID};\r
38 /* Sensor Driver Configuration End */\r
39 \r
40 \r
41 #define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a))\r
42 #define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a)\r
43 \r
44 #define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b)\r
45 #define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v))\r
46 #define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v))\r
47 #define sensor_write_array generic_sensor_write_array\r
48 \r
49 struct sensor_parameter\r
50 {\r
51         unsigned int PreviewDummyPixels;\r
52         unsigned int CaptureDummyPixels;\r
53         unsigned int preview_exposure;\r
54         unsigned short int preview_line_width;\r
55         unsigned short int preview_gain;\r
56 \r
57         unsigned short int PreviewPclk;\r
58         unsigned short int CapturePclk;\r
59         char awb[6];\r
60 };\r
61 \r
62 struct specific_sensor{\r
63         struct generic_sensor common_sensor;\r
64         //define user data below\r
65         struct sensor_parameter parameter;\r
66         u16 shutter;\r
67 \r
68 };\r
69 \r
70 /*\r
71 *  The follow setting need been filled.\r
72 *  \r
73 *  Must Filled:\r
74 *  sensor_init_data :                           Sensor initial setting;\r
75 *  sensor_fullres_lowfps_data :         Sensor full resolution setting with best auality, recommand for video;\r
76 *  sensor_preview_data :                        Sensor preview resolution setting, recommand it is vga or svga;\r
77 *  sensor_softreset_data :                      Sensor software reset register;\r
78 *  sensor_check_id_data :                       Sensir chip id register;\r
79 *\r
80 *  Optional filled:\r
81 *  sensor_fullres_highfps_data:         Sensor full resolution setting with high framerate, recommand for video;\r
82 *  sensor_720p:                                         Sensor 720p setting, it is for video;\r
83 *  sensor_1080p:                                        Sensor 1080p setting, it is for video;\r
84 *\r
85 *  :::::WARNING:::::\r
86 *  The SensorEnd which is the setting end flag must be filled int the last of each setting;\r
87 */\r
88 \r
89 /* Sensor initial setting */\r
90 static struct rk_sensor_reg sensor_init_data[] ={\r
91                 {0x0101 , 0x00},\r
92                 {0x0103 , 0x00}, \r
93                 {0x0105 , 0x00},\r
94                 {0x0106 , 0xF0},\r
95                 {0x0107 , 0x00},\r
96                 {0x0108 , 0x1C},\r
97                 {0x0109 , 0x01},\r
98                 {0x010A , 0x00},\r
99                 {0x010B , 0x00},\r
100                 {0x010C , 0x00},\r
101                 {0x010D , 0x08},\r
102                 {0x010E , 0x00},\r
103                 {0x010F , 0x08},\r
104                 {0x0110 , 0x06},\r
105                 {0x0111 , 0x40},\r
106                 {0x0112 , 0x04},\r
107                 {0x0113 , 0xB0},\r
108         {0x0114 , 0x00},\r
109                 {0x0115 , 0x00},\r
110                 //{0x0116 , 0x02},\r
111                 //{0x0117 , 0x00},\r
112                   // {0x0118 , 0x67},\r
113                 //{0x0119 , 0x02},\r
114                 //{0x011A , 0x04},\r
115                 //{0x011B , 0x01},\r
116         {0x011C , 0x00},//0x01 2011 11 04\r
117         {0x011D , 0x02},\r
118         {0x011E , 0x00},\r
119         {0x011F , 0x00},\r
120         {0x0120 , 0x1C},\r
121         {0x0121 , 0x00},\r
122         {0x0122 , 0x04},\r
123         {0x0123 , 0x00},\r
124         {0x0124 , 0x00},\r
125         {0x0125 , 0x00},\r
126         {0x0126 , 0x00},\r
127         {0x0127 , 0x00},\r
128         {0x0128 , 0x00},\r
129         {0x0200 , 0x00},\r
130                 {0x0201 , 0x08},  //0x00\r
131         {0x0202 , 0x40},\r
132         {0x0203 , 0x00},\r
133                 {0x0204 , 0x78},\r
134         {0x0205 , 0x1F},\r
135         {0x0206 , 0x0B},\r
136         {0x0207 , 0x20},\r
137         {0x0208 , 0x00},\r
138         {0x0209 , 0x2A},\r
139         {0x020A , 0x01},\r
140         {0x020B , 0x48},\r
141         {0x020C , 0x64},\r
142         {0x020D , 0xC8},\r
143         {0x020E , 0xBC},\r
144         {0x020F , 0x08},\r
145         {0x0210 , 0xD6},\r
146         {0x0211 , 0x00},\r
147         {0x0212 , 0x20},\r
148         {0x0213 , 0x81},\r
149         {0x0214 , 0x15},\r
150         {0x0215 , 0x00},\r
151         {0x0216 , 0x00},\r
152         {0x0217 , 0x00},\r
153         {0x0218 , 0x46},\r
154         {0x0219 , 0x30},\r
155         {0x021A , 0x03},\r
156         {0x021B , 0x28},\r
157         {0x021C , 0x02},\r
158         {0x021D , 0x60},\r
159         {0x021E , 0x00},\r
160                 {0x021F , 0x00},\r
161                 {0x0220 , 0x10},\r
162                 {0x0221 , 0x10},\r
163                 {0x0222 , 0x10},\r
164                 {0x0223 , 0x10},\r
165                 {0x0224 , 0x1F},\r
166         {0x0225 , 0x1E},\r
167         {0x0226 , 0x18},\r
168         {0x0227 , 0x1D},\r
169         {0x0228 , 0x1F},\r
170         {0x0229 , 0x1F},\r
171         {0x022A , 0x01},\r
172         {0x022B , 0x04},\r
173         {0x022C , 0x05},\r
174         {0x022D , 0x05},\r
175         {0x022E , 0x04},\r
176         {0x022F , 0x03},\r
177         {0x0230 , 0x02},\r
178         {0x0231 , 0x1F},\r
179         {0x0232 , 0x1A},\r
180         {0x0233 , 0x19},\r
181         {0x0234 , 0x19},\r
182         {0x0235 , 0x1B},\r
183         {0x0236 , 0x1F},\r
184         {0x0237 , 0x04},\r
185         {0x0238 , 0xEE},\r
186         {0x0239 , 0xFF},\r
187         {0x023A , 0x00},\r
188         {0x023B , 0x00},\r
189         {0x023C , 0x00},\r
190         {0x023D , 0x00},\r
191         {0x023E , 0x00},\r
192         {0x023F , 0x00},\r
193         {0x0240 , 0x00},\r
194         {0x0241 , 0x00},\r
195         {0x0242 , 0x00},\r
196         {0x0243 , 0x21},\r
197         {0x0244 , 0x42},\r
198         {0x0245 , 0x53},\r
199         {0x0246 , 0x54},\r
200         {0x0247 , 0x54},\r
201         {0x0248 , 0x54},\r
202         {0x0249 , 0x33},\r
203         {0x024A , 0x11},\r
204         {0x024B , 0x00},\r
205         {0x024C , 0x00},\r
206         {0x024D , 0xFF},\r
207         {0x024E , 0xEE},\r
208         {0x024F , 0xDD},\r
209         {0x0250 , 0x00},\r
210         {0x0251 , 0x00},\r
211         {0x0252 , 0x00},\r
212         {0x0253 , 0x00},\r
213         {0x0254 , 0x00},\r
214         {0x0255 , 0x00},\r
215         {0x0256 , 0x00},\r
216         {0x0257 , 0x00},\r
217         {0x0258 , 0x00},\r
218         {0x0259 , 0x00},\r
219         {0x025A , 0x00},\r
220         {0x025B , 0x00},\r
221         {0x025C , 0x00},\r
222         {0x025D , 0x00},\r
223         {0x025E , 0x00},\r
224         {0x025F , 0x00},\r
225         {0x0260 , 0x00},\r
226         {0x0261 , 0x00},\r
227         {0x0262 , 0x00},\r
228         {0x0263 , 0x00},\r
229         {0x0264 , 0x00},\r
230         {0x0265 , 0x00},\r
231         {0x0266 , 0x00},\r
232         {0x0267 , 0x00},\r
233         {0x0268 , 0x8F},\r
234         {0x0269 , 0xA3},\r
235         {0x026A , 0xB4},\r
236         {0x026B , 0x90},\r
237         {0x026C , 0x00},\r
238         {0x026D , 0xD0},\r
239         {0x026E , 0x60},\r
240         {0x026F , 0xA0},\r
241         {0x0270 , 0x40},\r
242         {0x0300 , 0x81},\r
243         {0x0301 , 0x80},\r
244         {0x0302 , 0x22},\r
245         {0x0303 , 0x06},\r
246         {0x0304 , 0x03},\r
247         {0x0305 , 0x83},\r
248         {0x0306 , 0x00},\r
249         {0x0307 , 0x22},\r
250         {0x0308 , 0x00},\r
251         {0x0309 , 0x55},\r
252         {0x030A , 0x55},\r
253         {0x030B , 0x55},\r
254         {0x030C , 0x54},\r
255         {0x030D , 0x1F},\r
256         {0x030E , 0x13},\r
257         {0x030F , 0x10},\r
258         {0x0310 , 0x04},\r
259         {0x0311 , 0xFF},\r
260                 {0x0312 , 0x98},\r
261         {0x0313 , 0x28},\r
262         {0x0314 , 0x66},\r
263         {0x0315 , 0x16},\r
264         {0x0316 , 0x26},\r
265         {0x0317 , 0x02},\r
266         {0x0318 , 0x08},\r
267         {0x0319 , 0x0C},\r
268         {0x031A , 0x81},\r
269         {0x031B , 0x00},\r
270         {0x031C , 0x3D},\r
271         {0x031D , 0x00},\r
272         {0x031E , 0xF9},\r
273         {0x031F , 0x00},\r
274         {0x0320 , 0x24},\r
275         {0x0321 , 0x14},\r
276         {0x0322 , 0x1A},\r
277         {0x0323 , 0x24},\r
278         {0x0324 , 0x08},\r
279         {0x0325 , 0xF0},\r
280         {0x0326 , 0x30}, \r
281         {0x0327 , 0x17},\r
282         {0x0328 , 0x11},\r
283         {0x0329 , 0x22},\r
284         {0x032A , 0x2F},\r
285         {0x032B , 0x21},\r
286         {0x032C , 0xDA},\r
287         {0x032D , 0x10},\r
288         {0x032E , 0xEA},\r
289         {0x032F , 0x18},\r
290         {0x0330 , 0x29},\r
291         {0x0331 , 0x25},\r
292         {0x0332 , 0x12},\r
293         {0x0333 , 0x0F},\r
294         {0x0334 , 0xE0},\r
295         {0x0335 , 0x13},\r
296         {0x0336 , 0xFF},\r
297         {0x0337 , 0x20},\r
298         {0x0338 , 0x46},\r
299         {0x0339 , 0x04},\r
300         {0x033A , 0x04},\r
301         {0x033B , 0xFF},\r
302         {0x033C , 0x01},\r
303         {0x033D , 0x00},\r
304         {0x033E , 0x03},\r
305         {0x033F , 0x28},\r
306         {0x0340 , 0x02},\r
307         {0x0341 , 0x60},\r
308         {0x0342 , 0xAC},\r
309         {0x0343 , 0x97},\r
310         {0x0344 , 0x7F},\r
311         {0x0400 , 0xE8},\r
312         {0x0401 , 0x40},\r
313         {0x0402 , 0x00},\r
314         {0x0403 , 0x00},\r
315         {0x0404 , 0xF8},\r
316         {0x0405 , 0x03},\r
317         {0x0406 , 0x03},\r
318         {0x0407 , 0x85},\r
319         {0x0408 , 0x44},\r
320         {0x0409 , 0x1F},\r
321         {0x040A , 0x40},\r
322         {0x040B , 0x33},\r
323         {0x040C , 0xA0},\r
324         {0x040D , 0x00},\r
325         {0x040E , 0x00},\r
326         {0x040F , 0x00},\r
327         {0x0410 , 0x0D},\r
328         {0x0411 , 0x0D},\r
329         {0x0412 , 0x0C},\r
330         {0x0413 , 0x04},\r
331         {0x0414 , 0x00},\r
332         {0x0415 , 0x00},\r
333         {0x0416 , 0x07},\r
334         {0x0417 , 0x09},\r
335         {0x0418 , 0x16},\r
336         {0x0419 , 0x14},\r
337         {0x041A , 0x11},\r
338         {0x041B , 0x14},\r
339         {0x041C , 0x07},\r
340         {0x041D , 0x07},\r
341         {0x041E , 0x06},\r
342         {0x041F , 0x02},\r
343         {0x0420 , 0x42},\r
344         {0x0421 , 0x42},\r
345         {0x0422 , 0x47},\r
346         {0x0423 , 0x39},\r
347         {0x0424 , 0x3E},\r
348         {0x0425 , 0x4D},\r
349         {0x0426 , 0x46},\r
350         {0x0427 , 0x3A},\r
351         {0x0428 , 0x21},\r
352         {0x0429 , 0x21},\r
353         {0x042A , 0x26},\r
354         {0x042B , 0x1C},\r
355         {0x042C , 0x25},\r
356         {0x042D , 0x25},\r
357         {0x042E , 0x28},\r
358         {0x042F , 0x20},\r
359         {0x0430 , 0x3E},\r
360         {0x0431 , 0x3E},\r
361         {0x0432 , 0x33},\r
362         {0x0433 , 0x2E},\r
363         {0x0434 , 0x54},\r
364         {0x0435 , 0x53},\r
365         {0x0436 , 0x3C},\r
366         {0x0437 , 0x51},\r
367         {0x0438 , 0x2B},\r
368         {0x0439 , 0x2B},\r
369         {0x043A , 0x38},\r
370         {0x043B , 0x22},\r
371         {0x043C , 0x3B},\r
372         {0x043D , 0x3B},\r
373         {0x043E , 0x31},\r
374         {0x043F , 0x37},\r
375         {0x0440 , 0x00},\r
376         {0x0441 , 0x4B},\r
377         {0x0442 , 0x00},\r
378         {0x0443 , 0x00},\r
379         {0x0444 , 0x31},\r
380         {0x0445 , 0x00},\r
381         {0x0446 , 0x00},\r
382         {0x0447 , 0x00},\r
383         {0x0448 , 0x00},\r
384         {0x0449 , 0x00},\r
385         {0x044A , 0x00},\r
386         {0x044D , 0xE0},\r
387         {0x044E , 0x05},\r
388         {0x044F , 0x07},\r
389         {0x0450 , 0x00},\r
390         {0x0451 , 0x00},\r
391         {0x0452 , 0x00},\r
392         {0x0453 , 0x00},\r
393         {0x0454 , 0x00},\r
394         {0x0455 , 0x00},\r
395         {0x0456 , 0x00},\r
396         {0x0457 , 0x00},\r
397         {0x0458 , 0x00},\r
398         {0x0459 , 0x00},\r
399         {0x045A , 0x00},\r
400         {0x045B , 0x00},\r
401         {0x045C , 0x00},\r
402         {0x045D , 0x00},\r
403         {0x045E , 0x00},\r
404         {0x045F , 0x00},\r
405         {0x0460 , 0x80},\r
406         {0x0461 , 0x10},\r
407         {0x0462 , 0x10},\r
408         {0x0463 , 0x10},\r
409         {0x0464 , 0x08},\r
410         {0x0465 , 0x08},\r
411         {0x0466 , 0x11},\r
412         {0x0467 , 0x09},\r
413         {0x0468 , 0x23},\r
414         {0x0469 , 0x2A},\r
415         {0x046A , 0x2A},\r
416         {0x046B , 0x47},\r
417         {0x046C , 0x52},\r
418         {0x046D , 0x42},\r
419         {0x046E , 0x36},\r
420         {0x046F , 0x46},\r
421         {0x0470 , 0x3A},\r
422         {0x0471 , 0x32},\r
423         {0x0472 , 0x32},\r
424         {0x0473 , 0x38},\r
425         {0x0474 , 0x3D},\r
426         {0x0475 , 0x2F},\r
427         {0x0476 , 0x29},\r
428         {0x0477 , 0x48},\r
429         {0x0600 , 0x00},\r
430         {0x0601 , 0x24},\r
431         {0x0602 , 0x45},\r
432         {0x0603 , 0x0E},\r
433         {0x0604 , 0x14},\r
434         {0x0605 , 0x2F},\r
435         {0x0606 , 0x01},\r
436         {0x0607 , 0x0E},\r
437         {0x0608 , 0x0E},\r
438         {0x0609 , 0x37},\r
439         {0x060A , 0x18},\r
440         {0x060B , 0xA0},\r
441         {0x060C , 0x20},\r
442         {0x060D , 0x07},\r
443         {0x060E , 0x47},\r
444         {0x060F , 0x90},\r
445         {0x0610 , 0x06},\r
446         {0x0611 , 0x0C},\r
447         {0x0612 , 0x28},\r
448         {0x0613 , 0x13},\r
449         {0x0614 , 0x0B},\r
450         {0x0615 , 0x10},\r
451         {0x0616 , 0x14},\r
452         {0x0617 , 0x19},\r
453         {0x0618 , 0x52},\r
454         {0x0619 , 0xA0},\r
455         {0x061A , 0x11},\r
456         {0x061B , 0x33},\r
457         {0x061C , 0x56},\r
458         {0x061D , 0x20},\r
459         {0x061E , 0x28},\r
460         {0x061F , 0x2B},\r
461         {0x0620 , 0x22},\r
462         {0x0621 , 0x11},\r
463         {0x0622 , 0x75},\r
464         {0x0623 , 0x49},\r
465         {0x0624 , 0x6E},\r
466         {0x0625 , 0x80},\r
467         {0x0626 , 0x02},\r
468         {0x0627 , 0x0C},\r
469         {0x0628 , 0x51},\r
470         {0x0629 , 0x25},\r
471         {0x062A , 0x01},\r
472         {0x062B , 0x3D},\r
473         {0x062C , 0x04},\r
474         {0x062D , 0x01},\r
475         {0x062E , 0x0C},\r
476         {0x062F , 0x2C},\r
477         {0x0630 , 0x0D},\r
478         {0x0631 , 0x14},\r
479         {0x0632 , 0x12},\r
480         {0x0633 , 0x34},\r
481         {0x0634 , 0x00},\r
482         {0x0635 , 0x00},\r
483         {0x0636 , 0x00},\r
484         {0x0637 , 0xB1},\r
485         {0x0638 , 0x22},\r
486         {0x0639 , 0x32},\r
487         {0x063A , 0x0E},\r
488         {0x063B , 0x18},\r
489         {0x063C , 0x88},\r
490         {0x0640 , 0xB2},\r
491         {0x0641 , 0xC0},\r
492         {0x0642 , 0x01},\r
493         {0x0643 , 0x26},\r
494         {0x0644 , 0x13},\r
495         {0x0645 , 0x88},\r
496         {0x0646 , 0x64},\r
497         {0x0647 , 0x00},\r
498         {0x0681 , 0x1B},\r
499         {0x0682 , 0xA0},\r
500         {0x0683 , 0x28},\r
501         {0x0684 , 0x00},\r
502         {0x0685 , 0xB0},\r
503         {0x0686 , 0x6F},\r
504         {0x0687 , 0x33},\r
505         {0x0688 , 0x1F},\r
506         {0x0689 , 0x44},\r
507         {0x068A , 0xA8},\r
508         {0x068B , 0x44},\r
509         {0x068C , 0x08},\r
510         {0x068D , 0x08},\r
511         {0x068E , 0x00},\r
512         {0x068F , 0x00},\r
513         {0x0690 , 0x01},\r
514         {0x0691 , 0x00},\r
515         {0x0692 , 0x01},\r
516         {0x0693 , 0x00},\r
517         {0x0694 , 0x00},\r
518         {0x0695 , 0x00},\r
519         {0x0696 , 0x00},\r
520         {0x0697 , 0x00},\r
521         {0x0698 , 0x2A},\r
522         {0x0699 , 0x80},\r
523         {0x069A , 0x1F},\r
524         {0x069B , 0x00},\r
525         {0x069C , 0x02},\r
526         {0x069D , 0xF5},\r
527         {0x069E , 0x03},\r
528         {0x069F , 0x6D},\r
529         {0x06A0 , 0x0C},\r
530         {0x06A1 , 0xB8},\r
531         {0x06A2 , 0x0D},\r
532         {0x06A3 , 0x74},\r
533         {0x06A4 , 0x00},\r
534         {0x06A5 , 0x2F},\r
535         {0x06A6 , 0x00},\r
536         {0x06A7 , 0x2F},\r
537         {0x0F00 , 0x00},\r
538         {0x0F01 , 0x00},\r
539         {0x0100 , 0x01},\r
540         {0x0102 , 0x02},\r
541         {0x0104 , 0x03},\r
542         \r
543         \r
544         ///////////////////////////\r
545         {0x020B , 0x48},\r
546         {0x020C , 0x64},\r
547         {0x040A , 0x40},\r
548         {0x040B , 0x33},\r
549         {0x0109 , 0x00},\r
550         {0x010A , 0x04},\r
551         {0x010B , 0x03},\r
552         \r
553         {0x0110, 0x03},\r
554         {0x0111, 0x20},\r
555         {0x0112, 0x02},\r
556         {0x0113, 0x58},\r
557         \r
558         {0x0116 , 0x02},\r
559         {0x0118 , 0x56},//56  0x40\r
560         {0x0119 , 0x02},\r
561         {0x011a , 0x04},\r
562         {0x011B , 0x01},\r
563         {0x0313 , 0x36},//36\r
564         {0x0314 , 0xff},//ff\r
565         {0x0315 , 0x16},\r
566         /*\r
567            {0x020B , 0x48},\r
568            {0x020C , 0x64},\r
569            {0x040A , 0x40},\r
570            {0x040B , 0x33},\r
571            {0x0109 , 0x00},\r
572            {0x010A , 0x04},\r
573            {0x010B , 0x03},\r
574            {0x010c , 0x00},\r
575            {0x010d , 0xa8},\r
576            {0x010e , 0x00},\r
577            {0x010f , 0x60},\r
578            {0x010a , 0x04},\r
579         \r
580            {0x0110 , 0x02},\r
581            {0x0111 , 0x80},\r
582            {0x0112 , 0x01},\r
583            {0x0113 , 0xe0},\r
584         \r
585            {0x0116 , 0x02},\r
586            {0x0118 , 0x40},\r
587            {0x0119 , 0x01},\r
588            {0x011a , 0x04},\r
589            {0x011B , 0x00},\r
590            {0x0313 , 0x35},\r
591            {0x0314 , 0x36},\r
592            {0x0315 , 0x16}, */\r
593         SensorEnd\r
594 };\r
595 /* Senor full resolution setting: recommand for capture */\r
596 static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={\r
597         //Binning&Resoultion\r
598         {0x0109 , 0x01},//Fixed the number of lines by VCOUNT setting\r
599         {0x010A , 0x00},\r
600         {0x010B , 0x00},\r
601         \r
602         {0x0110 , 0x06},\r
603         {0x0111 , 0x40},\r
604         {0x0112 , 0x04},\r
605         {0x0113 , 0xB0}, // 1600*1200 SETTING\r
606         SensorEnd\r
607 \r
608 };\r
609 \r
610 /* Senor full resolution setting: recommand for video */\r
611 static struct rk_sensor_reg sensor_fullres_highfps_data[] ={\r
612         SensorEnd\r
613 };\r
614 /* Preview resolution setting*/\r
615 static struct rk_sensor_reg sensor_preview_data[] =\r
616 {\r
617         {0x0109 , 0x00},\r
618         {0x010A , 0x04},\r
619         {0x010B , 0x03},\r
620         \r
621         {0x0110 , 0x02},\r
622         {0x0111 , 0x80},\r
623         {0x0112 , 0x01},\r
624         {0x0113 , 0xe0},\r
625         SensorEnd\r
626 };\r
627 /* 1280x720 */\r
628 static struct rk_sensor_reg sensor_720p[]={\r
629         SensorEnd\r
630 };\r
631 \r
632 /* 1920x1080 */\r
633 static struct rk_sensor_reg sensor_1080p[]={\r
634         SensorEnd\r
635 };\r
636 \r
637 \r
638 static struct rk_sensor_reg sensor_softreset_data[]={\r
639         SensorEnd\r
640 };\r
641 \r
642 static struct rk_sensor_reg sensor_check_id_data[]={\r
643         SensorRegVal(0x0000,0),\r
644         SensorRegVal(0x0001,0),\r
645         SensorEnd\r
646 };\r
647 /*\r
648 *  The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx\r
649 */\r
650 static struct rk_sensor_reg sensor_WhiteB_Auto[]=\r
651 {\r
652         {0x031a , 0x81},\r
653         {0x0320 , 0x24},\r
654         {0x0321 , 0x14},\r
655         {0x0322 , 0x1a},\r
656         {0x0323 , 0x24},\r
657         {0x0441 , 0x4B},\r
658         {0x0442 , 0x00},\r
659         {0x0443 , 0x00},\r
660         {0x0444 , 0x31},\r
661         SensorEnd\r
662 };\r
663 /* Cloudy Colour Temperature : 6500K - 8000K  */\r
664 static  struct rk_sensor_reg sensor_WhiteB_Cloudy[]=\r
665 {\r
666            {0x0320 , 0x02},\r
667         {0x0321 , 0x02},\r
668         {0x0322 , 0x02},\r
669         {0x0323 , 0x02},\r
670         {0x0441 , 0x80},\r
671         {0x0442 , 0x00},\r
672         {0x0443 , 0x00},\r
673         {0x0444 , 0x0D},                \r
674         SensorEnd\r
675 };\r
676 /* ClearDay Colour Temperature : 5000K - 6500K  */\r
677 static  struct rk_sensor_reg sensor_WhiteB_ClearDay[]=\r
678 {\r
679         //Sunny\r
680                         {0x0320 , 0x02},\r
681                         {0x0321 , 0x02},\r
682                         {0x0322 , 0x02},\r
683                         {0x0323 , 0x02},\r
684                         {0x0441 , 0x60},\r
685                         {0x0442 , 0x00},\r
686                         {0x0443 , 0x00},\r
687                         {0x0444 , 0x14},\r
688         SensorEnd\r
689 };\r
690 /* Office Colour Temperature : 3500K - 5000K  */\r
691 static  struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]=\r
692 {\r
693         //Office\r
694         {0x0320 , 0x02},\r
695         {0x0321 , 0x02},\r
696         {0x0322 , 0x02},\r
697         {0x0323 , 0x02},\r
698         {0x0441 , 0x50},\r
699         {0x0442 , 0x00},\r
700         {0x0443 , 0x00},\r
701         {0x0444 , 0x30},\r
702         SensorEnd\r
703 \r
704 };\r
705 /* Home Colour Temperature : 2500K - 3500K      */\r
706 static  struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]=\r
707 {\r
708         //Home\r
709         {0x0320 , 0x02},\r
710         {0x0321 , 0x02},\r
711         {0x0322 , 0x02},\r
712         {0x0323 , 0x02},\r
713         {0x0441 , 0x0B},\r
714         {0x0442 , 0x00},\r
715         {0x0443 , 0x00},\r
716         {0x0444 , 0x5E},\r
717         SensorEnd\r
718 };\r
719 static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2,\r
720         sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL,\r
721 };\r
722 \r
723 static  struct rk_sensor_reg sensor_Brightness0[]=\r
724 {\r
725         // Brightness -2\r
726         {0x0300 , 0x81},\r
727         {0x0301 , 0x60},\r
728         SensorEnd\r
729 };\r
730 \r
731 static  struct rk_sensor_reg sensor_Brightness1[]=\r
732 {\r
733         // Brightness -1\r
734          {0x0300 , 0x81},\r
735         {0x0301 , 0x70},\r
736         \r
737         \r
738         SensorEnd\r
739 };\r
740 \r
741 static  struct rk_sensor_reg sensor_Brightness2[]=\r
742 {\r
743         //      Brightness 0\r
744         {0x0300 , 0x81},\r
745         {0x0301 , 0x80},\r
746         \r
747         SensorEnd\r
748 };\r
749 \r
750 static  struct rk_sensor_reg sensor_Brightness3[]=\r
751 {\r
752         // Brightness +1\r
753         {0x0300 , 0x81},\r
754         {0x0301 , 0x90},\r
755         \r
756         SensorEnd\r
757 };\r
758 \r
759 static  struct rk_sensor_reg sensor_Brightness4[]=\r
760 {\r
761         //      Brightness +2\r
762         {0x0300 , 0x81},\r
763         {0x0301 , 0xa0},\r
764         \r
765 \r
766         SensorEnd\r
767 };\r
768 \r
769 static  struct rk_sensor_reg sensor_Brightness5[]=\r
770 {\r
771         //      Brightness +3\r
772         {0x0300 , 0x81},\r
773         {0x0301 , 0xb0},\r
774 \r
775         SensorEnd\r
776 };\r
777 static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3,\r
778         sensor_Brightness4, sensor_Brightness5,NULL,\r
779 };\r
780 \r
781 static  struct rk_sensor_reg sensor_Effect_Normal[] =\r
782 {\r
783         {0x0115,0x00},\r
784         SensorEnd\r
785 };\r
786 \r
787 static  struct rk_sensor_reg sensor_Effect_WandB[] =\r
788 {\r
789         {0x0115,0x06},\r
790         SensorEnd\r
791 };\r
792 \r
793 static  struct rk_sensor_reg sensor_Effect_Sepia[] =\r
794 {\r
795         {0x0115,0x0a},\r
796         {0x026e,0x60},\r
797         {0x026f,0xa0},\r
798         SensorEnd\r
799 };\r
800 \r
801 static  struct rk_sensor_reg sensor_Effect_Negative[] =\r
802 {\r
803         //Negative\r
804         {0x0115,0x09}, //bit[6] negative\r
805         SensorEnd\r
806 };\r
807 static  struct rk_sensor_reg sensor_Effect_Bluish[] =\r
808 {\r
809         // Bluish\r
810         {0x0115,0x0a},\r
811         {0x026e,0xfb},\r
812         {0x026f,0x00},\r
813         SensorEnd\r
814 };\r
815 \r
816 static  struct rk_sensor_reg sensor_Effect_Green[] =\r
817 {\r
818         //      Greenish\r
819         {0x0115,0x0a},\r
820         {0x026e,0x20},\r
821         {0x026f,0x00},\r
822         SensorEnd\r
823 };\r
824 static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia,\r
825         sensor_Effect_Bluish, sensor_Effect_Green,NULL,\r
826 };\r
827 \r
828 static  struct rk_sensor_reg sensor_Exposure0[]=\r
829 {\r
830         //-3\r
831         {0x0300 , 0x81},\r
832         {0x0301 , 0x50},\r
833         {0x0201 , 0xa0},\r
834         SensorEnd\r
835 };\r
836 \r
837 static  struct rk_sensor_reg sensor_Exposure1[]=\r
838 {\r
839         //-2\r
840         {0x0300 , 0x81},\r
841         {0x0301 , 0x60},\r
842         {0x0201 , 0xb0},\r
843 \r
844         SensorEnd\r
845 };\r
846 \r
847 static  struct rk_sensor_reg sensor_Exposure2[]=\r
848 {\r
849         //-0.3EV\r
850         {0x0300 , 0x81},\r
851         {0x0301 , 0x70},\r
852         {0x0201 , 0xd0},\r
853         SensorEnd\r
854 };\r
855 \r
856 static  struct rk_sensor_reg sensor_Exposure3[]=\r
857 {\r
858         //default\r
859         {0x0300 , 0x81},\r
860         {0x0301 , 0x80},\r
861         {0x0201 , 0x10},//0c\r
862         SensorEnd\r
863 };\r
864 \r
865 static  struct rk_sensor_reg sensor_Exposure4[]=\r
866 {\r
867         // 1\r
868         {0x0300 , 0x81},\r
869         {0x0301 , 0x90},\r
870         {0x0201 , 0x30},\r
871         SensorEnd\r
872 };\r
873 \r
874 static  struct rk_sensor_reg sensor_Exposure5[]=\r
875 {\r
876         // 2\r
877         {0x0300 , 0x81},\r
878         {0x0301 , 0xa0},\r
879         {0x0201 , 0x50},\r
880         SensorEnd\r
881 };\r
882 \r
883 static  struct rk_sensor_reg sensor_Exposure6[]=\r
884 {\r
885         // 3\r
886         {0x0300 , 0x81},\r
887         {0x0301 , 0xb0},\r
888         {0x0201 , 0x60},\r
889         SensorEnd\r
890 };\r
891 \r
892 static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3,\r
893         sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL,\r
894 };\r
895 \r
896 static  struct rk_sensor_reg sensor_Saturation0[]=\r
897 {\r
898         {0x0202 , 0x40},\r
899         SensorEnd\r
900 };\r
901 \r
902 static  struct rk_sensor_reg sensor_Saturation1[]=\r
903 {\r
904         {0x0202 , 0x50},\r
905         SensorEnd\r
906 };\r
907 \r
908 static  struct rk_sensor_reg sensor_Saturation2[]=\r
909 {\r
910         {0x0202 , 0x60},\r
911         SensorEnd\r
912 };\r
913 static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,};\r
914 \r
915 static  struct rk_sensor_reg sensor_Contrast0[]=\r
916 {\r
917         //Contrast -3\r
918         {0x0200 , 0xe8},\r
919         SensorEnd\r
920 };\r
921 \r
922 static  struct rk_sensor_reg sensor_Contrast1[]=\r
923 {\r
924          //Contrast -2\r
925         {0x0200 , 0xf0},\r
926         SensorEnd\r
927 };\r
928 \r
929 static  struct rk_sensor_reg sensor_Contrast2[]=\r
930 {\r
931          // Contrast -1\r
932         {0x0200 , 0xf8},\r
933         SensorEnd\r
934 };\r
935 \r
936 static  struct rk_sensor_reg sensor_Contrast3[]=\r
937 {\r
938         //Contrast 0\r
939         {0x0200 , 0x00},\r
940         SensorEnd\r
941 };\r
942 \r
943 static  struct rk_sensor_reg sensor_Contrast4[]=\r
944 {\r
945         //Contrast +1\r
946         {0x0200 , 0x10},\r
947         SensorEnd\r
948 };\r
949 \r
950 \r
951 static  struct rk_sensor_reg sensor_Contrast5[]=\r
952 {\r
953         //Contrast +2\r
954         {0x0200 , 0x20},\r
955         SensorEnd\r
956 };\r
957 \r
958 static  struct rk_sensor_reg sensor_Contrast6[]=\r
959 {\r
960         //Contrast +3\r
961         {0x0200 , 0x30},\r
962         SensorEnd\r
963 };\r
964 static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3,\r
965         sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL,\r
966 };\r
967 static  struct rk_sensor_reg sensor_SceneAuto[] =\r
968 {\r
969         {0x0312, 0x08},\r
970         SensorEnd\r
971 };\r
972 \r
973 static  struct rk_sensor_reg sensor_SceneNight[] =\r
974 {\r
975         //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk\r
976         \r
977         \r
978          {0x0312, 0x98},\r
979         SensorEnd\r
980 };\r
981 static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,};\r
982 \r
983 static struct rk_sensor_reg sensor_Zoom0[] =\r
984 {\r
985         SensorEnd\r
986 };\r
987 \r
988 static struct rk_sensor_reg sensor_Zoom1[] =\r
989 {\r
990         SensorEnd\r
991 };\r
992 \r
993 static struct rk_sensor_reg sensor_Zoom2[] =\r
994 {\r
995         SensorEnd\r
996 };\r
997 \r
998 \r
999 static struct rk_sensor_reg sensor_Zoom3[] =\r
1000 {\r
1001         SensorEnd\r
1002 };\r
1003 static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,};\r
1004 \r
1005 /*\r
1006 * User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu\r
1007 */\r
1008 static struct v4l2_querymenu sensor_menus[] =\r
1009 {\r
1010 };\r
1011 /*\r
1012 * User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl\r
1013 */\r
1014 static struct sensor_v4l2ctrl_usr_s sensor_controls[] =\r
1015 {\r
1016 };\r
1017 \r
1018 //MUST define the current used format as the first item   \r
1019 static struct rk_sensor_datafmt sensor_colour_fmts[] = {\r
1020         {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} \r
1021 };\r
1022 static struct soc_camera_ops sensor_ops;\r
1023 \r
1024 \r
1025 /*\r
1026 **********************************************************\r
1027 * Following is local code:\r
1028\r
1029 * Please codeing your program here \r
1030 **********************************************************\r
1031 */\r
1032 /*\r
1033 **********************************************************\r
1034 * Following is callback\r
1035 * If necessary, you could coding these callback\r
1036 **********************************************************\r
1037 */\r
1038 /*\r
1039 * the function is called in open sensor  \r
1040 */\r
1041 static int sensor_activate_cb(struct i2c_client *client)\r
1042 {\r
1043         \r
1044         return 0;\r
1045 }\r
1046 /*\r
1047 * the function is called in close sensor\r
1048 */\r
1049 static int sensor_deactivate_cb(struct i2c_client *client)\r
1050 {\r
1051         \r
1052         return 0;\r
1053 }\r
1054 /*\r
1055 * the function is called before sensor register setting in VIDIOC_S_FMT  \r
1056 */\r
1057 static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture)\r
1058 {\r
1059 \r
1060         return 0;\r
1061 }\r
1062 /*\r
1063 * the function is called after sensor register setting finished in VIDIOC_S_FMT  \r
1064 */\r
1065 static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture)\r
1066 {\r
1067         return 0;\r
1068 }\r
1069 static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series)\r
1070 {\r
1071         \r
1072         return 0;\r
1073 }\r
1074 static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series)\r
1075 {\r
1076         return 0;\r
1077 }\r
1078 static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf)\r
1079 {\r
1080         return 0;\r
1081 }\r
1082 static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg)\r
1083 {\r
1084         //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));\r
1085                 \r
1086         if (pm_msg.event == PM_EVENT_SUSPEND) {\r
1087                 SENSOR_DG("Suspend");\r
1088                 \r
1089         } else {\r
1090                 SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event);\r
1091                 return -EINVAL;\r
1092         }\r
1093         return 0;\r
1094 }\r
1095 \r
1096 static int sensor_resume(struct soc_camera_device *icd)\r
1097 {\r
1098 \r
1099         SENSOR_DG("Resume");\r
1100 \r
1101         return 0;\r
1102 \r
1103 }\r
1104 static int sensor_mirror_cb (struct i2c_client *client, int mirror)\r
1105 {\r
1106         char val;\r
1107         int err = 0;\r
1108         \r
1109         SENSOR_DG("mirror: %d",mirror);\r
1110         if (mirror) {\r
1111                 err = sensor_read(client, 0x0101, &val);\r
1112                 if (err == 0) {\r
1113                         if((val & 0x1) == 0){\r
1114                                 err = sensor_write(client, 0x0101, (val |0x1));\r
1115                                 }\r
1116                         else \r
1117                                 err = sensor_write(client, 0x0101, (val & 0xfe));\r
1118                 }\r
1119         } else {\r
1120                 //do nothing\r
1121         }\r
1122         return err;    \r
1123 }\r
1124 /*\r
1125 * the function is v4l2 control V4L2_CID_HFLIP callback  \r
1126 */\r
1127 static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, \r
1128                                                                                                          struct v4l2_ext_control *ext_ctrl)\r
1129 {\r
1130         struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));\r
1131 \r
1132         if (sensor_mirror_cb(client,ext_ctrl->value) != 0)\r
1133                 SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value);\r
1134         \r
1135         SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value);\r
1136         return 0;\r
1137 }\r
1138 \r
1139 static int sensor_flip_cb(struct i2c_client *client, int flip)\r
1140 {\r
1141         char val;\r
1142         int err = 0;    \r
1143 \r
1144         SENSOR_DG("flip: %d",flip);\r
1145         if (flip) {\r
1146                 err = sensor_read(client, 0x0101, &val);\r
1147                 if (err == 0) {\r
1148                         if((val & 0x2) == 0){\r
1149                                 err = sensor_write(client, 0x0101, (val |0x2));\r
1150                                 }\r
1151                         else {\r
1152                                 err = sensor_write(client, 0x0101, (val & 0xfc));\r
1153                                 }\r
1154                 }\r
1155         } else {\r
1156                 //do nothing\r
1157         }\r
1158 \r
1159         return err;    \r
1160 }\r
1161 /*\r
1162 * the function is v4l2 control V4L2_CID_VFLIP callback  \r
1163 */\r
1164 static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, \r
1165                                                                                                          struct v4l2_ext_control *ext_ctrl)\r
1166 {\r
1167         struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));\r
1168 \r
1169         if (sensor_flip_cb(client,ext_ctrl->value) != 0)\r
1170                 SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value);\r
1171         \r
1172         SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value);\r
1173         return 0;\r
1174 }\r
1175 /*\r
1176 * the functions are focus callbacks\r
1177 */\r
1178 static int sensor_focus_init_usr_cb(struct i2c_client *client){\r
1179         return 0;\r
1180 }\r
1181 \r
1182 static int sensor_focus_af_single_usr_cb(struct i2c_client *client){\r
1183         return 0;\r
1184 }\r
1185 \r
1186 static int sensor_focus_af_near_usr_cb(struct i2c_client *client){\r
1187         return 0;\r
1188 }\r
1189 \r
1190 static int sensor_focus_af_far_usr_cb(struct i2c_client *client){\r
1191         return 0;\r
1192 }\r
1193 \r
1194 static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){\r
1195         return 0;\r
1196 }\r
1197 \r
1198 static int sensor_focus_af_const_usr_cb(struct i2c_client *client){\r
1199         return 0;\r
1200 }\r
1201 static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client)
1202 {
1203     return 0;
1204 }\r
1205 static int sensor_focus_af_close_usr_cb(struct i2c_client *client){\r
1206         return 0;\r
1207 }\r
1208 \r
1209 static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos)\r
1210 {\r
1211         return 0;\r
1212 }\r
1213 \r
1214 /*\r
1215 face defect call back\r
1216 */\r
1217 static int      sensor_face_detect_usr_cb(struct i2c_client *client,int on){\r
1218         return 0;\r
1219 }\r
1220 \r
1221 /*\r
1222 *       The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some\r
1223 * initialization in the function. \r
1224 */\r
1225 static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd)\r
1226 {\r
1227         return;\r
1228 }\r
1229 \r
1230 /*\r
1231 * :::::WARNING:::::\r
1232 * It is not allowed to modify the following code\r
1233 */\r
1234 \r
1235 sensor_init_parameters_default_code();\r
1236 \r
1237 sensor_v4l2_struct_initialization();\r
1238 \r
1239 sensor_probe_default_code();\r
1240 \r
1241 sensor_remove_default_code();\r
1242 \r
1243 sensor_driver_default_module_code();\r
1244 \r
1245 \r
1246 \r
1247 \r
1248 \r
1249 \r