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