VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / media / video / tda9887.c
1 #include <linux/module.h>
2 #include <linux/kernel.h>
3 #include <linux/i2c.h>
4 #include <linux/types.h>
5 #include <linux/videodev.h>
6 #include <linux/init.h>
7 #include <linux/errno.h>
8 #include <linux/slab.h>
9
10 #include <media/audiochip.h>
11 #include <media/id.h>
12
13 /* Chips:
14    TDA9885 (PAL, NTSC)
15    TDA9886 (PAL, SECAM, NTSC)
16    TDA9887 (PAL, SECAM, NTSC, FM Radio)
17
18    found on:
19    - Pinnacle PCTV (Jul.2002 Version with MT2032, bttv)
20       TDA9887 (world), TDA9885 (USA)
21       Note: OP2 of tda988x must be set to 1, else MT2032 is disabled!
22    - KNC One TV-Station RDS (saa7134)
23 */
24
25
26 /* Addresses to scan */
27 static unsigned short normal_i2c[] = {
28         0x86 >>1,
29         0x96 >>1,
30         I2C_CLIENT_END,
31 };
32 static unsigned short normal_i2c_range[] = {I2C_CLIENT_END,I2C_CLIENT_END};
33 I2C_CLIENT_INSMOD;
34
35 /* insmod options */
36 static unsigned int debug = 0;
37 MODULE_PARM(debug,"i");
38 MODULE_LICENSE("GPL");
39
40 /* ---------------------------------------------------------------------- */
41
42 #define UNSET       (-1U)
43 #define PREFIX      "tda9885/6/7: "
44 #define dprintk     if (debug) printk
45
46 struct tda9887 {
47         struct i2c_client  client;
48         v4l2_std_id        std;
49         unsigned int       radio;
50         unsigned int       pinnacle_id;
51         unsigned int       using_v4l2;
52 };
53
54 struct tvnorm {
55         v4l2_std_id       std;
56         char              *name;
57         unsigned char     b;
58         unsigned char     c;
59         unsigned char     e;
60 };
61
62 static struct i2c_driver driver;
63 static struct i2c_client client_template;
64
65 /* ---------------------------------------------------------------------- */
66
67 //
68 // TDA defines
69 //
70
71 //// first reg (b)
72 #define cVideoTrapBypassOFF     0x00    // bit b0
73 #define cVideoTrapBypassON      0x01    // bit b0
74
75 #define cAutoMuteFmInactive     0x00    // bit b1
76 #define cAutoMuteFmActive       0x02    // bit b1
77
78 #define cIntercarrier           0x00    // bit b2
79 #define cQSS                    0x04    // bit b2
80
81 #define cPositiveAmTV           0x00    // bit b3:4
82 #define cFmRadio                0x08    // bit b3:4
83 #define cNegativeFmTV           0x10    // bit b3:4
84
85
86 #define cForcedMuteAudioON      0x20    // bit b5
87 #define cForcedMuteAudioOFF     0x00    // bit b5
88
89 #define cOutputPort1Active      0x00    // bit b6
90 #define cOutputPort1Inactive    0x40    // bit b6
91
92 #define cOutputPort2Active      0x00    // bit b7
93 #define cOutputPort2Inactive    0x80    // bit b7
94
95
96 //// second reg (c)
97 #define cDeemphasisOFF          0x00    // bit c5
98 #define cDeemphasisON           0x20    // bit c5
99
100 #define cDeemphasis75           0x00    // bit c6
101 #define cDeemphasis50           0x40    // bit c6
102
103 #define cAudioGain0             0x00    // bit c7
104 #define cAudioGain6             0x80    // bit c7
105
106
107 //// third reg (e)
108 #define cAudioIF_4_5             0x00    // bit e0:1
109 #define cAudioIF_5_5             0x01    // bit e0:1
110 #define cAudioIF_6_0             0x02    // bit e0:1
111 #define cAudioIF_6_5             0x03    // bit e0:1
112
113
114 #define cVideoIF_58_75           0x00    // bit e2:4
115 #define cVideoIF_45_75           0x04    // bit e2:4
116 #define cVideoIF_38_90           0x08    // bit e2:4
117 #define cVideoIF_38_00           0x0C    // bit e2:4
118 #define cVideoIF_33_90           0x10    // bit e2:4
119 #define cVideoIF_33_40           0x14    // bit e2:4
120 #define cRadioIF_45_75           0x18    // bit e2:4
121 #define cRadioIF_38_90           0x1C    // bit e2:4
122
123
124 #define cTunerGainNormal         0x00    // bit e5
125 #define cTunerGainLow            0x20    // bit e5
126
127 #define cGating_18               0x00    // bit e6
128 #define cGating_36               0x40    // bit e6
129
130 #define cAgcOutON                0x80    // bit e7
131 #define cAgcOutOFF               0x00    // bit e7
132
133 /* ---------------------------------------------------------------------- */
134
135 static struct tvnorm tvnorms[] = {
136         {
137                 .std   = V4L2_STD_PAL_BG,
138                 .name  = "PAL-BG",
139                 .b     = ( cNegativeFmTV  |
140                            cQSS           ),
141                 .c     = ( cDeemphasisON  |
142                            cDeemphasis50  ),
143                 .e     = ( cAudioIF_5_5   |
144                            cVideoIF_38_90 ),
145         },{
146                 .std   = V4L2_STD_PAL_I,
147                 .name  = "PAL-I",
148                 .b     = ( cNegativeFmTV  |
149                            cQSS           ),
150                 .c     = ( cDeemphasisON  |
151                            cDeemphasis50  ),
152                 .e     = ( cAudioIF_6_0   |
153                            cVideoIF_38_90 ),
154         },{
155                 .std   = V4L2_STD_PAL_DK,
156                 .name  = "PAL-DK",
157                 .b     = ( cNegativeFmTV  |
158                            cQSS           ),
159                 .c     = ( cDeemphasisON  |
160                            cDeemphasis50  ),
161                 .e     = ( cAudioIF_6_5   |
162                            cVideoIF_38_00 ),
163         },{
164                 .std   = V4L2_STD_PAL_M | V4L2_STD_PAL_N,
165                 .name  = "PAL-M/N",
166                 .b     = ( cNegativeFmTV  |
167                            cQSS           ),
168                 .c     = ( cDeemphasisON  |
169                            cDeemphasis75  ),
170                 .e     = ( cAudioIF_4_5   |
171                            cVideoIF_45_75 ),
172         },{
173                 .std   = V4L2_STD_SECAM_L,
174                 .name  = "SECAM-L",
175                 .b     = ( cPositiveAmTV  |
176                            cQSS           ),
177                 .e     = ( cAudioIF_6_5   |
178                            cVideoIF_38_90 ),
179         },{
180                 .std   = V4L2_STD_SECAM_DK,
181                 .name  = "SECAM-DK",
182                 .b     = ( cNegativeFmTV  |
183                            cQSS           ),
184                 .c     = ( cDeemphasisON  |
185                            cDeemphasis50  ),
186                 .e     = ( cAudioIF_6_5   |
187                            cVideoIF_38_00 ),
188         },{
189                 .std   = V4L2_STD_NTSC_M,
190                 .name  = "NTSC-M",
191                 .b     = ( cNegativeFmTV  |
192                            cQSS           ),
193                 .c     = ( cDeemphasisON  |
194                            cDeemphasis50  ),
195                 .e     = ( cGating_36     |
196                            cAudioIF_4_5   |
197                            cVideoIF_45_75 ),
198         },{
199                 .std   = V4L2_STD_NTSC_M_JP,
200                 .name  = "NTSC-JP",
201                 .b     = ( cNegativeFmTV  |
202                            cQSS           ),
203                 .c     = ( cDeemphasisON  |
204                            cDeemphasis50  ),
205                 .e     = ( cGating_36     |
206                            cAudioIF_4_5   |
207                            cVideoIF_58_75 ),
208         }
209 };
210
211 static struct tvnorm radio = {
212         .name = "radio",
213         .b    = ( cFmRadio       |
214                   cQSS           ),
215         .c    = ( cDeemphasisON  |
216                   cDeemphasis50  ),
217         .e    = ( cAudioIF_5_5   |
218                   cRadioIF_38_90 ),
219 };
220
221 /* ---------------------------------------------------------------------- */
222
223 static void dump_read_message(unsigned char *buf)
224 {
225         static char *afc[16] = {
226                 "- 12.5 kHz",
227                 "- 37.5 kHz",
228                 "- 62.5 kHz",
229                 "- 87.5 kHz",
230                 "-112.5 kHz",
231                 "-137.5 kHz",
232                 "-162.5 kHz",
233                 "-187.5 kHz [min]",
234                 "+187.5 kHz [max]",
235                 "+162.5 kHz",
236                 "+137.5 kHz",
237                 "+112.5 kHz",
238                 "+ 87.5 kHz",
239                 "+ 62.5 kHz",
240                 "+ 37.5 kHz",
241                 "+ 12.5 kHz",
242         };
243         printk(PREFIX "read: 0x%2x\n", buf[0]);
244         printk("  after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no");
245         printk("  afc            : %s\n", afc[(buf[0] >> 1) & 0x0f]);
246         printk("  afc window     : %s\n", (buf[0] & 0x40) ? "in" : "out");
247         printk("  vfi level      : %s\n", (buf[0] & 0x80) ? "high" : "low");
248 }
249
250 static void dump_write_message(unsigned char *buf)
251 {
252         static char *sound[4] = {
253                 "AM/TV",
254                 "FM/radio",
255                 "FM/TV",
256                 "FM/radio"
257         };
258         static char *adjust[32] = {
259                 "-16", "-15", "-14", "-13", "-12", "-11", "-10", "-9",
260                 "-8",  "-7",  "-6",  "-5",  "-4",  "-3",  "-2",  "-1",
261                 "0",   "+1",  "+2",  "+3",  "+4",  "+5",  "+6",  "+7",
262                 "+8",  "+9",  "+10", "+11", "+12", "+13", "+14", "+15"
263         };
264         static char *deemph[4] = {
265                 "no", "no", "75", "50"
266         };
267         static char *carrier[4] = {
268                 "4.5 MHz",
269                 "5.5 MHz",
270                 "6.0 MHz",
271                 "6.5 MHz / AM"
272         };
273         static char *vif[8] = {
274                 "58.75 MHz",
275                 "45.75 MHz",
276                 "38.9 MHz",
277                 "38.0 MHz",
278                 "33.9 MHz",
279                 "33.4 MHz",
280                 "45.75 MHz + pin13",
281                 "38.9 MHz + pin13",
282         };
283         static char *rif[4] = {
284                 "44 MHz",
285                 "52 MHz",
286                 "52 MHz",
287                 "44 MHz",
288         };
289
290         printk(PREFIX "write: byte B 0x%02x\n",buf[1]);
291         printk("  B0   video mode      : %s\n",
292                (buf[1] & 0x01) ? "video trap" : "sound trap");
293         printk("  B1   auto mute fm    : %s\n",
294                (buf[1] & 0x02) ? "yes" : "no");
295         printk("  B2   carrier mode    : %s\n",
296                (buf[1] & 0x04) ? "QSS" : "Intercarrier");
297         printk("  B3-4 tv sound/radio  : %s\n",
298                sound[(buf[1] & 0x18) >> 3]);
299         printk("  B5   force mute audio: %s\n",
300                (buf[1] & 0x20) ? "yes" : "no");
301         printk("  B6   output port 1   : %s\n",
302                (buf[1] & 0x40) ? "high" : "low");
303         printk("  B7   output port 2   : %s\n",
304                (buf[1] & 0x80) ? "high" : "low");
305
306         printk(PREFIX "write: byte C 0x%02x\n",buf[2]);
307         printk("  C0-4 top adjustment  : %s dB\n", adjust[buf[2] & 0x1f]);
308         printk("  C5-6 de-emphasis     : %s\n", deemph[(buf[2] & 0x60) >> 5]);
309         printk("  C7   audio gain      : %s\n",
310                (buf[2] & 0x80) ? "-6" : "0");
311
312         printk(PREFIX "write: byte E 0x%02x\n",buf[3]);
313         printk("  E0-1 sound carrier   : %s\n",
314                carrier[(buf[3] & 0x03)]);
315         printk("  E6   l pll ganting   : %s\n",
316                (buf[3] & 0x40) ? "36" : "13");
317
318         if (buf[1] & 0x08) {
319                 /* radio */
320                 printk("  E2-4 video if        : %s\n",
321                        rif[(buf[3] & 0x0c) >> 2]);
322                 printk("  E7   vif agc output  : %s\n",
323                        (buf[3] & 0x80)
324                        ? ((buf[3] & 0x10) ? "fm-agc radio" : "sif-agc radio")
325                        : "fm radio carrier afc");
326         } else {
327                 /* video */
328                 printk("  E2-4 video if        : %s\n",
329                        vif[(buf[3] & 0x1c) >> 2]);
330                 printk("  E5   tuner gain      : %s\n",
331                        (buf[3] & 0x80)
332                        ? ((buf[3] & 0x20) ? "external" : "normal")
333                        : ((buf[3] & 0x20) ? "minimum"  : "normal"));
334                 printk("  E7   vif agc output  : %s\n",
335                        (buf[3] & 0x80)
336                        ? ((buf[3] & 0x20)
337                           ? "pin3 port, pin22 vif agc out"
338                           : "pin22 port, pin3 vif acg ext in")
339                        : "pin3+pin22 port");
340         }
341         printk("--\n");
342 }
343
344 /* ---------------------------------------------------------------------- */
345
346 static int tda9887_set_tvnorm(struct tda9887 *t, char *buf)
347 {
348         struct tvnorm *norm = NULL;
349         int i;
350
351         if (t->radio) {
352                 norm = &radio;
353         } else {
354                 for (i = 0; i < ARRAY_SIZE(tvnorms); i++) {
355                         if (tvnorms[i].std & t->std) {
356                                 norm = tvnorms+i;
357                                 break;
358                         }
359                 }
360         }
361         if (NULL == norm) {
362                 dprintk(PREFIX "Oops: no tvnorm entry found\n");
363                 return -1;
364         }
365
366         dprintk(PREFIX "configure for: %s\n",norm->name);
367         buf[1] = norm->b;
368         buf[2] = norm->c;
369         buf[3] = norm->e;
370         return 0;
371 }
372
373 static unsigned int port1  = 1;
374 static unsigned int port2  = 1;
375 static unsigned int qss    = UNSET;
376 static unsigned int adjust = 0x10;
377 MODULE_PARM(port1,"i");
378 MODULE_PARM(port2,"i");
379 MODULE_PARM(qss,"i");
380 MODULE_PARM(adjust,"i");
381
382 static int tda9887_set_insmod(struct tda9887 *t, char *buf)
383 {
384         if (port1)
385                 buf[1] |= cOutputPort1Inactive;
386         if (port2)
387                 buf[1] |= cOutputPort2Inactive;
388         if (UNSET != qss) {
389                 if (qss)
390                         buf[1] |= cQSS;
391                 else
392                         buf[1] &= ~cQSS;
393         }
394
395         if (adjust >= 0x00 && adjust < 0x20)
396                 buf[2] |= adjust;
397         return 0;
398 }
399
400 /* ---------------------------------------------------------------------- */
401
402 static int tda9887_set_pinnacle(struct tda9887 *t, char *buf)
403 {
404         unsigned int bCarrierMode = UNSET;
405
406         if (t->std & V4L2_STD_PAL) {
407                 if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) {
408                         bCarrierMode = cIntercarrier;
409                 } else {
410                         bCarrierMode = cQSS;
411                 }
412         }
413         if (t->std & V4L2_STD_NTSC) {
414                 if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
415                         bCarrierMode = cIntercarrier;
416                 } else {
417                         bCarrierMode = cQSS;
418                 }
419         }
420
421         if (bCarrierMode != UNSET) {
422                 buf[1] &= ~0x04;
423                 buf[1] |= bCarrierMode;
424         }
425         return 0;
426 }
427
428 /* ---------------------------------------------------------------------- */
429
430 static char *pal = "-";
431 MODULE_PARM(pal,"s");
432 static char *secam = "-";
433 MODULE_PARM(secam,"s");
434
435 static int tda9887_fixup_std(struct tda9887 *t)
436 {
437         /* get more precise norm info from insmod option */
438         if ((t->std & V4L2_STD_PAL) == V4L2_STD_PAL) {
439                 switch (pal[0]) {
440                 case 'b':
441                 case 'B':
442                 case 'g':
443                 case 'G':
444                         dprintk(PREFIX "insmod fixup: PAL => PAL-BG\n");
445                         t->std = V4L2_STD_PAL_BG;
446                         break;
447                 case 'i':
448                 case 'I':
449                         dprintk(PREFIX "insmod fixup: PAL => PAL-I\n");
450                         t->std = V4L2_STD_PAL_I;
451                         break;
452                 case 'd':
453                 case 'D':
454                 case 'k':
455                 case 'K':
456                         dprintk(PREFIX "insmod fixup: PAL => PAL-DK\n");
457                         t->std = V4L2_STD_PAL_DK;
458                         break;
459                 }
460         }
461         if ((t->std & V4L2_STD_SECAM) == V4L2_STD_SECAM) {
462                 switch (secam[0]) {
463                 case 'd':
464                 case 'D':
465                 case 'k':
466                 case 'K':
467                         dprintk(PREFIX "insmod fixup: SECAM => SECAM-DK\n");
468                         t->std = V4L2_STD_SECAM_DK;
469                         break;
470                 case 'l':
471                 case 'L':
472                         dprintk(PREFIX "insmod fixup: SECAM => SECAM-L\n");
473                         t->std = V4L2_STD_SECAM_L;
474                         break;
475                 }
476         }
477         return 0;
478 }
479
480 static int tda9887_status(struct tda9887 *t)
481 {
482         unsigned char buf[1];
483         int rc;
484
485         memset(buf,0,sizeof(buf));
486         if (1 != (rc = i2c_master_recv(&t->client,buf,1)))
487                 printk(PREFIX "i2c i/o error: rc == %d (should be 1)\n",rc);
488         dump_read_message(buf);
489         return 0;
490 }
491
492 static int tda9887_configure(struct tda9887 *t)
493 {
494         unsigned char buf[4];
495         int rc;
496
497         memset(buf,0,sizeof(buf));
498         tda9887_set_tvnorm(t,buf);
499         if (UNSET != t->pinnacle_id) {
500                 tda9887_set_pinnacle(t,buf);
501         }
502         tda9887_set_insmod(t,buf);
503
504         dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n",
505                 buf[1],buf[2],buf[3]);
506         if (debug > 1)
507                 dump_write_message(buf);
508
509         if (4 != (rc = i2c_master_send(&t->client,buf,4)))
510                 printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc);
511
512         if (debug > 2) {
513                 set_current_state(TASK_INTERRUPTIBLE);
514                 schedule_timeout(HZ);
515                 tda9887_status(t);
516         }
517         return 0;
518 }
519
520 /* ---------------------------------------------------------------------- */
521
522 static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
523 {
524         struct tda9887 *t;
525
526         client_template.adapter = adap;
527         client_template.addr    = addr;
528
529         printk(PREFIX "chip found @ 0x%x\n", addr<<1);
530
531         if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
532                 return -ENOMEM;
533         memset(t,0,sizeof(*t));
534         t->client      = client_template;
535         t->std         = 0;;
536         t->pinnacle_id = UNSET;
537         i2c_set_clientdata(&t->client, t);
538         i2c_attach_client(&t->client);
539         
540         return 0;
541 }
542
543 static int tda9887_probe(struct i2c_adapter *adap)
544 {
545 #ifdef I2C_CLASS_TV_ANALOG
546         if (adap->class & I2C_CLASS_TV_ANALOG)
547                 return i2c_probe(adap, &addr_data, tda9887_attach);
548 #else
549         switch (adap->id) {
550         case I2C_ALGO_BIT | I2C_HW_B_BT848:
551         case I2C_ALGO_BIT | I2C_HW_B_RIVA:
552         case I2C_ALGO_SAA7134:
553                 return i2c_probe(adap, &addr_data, tda9887_attach);
554                 break;
555         }
556 #endif
557         return 0;
558 }
559
560 static int tda9887_detach(struct i2c_client *client)
561 {
562         struct tda9887 *t = i2c_get_clientdata(client);
563
564         i2c_detach_client(client);
565         kfree(t);
566         return 0;
567 }
568
569 #define SWITCH_V4L2     if (!t->using_v4l2 && debug) \
570                           printk(PREFIX "switching to v4l2\n"); \
571                           t->using_v4l2 = 1;
572 #define CHECK_V4L2      if (t->using_v4l2) { if (debug) \
573                           printk(PREFIX "ignore v4l1 call\n"); \
574                           return 0; }
575
576 static int
577 tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
578 {
579         struct tda9887 *t = i2c_get_clientdata(client);
580
581         switch (cmd) {
582
583         /* --- configuration --- */
584         case AUDC_SET_RADIO:
585                 t->radio = 1;
586                 tda9887_configure(t);
587                 break;
588                 
589         case AUDC_CONFIG_PINNACLE:
590         {
591                 int *i = arg;
592
593                 t->pinnacle_id = *i;
594                 tda9887_configure(t);
595                 break;
596         }
597         /* --- v4l ioctls --- */
598         /* take care: bttv does userspace copying, we'll get a
599            kernel pointer here... */
600         case VIDIOCSCHAN:
601         {
602                 static const v4l2_std_id map[] = {
603                         [ VIDEO_MODE_PAL   ] = V4L2_STD_PAL,
604                         [ VIDEO_MODE_NTSC  ] = V4L2_STD_NTSC_M,
605                         [ VIDEO_MODE_SECAM ] = V4L2_STD_SECAM,
606                         [ 4 /* bttv */     ] = V4L2_STD_PAL_M,
607                         [ 5 /* bttv */     ] = V4L2_STD_PAL_N,
608                         [ 6 /* bttv */     ] = V4L2_STD_NTSC_M_JP,
609                 };
610                 struct video_channel *vc = arg;
611
612                 CHECK_V4L2;
613                 t->radio = 0;
614                 if (vc->norm < ARRAY_SIZE(map))
615                         t->std = map[vc->norm];
616                 tda9887_fixup_std(t);
617                 tda9887_configure(t);
618                 break;
619         }
620         case VIDIOC_S_STD:
621         {
622                 v4l2_std_id *id = arg;
623
624                 SWITCH_V4L2;
625                 t->radio = 0;
626                 t->std   = *id;
627                 tda9887_fixup_std(t);
628                 tda9887_configure(t);
629                 break;
630         }
631         case VIDIOC_S_FREQUENCY:
632         {
633                 struct v4l2_frequency *f = arg;
634
635                 SWITCH_V4L2;
636                 if (V4L2_TUNER_ANALOG_TV == f->type) {
637                         if (t->radio == 0)
638                                 return 0;
639                         t->radio = 0;
640                 }
641                 if (V4L2_TUNER_RADIO == f->type) {
642                         if (t->radio == 1)
643                                 return 0;
644                         t->radio = 1;
645                 }
646                 tda9887_configure(t);
647         }
648         default:
649                 /* nothing */
650                 break;
651         }
652         return 0;
653 }
654
655 /* ----------------------------------------------------------------------- */
656
657 static struct i2c_driver driver = {
658         .owner          = THIS_MODULE,
659         .name           = "i2c tda9887 driver",
660         .id             = -1, /* FIXME */
661         .flags          = I2C_DF_NOTIFY,
662         .attach_adapter = tda9887_probe,
663         .detach_client  = tda9887_detach,
664         .command        = tda9887_command,
665 };
666 static struct i2c_client client_template =
667 {
668         I2C_DEVNAME("tda9887"),
669         .flags     = I2C_CLIENT_ALLOW_USE,
670         .driver    = &driver,
671 };
672
673 static int tda9887_init_module(void)
674 {
675         i2c_add_driver(&driver);
676         return 0;
677 }
678
679 static void tda9887_cleanup_module(void)
680 {
681         i2c_del_driver(&driver);
682 }
683
684 module_init(tda9887_init_module);
685 module_exit(tda9887_cleanup_module);
686
687 /*
688  * Overrides for Emacs so that we follow Linus's tabbing style.
689  * ---------------------------------------------------------------------------
690  * Local variables:
691  * c-basic-offset: 8
692  * End:
693  */