]> git.karo-electronics.de Git - mv-sheeva.git/blob - drivers/media/video/cx231xx/cx231xx-pcb-cfg.c
V4L/DVB (10958): cx231xx: some additional CodingStyle and minor fixes
[mv-sheeva.git] / drivers / media / video / cx231xx / cx231xx-pcb-cfg.c
1 /*
2    cx231xx-pcb-config.c - driver for Conexant
3                 Cx23100/101/102 USB video capture devices
4
5    Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #include "cx231xx.h"
23 #include "cx231xx-conf-reg.h"
24
25 /******************************************************************************/
26
27 struct pcb_config cx231xx_Scenario[] = {
28         {
29          INDEX_SELFPOWER_DIGITAL_ONLY,  /* index */
30          USB_SELF_POWER,        /* power_type */
31          0,                     /* speed , not decide yet */
32          MOD_DIGITAL,           /* mode */
33          SOURCE_TS_BDA,         /* ts1_source, digital tv only */
34          NOT_SUPPORTED,         /* ts2_source  */
35          NOT_SUPPORTED,         /* analog source */
36
37          0,                     /* digital_index  */
38          0,                     /* analog index */
39          0,                     /* dif_index   */
40          0,                     /* external_index */
41
42          1,                     /* only one configuration */
43          {
44           {
45            0,                   /* config index */
46            {
47             0,                  /* interrupt ep index */
48             1,                  /* ts1 index */
49             NOT_SUPPORTED,      /* TS2 index */
50             NOT_SUPPORTED,      /* AUDIO */
51             NOT_SUPPORTED,      /* VIDEO */
52             NOT_SUPPORTED,      /* VANC */
53             NOT_SUPPORTED,      /* HANC */
54             NOT_SUPPORTED       /* ir_index */
55             }
56            ,
57            }
58           ,
59           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
60                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
61                            NOT_SUPPORTED}
62            }
63           ,
64           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
65                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
66                            NOT_SUPPORTED}
67            }
68           }
69          ,
70          /* full-speed config */
71          {
72           {
73            0,                   /* config index */
74            {
75             0,                  /* interrupt ep index */
76             1,                  /* ts1 index */
77             NOT_SUPPORTED,      /* TS2 index */
78             NOT_SUPPORTED,      /* AUDIO */
79             NOT_SUPPORTED,      /* VIDEO */
80             NOT_SUPPORTED,      /* VANC */
81             NOT_SUPPORTED,      /* HANC */
82             NOT_SUPPORTED       /* ir_index */
83             }
84            }
85           ,
86           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
87                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
88                            NOT_SUPPORTED}
89            }
90           ,
91           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
92                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
93                            NOT_SUPPORTED}
94            }
95           }
96          }
97         ,
98
99         {
100          INDEX_SELFPOWER_DUAL_DIGITAL,  /* index */
101          USB_SELF_POWER,        /* power_type */
102          0,                     /* speed , not decide yet */
103          MOD_DIGITAL,           /* mode */
104          SOURCE_TS_BDA,         /* ts1_source, digital tv only */
105          0,                     /* ts2_source,need update from register */
106          NOT_SUPPORTED,         /* analog source */
107          0,                     /* digital_index  */
108          0,                     /* analog index */
109          0,                     /* dif_index */
110          0,                     /* external_index */
111
112          1,                     /* only one configuration */
113          {
114           {
115            0,                   /* config index */
116            {
117             0,                  /* interrupt ep index */
118             1,                  /* ts1 index */
119             2,                  /* TS2 index */
120             NOT_SUPPORTED,      /* AUDIO */
121             NOT_SUPPORTED,      /* VIDEO */
122             NOT_SUPPORTED,      /* VANC */
123             NOT_SUPPORTED,      /* HANC */
124             NOT_SUPPORTED       /* ir_index */
125             }
126            }
127           ,
128           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
129                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
130                            NOT_SUPPORTED}
131            }
132           ,
133           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
134                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
135                            NOT_SUPPORTED}
136            }
137           }
138          ,
139          /* full-speed */
140          {
141           {
142            0,                   /* config index */
143            {
144             0,                  /* interrupt ep index */
145             1,                  /* ts1 index */
146             2,                  /* TS2 index */
147             NOT_SUPPORTED,      /* AUDIO */
148             NOT_SUPPORTED,      /* VIDEO */
149             NOT_SUPPORTED,      /* VANC */
150             NOT_SUPPORTED,      /* HANC */
151             NOT_SUPPORTED       /* ir_index */
152             }
153            }
154           ,
155           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
156                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
157                            NOT_SUPPORTED}
158            }
159           ,
160           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
161                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
162                            NOT_SUPPORTED}
163            }
164           }
165          }
166         ,
167
168         {
169          INDEX_SELFPOWER_ANALOG_ONLY,   /* index */
170          USB_SELF_POWER,        /* power_type */
171          0,                     /* speed , not decide yet */
172          MOD_ANALOG | MOD_DIF | MOD_EXTERNAL,   /* mode ,analog tv only */
173          NOT_SUPPORTED,         /* ts1_source, NOT SUPPORT */
174          NOT_SUPPORTED,         /* ts2_source,NOT SUPPORT */
175          0,                     /* analog source, need update */
176
177          0,                     /* digital_index  */
178          0,                     /* analog index */
179          0,                     /* dif_index */
180          0,                     /* external_index */
181
182          1,                     /* only one configuration */
183          {
184           {
185            0,                   /* config index */
186            {
187             0,                  /* interrupt ep index */
188             NOT_SUPPORTED,      /* ts1 index */
189             NOT_SUPPORTED,      /* TS2 index */
190             1,                  /* AUDIO */
191             2,                  /* VIDEO */
192             3,                  /* VANC */
193             4,                  /* HANC */
194             NOT_SUPPORTED       /* ir_index */
195             }
196            }
197           ,
198           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
199                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
200                            NOT_SUPPORTED}
201            }
202           ,
203           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
204                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
205                            NOT_SUPPORTED}
206            }
207           }
208          ,
209          /* full-speed */
210          {
211           {
212            0,                   /* config index */
213            {
214             0,                  /* interrupt ep index */
215             NOT_SUPPORTED,      /* ts1 index */
216             NOT_SUPPORTED,      /* TS2 index */
217             1,                  /* AUDIO */
218             2,                  /* VIDEO */
219             NOT_SUPPORTED,      /* VANC */
220             NOT_SUPPORTED,      /* HANC */
221             NOT_SUPPORTED       /* ir_index */
222             }
223            }
224           ,
225           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
226                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
227                            NOT_SUPPORTED}
228            }
229           ,
230           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
231                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
232                            NOT_SUPPORTED}
233            }
234           }
235          }
236         ,
237
238         {
239          INDEX_SELFPOWER_DUAL,  /* index */
240          USB_SELF_POWER,        /* power_type */
241          0,                     /* speed , not decide yet */
242          /* mode ,analog tv and digital path */
243          MOD_ANALOG | MOD_DIF | MOD_DIGITAL | MOD_EXTERNAL,
244          0,                     /* ts1_source,will update in register */
245          NOT_SUPPORTED,         /* ts2_source,NOT SUPPORT */
246          0,                     /* analog source need update */
247          0,                     /* digital_index  */
248          0,                     /* analog index */
249          0,                     /* dif_index */
250          0,                     /* external_index */
251          1,                     /* only one configuration */
252          {
253           {
254            0,                   /* config index */
255            {
256             0,                  /* interrupt ep index */
257             1,                  /* ts1 index */
258             NOT_SUPPORTED,      /* TS2 index */
259             2,                  /* AUDIO */
260             3,                  /* VIDEO */
261             4,                  /* VANC */
262             5,                  /* HANC */
263             NOT_SUPPORTED       /* ir_index */
264             }
265            }
266           ,
267           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
268                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
269                            NOT_SUPPORTED}
270            }
271           ,
272           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
273                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
274                            NOT_SUPPORTED}
275            }
276           }
277          ,
278          /* full-speed */
279          {
280           {
281            0,                   /* config index */
282            {
283             0,                  /* interrupt ep index */
284             1,                  /* ts1 index */
285             NOT_SUPPORTED,      /* TS2 index */
286             2,                  /* AUDIO */
287             3,                  /* VIDEO */
288             NOT_SUPPORTED,      /* VANC */
289             NOT_SUPPORTED,      /* HANC */
290             NOT_SUPPORTED       /* ir_index */
291             }
292            }
293           ,
294           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
295                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
296                            NOT_SUPPORTED}
297            }
298           ,
299           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
300                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
301                            NOT_SUPPORTED}
302            }
303           }
304          }
305         ,
306
307         {
308          INDEX_SELFPOWER_TRIPLE,        /* index */
309          USB_SELF_POWER,        /* power_type */
310          0,                     /* speed , not decide yet */
311          /* mode ,analog tv and digital path */
312          MOD_ANALOG | MOD_DIF | MOD_DIGITAL | MOD_EXTERNAL,
313          0,                     /* ts1_source, update in register */
314          0,                     /* ts2_source,update in register */
315          0,                     /* analog source, need update */
316
317          0,                     /* digital_index  */
318          0,                     /* analog index */
319          0,                     /* dif_index */
320          0,                     /* external_index */
321          1,                     /* only one configuration */
322          {
323           {
324            0,                   /* config index */
325            {
326             0,                  /* interrupt ep index */
327             1,                  /* ts1 index */
328             2,                  /* TS2 index */
329             3,                  /* AUDIO */
330             4,                  /* VIDEO */
331             5,                  /* VANC */
332             6,                  /* HANC */
333             NOT_SUPPORTED       /* ir_index */
334             }
335            }
336           ,
337           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
338                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
339                            NOT_SUPPORTED}
340            }
341           ,
342           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
343                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
344                            NOT_SUPPORTED}
345            }
346           }
347          ,
348          /* full-speed */
349          {
350           {
351            0,                   /* config index */
352            {
353             0,                  /* interrupt ep index */
354             1,                  /* ts1 index */
355             2,                  /* TS2 index */
356             3,                  /* AUDIO */
357             4,                  /* VIDEO */
358             NOT_SUPPORTED,      /* VANC */
359             NOT_SUPPORTED,      /* HANC */
360             NOT_SUPPORTED       /* ir_index */
361             }
362            }
363           ,
364           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
365                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
366                            NOT_SUPPORTED}
367            }
368           ,
369           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
370                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
371                            NOT_SUPPORTED}
372            }
373           }
374          }
375         ,
376
377         {
378          INDEX_SELFPOWER_COMPRESSOR,    /* index */
379          USB_SELF_POWER,        /* power_type */
380          0,                     /* speed , not decide yet */
381          /* mode ,analog tv AND DIGITAL path */
382          MOD_ANALOG | MOD_DIF | MOD_DIGITAL | MOD_EXTERNAL,
383          NOT_SUPPORTED,         /* ts1_source, disable */
384          SOURCE_TS_BDA,         /* ts2_source */
385          0,                     /* analog source,need update */
386          0,                     /* digital_index  */
387          0,                     /* analog index */
388          0,                     /* dif_index */
389          0,                     /* external_index */
390          1,                     /* only one configuration */
391          {
392           {
393            0,                   /* config index */
394            {
395             0,                  /* interrupt ep index */
396             NOT_SUPPORTED,      /* ts1 index */
397             1,                  /* TS2 index */
398             2,                  /* AUDIO */
399             3,                  /* VIDEO */
400             4,                  /* VANC */
401             5,                  /* HANC */
402             NOT_SUPPORTED       /* ir_index */
403             }
404            }
405           ,
406           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
407                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
408                            NOT_SUPPORTED}
409            }
410           ,
411           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
412                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
413                            NOT_SUPPORTED}
414            }
415           }
416          ,
417          /* full-speed  */
418          {
419           {
420            0,                   /* config index */
421            {
422             0,                  /* interrupt ep index */
423             NOT_SUPPORTED,      /* ts1 index */
424             1,                  /* TS2 index */
425             2,                  /* AUDIO */
426             3,                  /* VIDEO */
427             NOT_SUPPORTED,      /* VANC */
428             NOT_SUPPORTED,      /* HANC */
429             NOT_SUPPORTED       /* ir_index */
430             }
431            }
432           ,
433           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
434                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
435                            NOT_SUPPORTED}
436            }
437           ,
438           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
439                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
440                            NOT_SUPPORTED}
441            }
442           }
443          }
444         ,
445
446         {
447          INDEX_BUSPOWER_DIGITAL_ONLY,   /* index */
448          USB_BUS_POWER,         /* power_type */
449          0,                     /* speed , not decide yet */
450          MOD_DIGITAL,           /* mode ,analog tv AND DIGITAL path */
451          SOURCE_TS_BDA,         /* ts1_source, disable */
452          NOT_SUPPORTED,         /* ts2_source */
453          NOT_SUPPORTED,         /* analog source */
454
455          0,                     /* digital_index  */
456          0,                     /* analog index */
457          0,                     /* dif_index */
458          0,                     /* external_index */
459
460          1,                     /* only one configuration */
461          {
462           {
463            0,                   /* config index */
464            {
465             0,                  /* interrupt ep index  = 2 */
466             1,                  /* ts1 index */
467             NOT_SUPPORTED,      /* TS2 index */
468             NOT_SUPPORTED,      /* AUDIO */
469             NOT_SUPPORTED,      /* VIDEO */
470             NOT_SUPPORTED,      /* VANC */
471             NOT_SUPPORTED,      /* HANC */
472             NOT_SUPPORTED       /* ir_index */
473             }
474            }
475           ,
476           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
477                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
478                            NOT_SUPPORTED}
479            }
480           ,
481           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
482                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
483                            NOT_SUPPORTED}
484            }
485           }
486          ,
487          /* full-speed */
488          {
489           {
490            0,                   /* config index */
491            {
492             0,                  /* interrupt ep index  = 2 */
493             1,                  /* ts1 index */
494             NOT_SUPPORTED,      /* TS2 index */
495             NOT_SUPPORTED,      /* AUDIO */
496             NOT_SUPPORTED,      /* VIDEO */
497             NOT_SUPPORTED,      /* VANC */
498             NOT_SUPPORTED,      /* HANC */
499             NOT_SUPPORTED       /* ir_index */
500             }
501            }
502           ,
503           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
504                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
505                            NOT_SUPPORTED}
506            }
507           ,
508           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
509                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
510                            NOT_SUPPORTED}
511            }
512           }
513          }
514         ,
515         {
516          INDEX_BUSPOWER_ANALOG_ONLY,    /* index */
517          USB_BUS_POWER,         /* power_type */
518          0,                     /* speed , not decide yet */
519          MOD_ANALOG,            /* mode ,analog tv AND DIGITAL path */
520          NOT_SUPPORTED,         /* ts1_source, disable */
521          NOT_SUPPORTED,         /* ts2_source */
522          SOURCE_ANALOG,         /* analog source--analog */
523          0,                     /* digital_index  */
524          0,                     /* analog index */
525          0,                     /* dif_index */
526          0,                     /* external_index */
527          1,                     /* only one configuration */
528          {
529           {
530            0,                   /* config index */
531            {
532             0,                  /* interrupt ep index */
533             NOT_SUPPORTED,      /* ts1 index */
534             NOT_SUPPORTED,      /* TS2 index */
535             1,                  /* AUDIO */
536             2,                  /* VIDEO */
537             3,                  /* VANC */
538             4,                  /* HANC */
539             NOT_SUPPORTED       /* ir_index */
540             }
541            }
542           ,
543           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
544                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
545                            NOT_SUPPORTED}
546            }
547           ,
548           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
549                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
550                            NOT_SUPPORTED}
551            }
552           }
553          ,
554          {                      /* full-speed */
555           {
556            0,                   /* config index */
557            {
558             0,                  /* interrupt ep index */
559             NOT_SUPPORTED,      /* ts1 index */
560             NOT_SUPPORTED,      /* TS2 index */
561             1,                  /* AUDIO */
562             2,                  /* VIDEO */
563             NOT_SUPPORTED,      /* VANC */
564             NOT_SUPPORTED,      /* HANC */
565             NOT_SUPPORTED       /* ir_index */
566             }
567            }
568           ,
569           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
570                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
571                            NOT_SUPPORTED}
572            }
573           ,
574           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
575                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
576                            NOT_SUPPORTED}
577            }
578           }
579          }
580         ,
581         {
582          INDEX_BUSPOWER_DIF_ONLY,       /* index */
583          USB_BUS_POWER,         /* power_type */
584          0,                     /* speed , not decide yet */
585          /* mode ,analog tv AND DIGITAL path */
586          MOD_DIF | MOD_ANALOG | MOD_DIGITAL | MOD_EXTERNAL,
587          SOURCE_TS_BDA,         /* ts1_source, disable */
588          NOT_SUPPORTED,         /* ts2_source */
589          SOURCE_DIF | SOURCE_ANALOG | SOURCE_EXTERNAL,  /* analog source, dif */
590          0,                     /* digital_index  */
591          0,                     /* analog index */
592          0,                     /* dif_index */
593          0,                     /* external_index */
594          1,                     /* only one configuration */
595          {
596           {
597            0,                   /* config index */
598            {
599             0,                  /* interrupt ep index */
600             1,                  /* ts1 index */
601             NOT_SUPPORTED,      /* TS2 index */
602             2,                  /* AUDIO */
603             3,                  /* VIDEO */
604             4,                  /* VANC */
605             5,                  /* HANC */
606             NOT_SUPPORTED       /* ir_index */
607             }
608            }
609           ,
610           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
611                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
612                            NOT_SUPPORTED}
613            }
614           ,
615           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
616                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
617                            NOT_SUPPORTED}
618            }
619           }
620          ,
621          {                      /* full speed */
622           {
623            0,                   /* config index */
624            {
625             0,                  /* interrupt ep index */
626             1,                  /* ts1 index */
627             NOT_SUPPORTED,      /* TS2 index */
628             2,                  /* AUDIO */
629             3,                  /* VIDEO */
630             NOT_SUPPORTED,      /* VANC */
631             NOT_SUPPORTED,      /* HANC */
632             NOT_SUPPORTED       /* ir_index */
633             }
634            }
635           ,
636           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
637                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
638                            NOT_SUPPORTED}
639            }
640           ,
641           {NOT_SUPPORTED, {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
642                            NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED,
643                            NOT_SUPPORTED}
644            }
645           }
646          }
647         ,
648
649 };
650
651 /*****************************************************************/
652
653 u32 initialize_cx231xx(struct cx231xx *dev)
654 {
655         u32 config_info = 0;
656         struct pcb_config *p_pcb_info;
657         u8 usb_speed = 1;       /* from register,1--HS, 0--FS  */
658         u8 data[4] = { 0, 0, 0, 0 };
659         u32 ts1_source = 0;
660         u32 ts2_source = 0;
661         u32 analog_source = 0;
662         u8 tmp = 0;
663         u8 _current_scenario_idx = 0xff;
664
665         cx231xx_info("PcbConfig::initialize \n");
666
667         ts1_source = SOURCE_TS_BDA;
668         ts2_source = SOURCE_TS_BDA;
669
670         /* read board config register to find out which
671         pcb config it is related to */
672         cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, data, 4);
673
674         config_info = *((u32 *) data);
675         cx231xx_info("SC(0x00) register = 0x%x\n", config_info);
676         usb_speed = (u8) (config_info & 0x1);
677
678         /* Verify this device belongs to Bus power or Self power device */
679         if (config_info & BUS_POWER) {  /* bus-power */
680                 switch (config_info & BUSPOWER_MASK) {
681                 case TS1_PORT | BUS_POWER:
682                         cx231xx_Scenario[INDEX_BUSPOWER_DIGITAL_ONLY].speed =
683                             usb_speed;
684                         p_pcb_info =
685                             &cx231xx_Scenario[INDEX_BUSPOWER_DIGITAL_ONLY];
686                         _current_scenario_idx = INDEX_BUSPOWER_DIGITAL_ONLY;
687                         break;
688                 case AVDEC_ENABLE | BUS_POWER:
689                         cx231xx_Scenario[INDEX_BUSPOWER_ANALOG_ONLY].speed =
690                             usb_speed;
691                         p_pcb_info =
692                             &cx231xx_Scenario[INDEX_BUSPOWER_ANALOG_ONLY];
693                         _current_scenario_idx = INDEX_BUSPOWER_ANALOG_ONLY;
694                         break;
695                 case AVDEC_ENABLE | BUS_POWER | TS1_PORT:
696                         cx231xx_Scenario[INDEX_BUSPOWER_DIF_ONLY].speed =
697                             usb_speed;
698                         p_pcb_info = &cx231xx_Scenario[INDEX_BUSPOWER_DIF_ONLY];
699                         _current_scenario_idx = INDEX_BUSPOWER_DIF_ONLY;
700                         break;
701                 default:
702                         cx231xx_info("bad config in buspower!!!!\n");
703                         cx231xx_info("config_info=%x\n",
704                                      (config_info & BUSPOWER_MASK));
705                         return 1;
706                 }
707         } else {                /* self-power */
708
709                 switch (config_info & SELFPOWER_MASK) {
710                 case TS1_PORT | SELF_POWER:
711                         cx231xx_Scenario[INDEX_SELFPOWER_DIGITAL_ONLY].speed =
712                             usb_speed;
713                         p_pcb_info =
714                             &cx231xx_Scenario[INDEX_SELFPOWER_DIGITAL_ONLY];
715                         _current_scenario_idx = INDEX_SELFPOWER_DIGITAL_ONLY;
716                         break;
717                 case TS1_TS2_PORT | SELF_POWER:
718                         cx231xx_Scenario[INDEX_SELFPOWER_DUAL_DIGITAL].speed =
719                             usb_speed;
720                         cx231xx_Scenario[INDEX_SELFPOWER_DUAL_DIGITAL].
721                             ts2_source = ts2_source;
722                         p_pcb_info =
723                             &cx231xx_Scenario[INDEX_SELFPOWER_DUAL_DIGITAL];
724                         _current_scenario_idx = INDEX_SELFPOWER_DUAL_DIGITAL;
725                         break;
726                 case AVDEC_ENABLE | SELF_POWER:
727                         cx231xx_Scenario[INDEX_SELFPOWER_ANALOG_ONLY].speed =
728                             usb_speed;
729                         cx231xx_Scenario[INDEX_SELFPOWER_ANALOG_ONLY].
730                             analog_source = analog_source;
731                         p_pcb_info =
732                             &cx231xx_Scenario[INDEX_SELFPOWER_ANALOG_ONLY];
733                         _current_scenario_idx = INDEX_SELFPOWER_ANALOG_ONLY;
734                         break;
735                 case AVDEC_ENABLE | TS1_PORT | SELF_POWER:
736                         cx231xx_Scenario[INDEX_SELFPOWER_DUAL].speed =
737                             usb_speed;
738                         cx231xx_Scenario[INDEX_SELFPOWER_DUAL].ts1_source =
739                             ts1_source;
740                         cx231xx_Scenario[INDEX_SELFPOWER_DUAL].analog_source =
741                             analog_source;
742                         p_pcb_info = &cx231xx_Scenario[INDEX_SELFPOWER_DUAL];
743                         _current_scenario_idx = INDEX_SELFPOWER_DUAL;
744                         break;
745                 case AVDEC_ENABLE | TS1_TS2_PORT | SELF_POWER:
746                         cx231xx_Scenario[INDEX_SELFPOWER_TRIPLE].speed =
747                             usb_speed;
748                         cx231xx_Scenario[INDEX_SELFPOWER_TRIPLE].ts1_source =
749                             ts1_source;
750                         cx231xx_Scenario[INDEX_SELFPOWER_TRIPLE].ts2_source =
751                             ts2_source;
752                         cx231xx_Scenario[INDEX_SELFPOWER_TRIPLE].analog_source =
753                             analog_source;
754                         p_pcb_info = &cx231xx_Scenario[INDEX_SELFPOWER_TRIPLE];
755                         _current_scenario_idx = INDEX_SELFPOWER_TRIPLE;
756                         break;
757                 case AVDEC_ENABLE | TS1VIP_TS2_PORT | SELF_POWER:
758                         cx231xx_Scenario[INDEX_SELFPOWER_COMPRESSOR].speed =
759                             usb_speed;
760                         cx231xx_Scenario[INDEX_SELFPOWER_COMPRESSOR].
761                             analog_source = analog_source;
762                         p_pcb_info =
763                             &cx231xx_Scenario[INDEX_SELFPOWER_COMPRESSOR];
764                         _current_scenario_idx = INDEX_SELFPOWER_COMPRESSOR;
765                         break;
766                 default:
767                         cx231xx_info("bad senario!!!!!\n");
768                         cx231xx_info("config_info=%x\n",
769                                      (config_info & SELFPOWER_MASK));
770                         return 1;
771                 }
772         }
773
774         dev->current_scenario_idx = _current_scenario_idx;
775
776         memcpy(&dev->current_pcb_config, p_pcb_info,
777                    sizeof(struct pcb_config));
778
779     /*******************************************************************/
780         tmp = (dev->current_pcb_config.index) + 1;
781
782         cx231xx_info("scenario %d\n", tmp);
783         cx231xx_info("type=%x\n", dev->current_pcb_config.type);
784         cx231xx_info("mode=%x\n", dev->current_pcb_config.mode);
785         cx231xx_info("speed=%x\n", dev->current_pcb_config.speed);
786         cx231xx_info("ts1_source=%x\n", dev->current_pcb_config.ts1_source);
787         cx231xx_info("ts2_source=%x\n", dev->current_pcb_config.ts2_source);
788         cx231xx_info("analog_source=%x\n",
789                      dev->current_pcb_config.analog_source);
790     /*******************************************************************/
791
792         return 0;
793 }