source: svn/newcon3bcm2_21bu/BSEAV/api/src/nexus/bsettop_config.c

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 23.8 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2010, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bsettop_config.c $
11 * $brcm_Revision: 49 $
12 * $brcm_Date: 4/23/10 6:20p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /BSEAV/api/src/nexus/bsettop_config.c $
19 *
20 * 49   4/23/10 6:20p mward
21 * SW7125-375: Set correct (zero) number of streamers for 97019.
22 *
23 * 48   4/23/10 2:35p erickson
24 * SW3548-2904: add B3 support
25 *
26 * 47   4/22/10 11:37a nitinb
27 * SW7550-339: Enable "channel edit" functionality in Brutus for OFDM
28 * input
29 *
30 * 46   4/12/10 7:34p nitinb
31 * SW7550-339: Enable "channel edit" functionality in Brutus for OFDM
32 * input
33 *
34 * 44   3/11/10 3:12p mward
35 * SW7405-3965: deprecrate NEXUS_VideoDecoderModuleSettings.numDecodes,
36 * etc.
37 *
38 * 43   1/18/10 4:27p randyjew
39 * SW7468-6:Limit 97468 boards to 480p
40 *
41 * 42   12/9/09 5:19p randyjew
42 * SW7468-6: Add 7468/7208 support
43 *
44 * 41   12/9/09 12:03p gmohile
45 * SW7408-1 : Add 7408 support
46 *
47 * 40   10/15/09 4:34p erickson
48 * SWDEPRECATED-3881: use NEXUS_PlatformConfiguration members to learn #
49 * of displays and windows available based on memory strapping options
50 *
51 * 39   9/11/09 11:32a jrubio
52 * SW7342-11: add 8 input bands
53 *
54 * 38   9/3/09 3:35p mward
55 * SW7125-4:  Use additional "streamers" to select input bands for QAM DS
56 * set up with BBS script.
57 *
58 * 37   9/1/09 10:51a mward
59 * SW7125-4: Disable SW streamer select for now, use DIP switch.
60 *
61 * 36   8/26/09 11:57a mward
62 * SW7125-4: Configure number of streamers for 7125 boards.
63 *
64 * 35   8/19/09 10:58a jrubio
65 * PR55232: add 7342/7340 support
66 *
67 * 34   3/20/09 1:14p katrep
68 * PR52340: Support srs true volume and dolby volume through brutus ans
69 * settop api
70 *
71 *
72 * 33   3/18/09 12:31p erickson
73 * PR53340: add 1080p 50hz support
74 *
75 * 32   3/16/09 3:22p erickson
76 * PR53267: convert bconfig_system to programmatic init
77 *
78 * 31   3/5/09 3:19p katrep
79 * PR52599: More support for 7205
80 *
81 * 30   2/20/09 1:44p erickson
82 * PR52355: add ANR support
83 *
84 * 29   2/18/09 6:22p jrubio
85 * PR52261: 7335 has 2 possible inputs ASI and LVDS. LVDS not working on
86 * P3 > boards
87 *
88 * 28   2/11/09 3:32p vle
89 * PR 51414, PR 45656: Add 1080p/60Hz support in Brutus and enable for
90 * 7420
91 *
92 * 27   2/3/09 11:08a mward
93 * PR39972: Support E0 chip version.
94 *
95 * 26   1/16/09 4:40p katrep
96 * PR51215: VESA should be enabled only for HD modes
97 *
98 * 25   12/19/08 7:39p katrep
99 * PR50567: Add Support for 97466 platform
100 *
101 * 24   9/26/08 12:08p katrep
102 * PR46457: 1080p 60 Hz not supported
103 *
104 * 23   9/2/08 7:44p katrep
105 * PR46457: Configure settop at run time, based on resources exposed by
106 * nexus platfrom.
107 *
108 * 22   8/22/08 7:46p erickson
109 * PR45795: use NEXUS_DisplayModule_GetSettings to determine 1080p
110 * capabilities
111 *
112 * 21   8/14/08 11:46a jgarrett
113 * PR 39042: Adding PCM capture APIs
114 *
115 * 20   7/17/08 4:34p shyam
116 * PR43426 : Add 7043 656 Encode support
117 *
118 * 19   7/9/08 4:10p katrep
119 * PR43490: Add support 656/i2s tuning using analog tune api.
120 *
121 * 18   6/27/08 3:48p mphillip
122 * PR42901: Enable PVR encryption in bconfig
123 *
124 * 17   6/25/08 1:23p erickson
125 * PR36068: add 93549 and 93556
126 *
127 * 16   6/11/08 11:53a jgarrett
128 * PR 43489: Adding brutus support for 93549/93556
129 *
130 * 15   5/28/08 8:02p jrubio
131 * PR43087: add TUNER_ENABLE_7335 flags
132 *
133 * 14   5/2/08 1:54p jrubio
134 * PR42353: add 7335
135 *
136 * 13   3/25/08 7:43p vsilyaev
137 * PR 40862: Use nexus configuration to set supported formats
138 *
139 * 12   3/18/08 4:02p erickson
140 * PR40307: implemented still decode
141 *
142 * 11   3/17/08 5:39p katrep
143 * PR40021:Add support for OFDM tuner on 7405
144 *
145 * 10   3/12/08 3:17p jgarrett
146 * PR 40017: Fixing size of mosaic array
147 *
148 * 9   3/6/08 4:23p jrubio
149 * PR40169: add 7325
150 *
151 * 8   2/4/08 10:07a erickson
152 * PR36068: api update
153 *
154 * 7   2/4/08 10:00a erickson
155 * PR36068: update
156 *
157 * 6   11/27/07 11:16p erickson
158 * PR36068: add 3563 frontend
159 *
160 * 5   11/27/07 9:19a erickson
161 * PR37590: allow no B_MAX_STILL_DECODES
162 *
163 * 4   11/12/07 5:26p erickson
164 * PR36802: limit # of records
165 *
166 * 3   11/12/07 2:34p erickson
167 * PR36068: update
168 *
169 * 2   10/16/07 12:35p erickson
170 * PR36068: brutus up over settop api/nexus
171 *
172 * 1   10/15/07 2:35p erickson
173 * PR36068: initial
174 *
175 ***************************************************************************/
176#include "bsettop_impl.h"
177#include "nexus_transport_capabilities.h"
178
179BDBG_MODULE(config);
180
181static bconfig_family family_hydra = {
182    "hydra",
183    "A0",
184    'A',
185    '0'
186};
187
188static bconfig_chip mainchip = {
189    BCHP_CHIP,
190#if   BCHP_VER == BCHP_VER_A0
191    "A0",'A','0',
192#elif BCHP_VER == BCHP_VER_A1
193    "A0",'A','1',
194#elif BCHP_VER == BCHP_VER_A2
195    "A0",'A','2',
196#elif BCHP_VER == BCHP_VER_B0
197    "B0",'B','0',
198#elif BCHP_VER == BCHP_VER_B1
199    "B1",'B','1',
200#elif BCHP_VER == BCHP_VER_B2
201    "B2",'B','2',
202#elif BCHP_VER == BCHP_VER_B3
203    "B3",'B','3',
204#elif BCHP_VER == BCHP_VER_C0
205    "C0",'C','0',
206#elif BCHP_VER == BCHP_VER_C1
207    "C1",'C','1',
208#elif BCHP_VER == BCHP_VER_C2
209    "C2",'C','2',
210#elif BCHP_VER == BCHP_VER_C3
211    "C3",'C','3',
212#elif BCHP_VER == BCHP_VER_C4
213    "C4",'C','4',
214#elif BCHP_VER == BCHP_VER_C5
215    "C5",'C','5',
216#elif BCHP_VER == BCHP_VER_D0
217    "D0",'D','0',
218#elif BCHP_VER == BCHP_VER_D1
219    "D1",'D','1',
220#elif BCHP_VER == BCHP_VER_E0
221    "E0",'E','0',
222#else
223#error BCHP_VER support must be added
224#endif
225    {&family_hydra, NULL}
226};
227
228#if B_HAS_3250
229static bconfig_chip chip_3250 = {
230    3250,
231    "B2",
232    'B',
233    '2',
234    {NULL}
235};
236#endif
237
238static const bobject_t
239    b_obj_1[2] = {B_ID(0),NULL},
240    b_obj_2[2] = {B_ID(1),NULL}, /* only 1 bobject, but starting at 1 */
241    b_obj_1_2[3] = {B_ID(0), B_ID(1),NULL},
242    b_obj_1_2_3[4] = {B_ID(0), B_ID(1), B_ID(2),NULL},
243    b_obj_1_2_3_4[5] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), NULL},
244    b_obj_1_2_3_4_5[6] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), B_ID(4), NULL},
245    b_obj_1_2_3_4_5_6[7] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), B_ID(4), B_ID(5), NULL},
246    b_obj_1_2_3_4_5_6_7[8] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), B_ID(4), B_ID(5), B_ID(6), NULL},
247    b_obj_1_2_3_4_5_6_7_8[9] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), B_ID(4), B_ID(5), B_ID(6),B_ID(7), NULL},
248    b_obj_5_6_7_8[5] = {B_ID(5), B_ID(6), B_ID(7), B_ID(8),NULL},
249    b_obj_8[9] = {B_ID(0), B_ID(1), B_ID(2), B_ID(3), B_ID(4), B_ID(5), B_ID(6), B_ID(7),NULL};
250
251static bconfig_system bconfig_;
252
253const bconfig_system * const bconfig = &bconfig_;
254void bconfig_p_add_pvr(void);
255
256#ifndef B_MAX_STILL_DECODES
257#define B_MAX_STILL_DECODES 0
258#endif
259
260static const bconfig_obj_list b_pcm = {"pcm_playback", 2, b_obj_1_2};
261#if B_MAX_STILL_DECODES > 0
262static const bobject_t
263    b_decode_still_list[] = {
264        B_ID(B_MAX_DECODES)
265#if B_MAX_STILL_DECODES>1
266        ,B_ID(B_MAX_DECODES+1)
267#endif
268        ,NULL};
269static const bconfig_obj_list b_decode_still = {"decode_still", B_MAX_STILL_DECODES, b_decode_still_list};
270#endif
271
272#if B_MAX_AUDIO_ES_DECODES> 0
273static const bobject_t
274    b_decode_es_list[] = {
275        B_ID(B_MAX_DECODES+B_MAX_STILL_DECODES)
276#if B_MAX_AUDIO_ES_DECODES>1
277        ,B_ID(B_MAX_DECODES+B_MAX_DECODES+1)
278#endif
279        ,NULL};
280static const bconfig_obj_list b_decode_es = {"decode_es", B_MAX_AUDIO_ES_DECODES, b_decode_es_list};
281#endif
282
283static const bconfig_obj_list b_pcm_capture = {"pcm_capture", 2, b_obj_1_2};
284
285#if B_MAX_MOSAIC_DECODES
286static void bconfig_p_add_mosaics(void);
287#endif
288
289static void bconfig_p_get_objs(unsigned total, const bobject_t **objs)
290{
291    switch (total) {
292    case 0: *objs = NULL; break;
293    case 1: *objs = b_obj_1; break;
294    case 2: *objs = b_obj_1_2; break;
295    case 3: *objs = b_obj_1_2_3; break;
296    case 4: *objs = b_obj_1_2_3_4; break;
297    case 5: *objs = b_obj_1_2_3_4_5; break;
298    case 6: *objs = b_obj_1_2_3_4_5_6; break;
299    case 7: *objs = b_obj_1_2_3_4_5_6_7; break;
300    case 8: *objs = b_obj_1_2_3_4_5_6_7_8; break;
301    default:
302        BDBG_ERR(("Unable to get bconfig_obj_list for %d. Please extend Settop API.", total));
303        *objs = NULL;
304        break;
305    }
306}
307
308void
309bconfig_p_init(void)
310{
311    NEXUS_PlatformSettings platformSettings;
312    NEXUS_PlatformConfiguration platformConfig;
313    unsigned i;
314
315    NEXUS_Platform_GetSettings(&platformSettings);
316    NEXUS_Platform_GetConfiguration(&platformConfig);
317
318    BKNI_Memset(&bconfig_, 0, sizeof(bconfig_));
319    bconfig_.board = BCM_BOARD_STR;
320    bconfig_.chips[0] = &mainchip;
321#if B_HAS_3250
322    bconfig_.chips[1] = &chip_3250;
323#endif
324#if B_HAS_SDS || B_HAS_AST
325    bconfig_.features.sds = true;
326#endif
327#if B_HAS_VSB || B_HAS_3255 || B_HAS_QAM
328    bconfig_.features.qam = true;
329#endif
330#if B_HAS_VSB || B_HAS_3255
331    bconfig_.features.vsb = true;
332#endif
333#if B_HAS_OFDM
334    bconfig_.features.ofdm = true;
335#endif
336#if B_HAS_ANALOG || B_HAS_EXTERNAL_ANALOG
337    bconfig_.features.analog = true;
338#endif
339#if B_XVD_NO_HD_SUPPORT
340    bconfig_.features.video_hd = false;
341#else
342    bconfig_.features.video_hd = true;
343#endif
344#if B_DISPLAY_NO_HD_SUPPORT
345    bconfig_.features.display_hd = false;
346#else
347    bconfig_.features.display_hd = true;
348#endif
349#if B_HAS_DCR
350    bconfig_.features.dnr_dcr = true;
351#endif
352#if B_HAS_BNR
353    bconfig_.features.dnr_bnr = true;
354#endif
355#if B_HAS_MNR
356    bconfig_.features.dnr_mnr = true;
357#endif
358#if B_HAS_ANR
359    bconfig_.features.anr = true;
360#endif
361#if B_HAS_MAD
362    bconfig_.features.deinterlacer = true;
363#endif
364#if B_HAS_BOX_DETECT
365    bconfig_.features.box_detect = true;
366#endif
367
368    bconfig_.features.pvr_encryption = true;
369
370#if B_HAS_SHARPNESS
371    bconfig_.features.sharpness = true;
372#endif
373#if B_HAS_CAB
374    bconfig_.features.cab = true;
375#endif
376#if B_HAS_LAB
377    bconfig_.features.lab = true;
378#endif
379#if B_MAX_MOSAIC_DECODES > 0
380    bconfig_.features.mosaic = true;
381#endif
382
383    for (i=bvideo_format_ntsc;i<bvideo_format_secam;i++) {
384        bconfig_.features.video_format_is_supported[i] = true;
385    }
386#if B_HAS_SECAM
387    bconfig_.features.video_format_is_supported[bvideo_format_secam] = true;
388#endif
389
390    /* set display formats */
391    if (platformSettings.displayModuleSettings.fullHdBuffers.count || platformSettings.displayModuleSettings.hdBuffers.count)
392    {
393        bconfig_.features.video_format_is_supported[bvideo_format_480p] = true;
394        bconfig_.features.video_format_is_supported[bvideo_format_576p] = true;
395        bconfig_.features.video_format_is_supported[bvideo_format_1080i] = true;
396        bconfig_.features.video_format_is_supported[bvideo_format_1080i_50hz] = true;
397        bconfig_.features.video_format_is_supported[bvideo_format_720p] = true;
398        bconfig_.features.video_format_is_supported[bvideo_format_720p_50hz] = true;
399        bconfig_.features.video_format_is_supported[bvideo_format_vesa] = true;
400        BDBG_MSG(("HD formats supported"));
401    }
402    if (platformSettings.displayModuleSettings.hdBuffers.count)
403    {
404        bool value;
405
406        /* 1080p 50/60 */
407        value = (platformSettings.displayModuleSettings.hdBuffers.format == NEXUS_VideoFormat_e1080p);
408        bconfig_.features.video_format_is_supported[bvideo_format_1080p] = value;
409        bconfig_.features.video_format_is_supported[bvideo_format_1080p_50hz] = value;
410
411        /* 1080p 24/25/30 */
412        value =
413        platformSettings.displayModuleSettings.hdBuffers.format == NEXUS_VideoFormat_e1080p ||
414        platformSettings.displayModuleSettings.hdBuffers.format == NEXUS_VideoFormat_e1080p30hz;
415        bconfig_.features.video_format_is_supported[bvideo_format_1080p_24hz] = value;
416        bconfig_.features.video_format_is_supported[bvideo_format_1080p_25hz] = value;
417        bconfig_.features.video_format_is_supported[bvideo_format_1080p_30hz] = value;
418
419        bconfig_.features.video_format_is_supported[bvideo_format_vesa] = true;
420        BDBG_MSG(("1080p HD formats supported"));
421    }
422    if(platformSettings.displayModuleSettings.fullHdBuffers.count)
423    {
424        bool value;
425
426        value = (platformSettings.displayModuleSettings.fullHdBuffers.format == NEXUS_VideoFormat_e1080p);
427        bconfig_.features.video_format_is_supported[bvideo_format_1080p] = value;
428        bconfig_.features.video_format_is_supported[bvideo_format_1080p_50hz] = value;
429
430        bconfig_.features.video_format_is_supported[bvideo_format_1080p_24hz] = true;
431        bconfig_.features.video_format_is_supported[bvideo_format_1080p_25hz] = true;
432        bconfig_.features.video_format_is_supported[bvideo_format_1080p_30hz] = true;
433        bconfig_.features.video_format_is_supported[bvideo_format_vesa] = true;
434        BDBG_MSG(("1080p HD formats supported"));
435    }
436
437    /* need to limit HD diisplay to 480p on 97466 in 32 bit UMA mode
438       we may have HD buffers allocated to to 480p display */
439#if BCM_BOARD==97466 || BCM_BOARD==97468
440    if(platformSettings.displayModuleSettings.hdBuffers.count)
441    {
442        BDBG_MSG(("Limiting HD display to 480p on 97466 / 97468"));
443        bconfig_.features.video_format_is_supported[bvideo_format_480p] = true;
444        bconfig_.features.video_format_is_supported[bvideo_format_576p] = true;
445        bconfig_.features.video_format_is_supported[bvideo_format_1080i] = false;
446        bconfig_.features.video_format_is_supported[bvideo_format_1080i_50hz] = false;
447        bconfig_.features.video_format_is_supported[bvideo_format_720p] = false;
448        bconfig_.features.video_format_is_supported[bvideo_format_720p_50hz] = false;
449        bconfig_.features.video_format_is_supported[bvideo_format_1080p] = false;
450        bconfig_.features.video_format_is_supported[bvideo_format_1080p_25hz]=false;
451        bconfig_.features.video_format_is_supported[bvideo_format_1080p_30hz] = false;
452    }
453#endif
454
455    bconfig_.resources.display.type = "display";
456    if (platformConfig.supportedDisplay[0] && platformConfig.supportedDisplay[1]) {
457        bconfig_.resources.display.total = 2;
458        bconfig_.resources.display.objects = b_obj_1_2;
459    }
460    else if (platformConfig.supportedDisplay[0]) {
461        bconfig_.resources.display.total = 1;
462        bconfig_.resources.display.objects = b_obj_1;
463    }
464    else if (platformConfig.supportedDisplay[1]) {
465        bconfig_.resources.display.total = 1;
466        bconfig_.resources.display.objects = b_obj_2; /* 2nd CMP is the primary display */
467    }
468
469    bconfig_.resources.decode.type = "decode";
470    if (platformConfig.supportedDecoder[0] && platformConfig.supportedDecoder[1]) {
471        bconfig_.resources.decode.total = 2;
472        bconfig_.resources.decode.objects= b_obj_1_2;
473    }
474    else if (platformConfig.supportedDecoder[0]) {
475        bconfig_.resources.decode.total = 1;
476        bconfig_.resources.decode.objects= b_obj_1;
477    }
478    BDBG_MSG(("number of decodes =%d",bconfig_.resources.decode.total));
479
480#if BCM_BOARD==97398 || BCM_BOARD==97468  || BCM_BOARD==97208
481    /* leave all empty: let bconfig_p_set_tuners configure */
482#elif BCM_BOARD==97401 || BCM_BOARD==97400 || BCM_BOARD == 97455 || BCM_BOARD== 97435 || BCM_BOARD==97403 || BCM_BOARD==97458
483    bconfig_.resources.vsb.type = "vsb";
484    bconfig_.resources.vsb.total = 1;
485    bconfig_.resources.vsb.objects = b_obj_1;
486    bconfig_.resources.sds.type = "sds";
487    bconfig_.resources.sds.total = 1;
488    bconfig_.resources.sds.objects = b_obj_1;
489#elif BCM_BOARD==97405 || BCM_BOARD==97205
490    bconfig_.resources.vsb.type = "vsb";
491    bconfig_.resources.vsb.total = 1;
492    bconfig_.resources.vsb.objects = b_obj_1;
493    bconfig_.resources.ofdm.type = "ofdm";
494    bconfig_.resources.ofdm.total = 1;
495    bconfig_.resources.ofdm.objects = b_obj_1;
496    bconfig_.resources.sds.type = "sds";
497    bconfig_.resources.sds.total = 2;
498    bconfig_.resources.sds.objects = b_obj_1_2;
499#if B_HAS_TRANSCODE
500    bconfig_.resources.linein.type = "linein";
501    bconfig_.resources.linein.total = 2;
502    bconfig_.resources.linein.objects = b_obj_1_2;
503#endif
504#if B_HAS_EXTERNAL_ANALOG
505    bconfig_.resources.analog.type = "analog";
506    bconfig_.resources.analog.total = 1;
507    bconfig_.resources.analog.objects = b_obj_1;
508#endif
509#elif BCM_BOARD==97550
510    bconfig_.resources.qam.type = "qam";
511    bconfig_.resources.qam.total = 1;
512    bconfig_.resources.qam.objects = b_obj_1;
513    bconfig_.resources.ofdm.type = "ofdm";
514    bconfig_.resources.ofdm.total = 1;
515    bconfig_.resources.ofdm.objects = b_obj_1;
516#elif BCM_BOARD==93549
517    bconfig_.resources.vsb.type = "vsb";
518    bconfig_.resources.vsb.total = 1;
519    bconfig_.resources.vsb.objects = b_obj_1;
520    bconfig_.resources.qam.type = "qam";
521    bconfig_.resources.qam.total = 1;
522    bconfig_.resources.qam.objects = b_obj_1;
523#elif BCM_BOARD==93556 || BCM_BOARD==97466
524    bconfig_.resources.ofdm.type = "ofdm";
525    bconfig_.resources.ofdm.total = 1;
526    bconfig_.resources.ofdm.objects = b_obj_1;
527#elif BCHP_CHIP==3560 || BCHP_CHIP==3563
528    bconfig_.resources.vsb.type = "vsb";
529    bconfig_.resources.vsb.total = 1;
530    bconfig_.resources.vsb.objects = b_obj_1;
531    bconfig_.resources.qam.type = "qam";
532    bconfig_.resources.qam.total = 1;
533    bconfig_.resources.qam.objects = b_obj_1;
534    bconfig_.resources.analog.type = "analog";
535    bconfig_.resources.analog.total = 2;
536    bconfig_.resources.analog.objects = b_obj_1_2;
537    bconfig_.resources.linein.type = "linein";
538    bconfig_.resources.linein.total = 8;
539    bconfig_.resources.linein.objects = b_obj_8;
540#elif  BCM_BOARD == 97325 || BCM_BOARD==97340
541    bconfig_.resources.sds.type = "sds";
542    bconfig_.resources.sds.total = 2;
543    bconfig_.resources.sds.objects = b_obj_1_2;
544#elif  BCM_BOARD == 97335 || BCM_BOARD==97342
545    bconfig_.resources.sds.type = "sds";
546    /* This is due to Board Errors, you can only use Streamer input or Tuner Input */
547#ifdef TUNER_ENABLE_7335
548    bconfig_.resources.sds.total = 3;
549#else
550    bconfig_.resources.sds.total = 0;
551#endif
552    bconfig_.resources.sds.objects = b_obj_1_2_3;
553#else
554    bconfig_.resources.qam.type = "qam";
555    bconfig_.resources.qam.total = 2;
556    bconfig_.resources.qam.objects = b_obj_1_2;
557    bconfig_.resources.analog.type = "analog";
558    bconfig_.resources.analog.total = 2;
559    bconfig_.resources.analog.objects = b_obj_1_2;
560    bconfig_.resources.linein.type = "linein";
561    bconfig_.resources.linein.total = 3;
562    bconfig_.resources.linein.objects = b_obj_1_2_3;
563    bconfig_.resources.encode.type = "encode";
564    bconfig_.resources.encode.total = 2;
565    bconfig_.resources.encode.objects = b_obj_1_2;
566#endif
567
568    bconfig_.resources.pcm_play = b_pcm;
569
570#if B_MAX_STILL_DECODES> 0
571    bconfig_.resources.decode_still = b_decode_still;
572#endif
573#if B_MAX_AUDIO_ES_DECODES> 0
574    bconfig_.resources.decode_es = b_decode_es;
575#endif
576    bconfig_.resources.pcm_capture = b_pcm_capture;
577
578    /* All nexus platforms support streamers so far */
579#if BCHP_CHIP==7335 || BCHP_CHIP==7336 || BCHP_CHIP==7342
580    bconfig_.resources.streamers.total = 2;
581#elif (NEXUS_PLATFORM==97125)
582        /* Actually has only 1.  This is a hack allowing "streamers" to be
583        used to select QAM DS tuned at BNM console or with BBS. */
584    bconfig_.resources.streamers.total = 3; 
585#elif (NEXUS_PLATFORM==97019)
586    bconfig_.resources.streamers.total = 0; 
587#else
588    bconfig_.resources.streamers.total = 1;
589#endif
590    bconfig_.resources.streamers.type = "streamer";
591    bconfig_p_get_objs(bconfig_.resources.streamers.total, &bconfig_.resources.streamers.objects);
592
593    bconfig_.resources.input_bands.total = B_MAX_INPUTS;
594    bconfig_.resources.input_bands.type = "input_band";
595    bconfig_p_get_objs(bconfig_.resources.input_bands.total, &bconfig_.resources.input_bands.objects);
596
597    bconfig_p_add_pvr();
598
599    bconfig_.resources.decode_mosaic.type = "mosaic";
600
601    #if B_MAX_MOSAIC_DECODES > 0
602    bconfig_p_add_mosaics();
603    #endif
604
605#if B_HAS_SRS_TRUE_VOLUME
606    bconfig_.features.srs_volume=true;
607#else
608    bconfig_.features.srs_volume=false;
609#endif
610
611#if B_HAS_DOLBY_VOLUME
612    bconfig_.features.dolby_volume=true;
613#else
614    bconfig_.features.dolby_volume=false;
615#endif
616    return;
617}
618
619void
620bconfig_p_add_pvr(void)
621{
622    NEXUS_TransportCapabilities cap;
623    NEXUS_GetTransportCapabilities(&cap);
624
625    bconfig_.resources.record.type = "record";
626    bconfig_.resources.record.total = cap.numRecpumps>4?4:cap.numRecpumps;
627    bconfig_p_get_objs(bconfig_.resources.record.total, &bconfig_.resources.record.objects);
628
629    bconfig_.resources.record_tsdma.type = "record_tsdma";
630    bconfig_.resources.record_pes.type = "record_pes";
631
632    bconfig_.resources.playback.type = "playback";
633    bconfig_.resources.playback.total = cap.numPlaypumps;
634    bconfig_p_get_objs(bconfig_.resources.playback.total, &bconfig_.resources.playback.objects);
635}
636
637#if NEXUS_HAS_FRONTEND
638static bobject_t b_sds_ids[NEXUS_MAX_FRONTENDS];
639static bobject_t b_vsb_ids[NEXUS_MAX_FRONTENDS];
640static bobject_t b_qam_ids[NEXUS_MAX_FRONTENDS];
641static bobject_t b_ofdm_ids[NEXUS_MAX_FRONTENDS];
642#endif
643#if B_HAS_TRANSCODE
644static bobject_t b_xcd_linein_ids[B_MAX_ENCODES] ;
645#endif
646void
647bconfig_p_set_tuners(void)
648{
649#if NEXUS_HAS_FRONTEND
650    NEXUS_PlatformConfiguration platformConfig;
651    NEXUS_FrontendCapabilities capabilities;
652    unsigned n_sds, n_vsb, n_ofdm,n_qam;
653    int i, front_ends;
654    /* The Settop API tuner code depends on the reference platform "GetConfiguration" API for
655    frontend detection and instance management. See 97400 or related platforms for API and implementation. */
656    NEXUS_Platform_GetConfiguration(&platformConfig);
657    for(i=0,n_sds=0,n_vsb=0,n_ofdm=0,n_qam=0;i<NEXUS_MAX_FRONTENDS;i++)
658    {
659        /* if not open, then move on to next */
660        if(!platformConfig.frontend[i])
661            continue;
662
663        NEXUS_Frontend_GetCapabilities(platformConfig.frontend[i],&capabilities);
664
665        if(capabilities.vsb)
666        {
667            BDBG_MSG(("Frontend %d,vsb",i));
668            b_vsb_ids[n_vsb] = B_ID(i);
669            n_vsb++;
670        }
671        if(capabilities.qam)
672        {
673            BDBG_MSG(("Frontend %d,qam",i));
674            b_qam_ids[n_qam] = B_ID(i);
675            n_qam++;
676        }
677        if(capabilities.satellite)
678        {
679            BDBG_MSG(("Frontend %d,satellite",i));
680            b_sds_ids[n_sds] = B_ID(i);
681            n_sds++;
682        }
683        if(capabilities.ofdm)
684        {
685            BDBG_MSG(("Frontend %d,ofdm",i));
686            b_ofdm_ids[n_ofdm] = B_ID(i);
687            n_ofdm++;
688        }
689        /* TODO: add more frontends */
690    }
691    front_ends = i ;
692    BDBG_MSG(("Total tuners vsb=%d,qam=%d,satellite=%d,ofdm=%d",n_vsb,n_qam,n_sds,n_ofdm));
693    bconfig_.resources.sds.type = "sds";
694    bconfig_.resources.sds.objects = b_sds_ids;
695    bconfig_.resources.sds.total = n_sds;
696
697    bconfig_.resources.vsb.type = "vsb";
698    bconfig_.resources.vsb.objects = b_vsb_ids;
699    bconfig_.resources.vsb.total = n_vsb;
700    /* VSB card also support QAM */
701    bconfig_.resources.qam.type = "qam";
702    bconfig_.resources.qam.objects = b_qam_ids;
703    bconfig_.resources.qam.total = n_qam;
704
705    bconfig_.resources.ofdm.type = "ofdm";
706    bconfig_.resources.ofdm.objects = b_ofdm_ids;
707    bconfig_.resources.ofdm.total = n_ofdm;
708#endif
709#if B_HAS_TRANSCODE
710    for(i=0;i<B_MAX_ENCODES;i++)
711    {
712        b_xcd_linein_ids[i] = B_ID(front_ends+i) ;
713    }
714    bconfig_.resources.linein.type = "linein" ;
715    bconfig_.resources.linein.objects = b_xcd_linein_ids;
716    bconfig_.resources.linein.total = front_ends+i;
717    BDBG_ERR(("Config ofdm Objects %d", bconfig_.resources.ofdm.objects[0], bconfig_.resources.ofdm.objects[1]));
718    BDBG_ERR(("Config line Total %d", bconfig_.resources.ofdm.total));
719    BDBG_ERR(("Config line Type %s", bconfig_.resources.linein.type));
720    BDBG_ERR(("Config line Objects %d %d", bconfig_.resources.linein.objects[0], bconfig_.resources.linein.objects[1]));
721    BDBG_ERR(("Config line Total %d", bconfig_.resources.linein.total));
722#endif
723    return;
724}
725
726#if B_MAX_MOSAIC_DECODES > 0
727static bobject_t b_mosaic_ids[B_MAX_MOSAIC_DECODES];
728
729static void bconfig_p_add_mosaics(void)
730{
731    int i;
732
733    for ( i = 0; i < B_MAX_MOSAIC_DECODES; i++ )
734    {
735        b_mosaic_ids[i] = B_ID(i);
736    }
737
738    bconfig_.resources.decode_mosaic.objects = b_mosaic_ids;
739    bconfig_.resources.decode_mosaic.total = B_MAX_MOSAIC_DECODES;
740}
741#endif
Note: See TracBrowser for help on using the repository browser.