| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2005-2012, 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: bthd_3x7x.c $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/4 $ |
|---|
| 12 | * $brcm_Date: 3/2/12 2:10p $ |
|---|
| 13 | * |
|---|
| 14 | * [File Description:] |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/thd/7552/bthd_3x7x.c $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/4 3/2/12 2:10p farshidf |
|---|
| 21 | * SW7552-223: implement 7552 THD Frontend PM |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/3 2/9/12 2:13p farshidf |
|---|
| 24 | * SW7552-205: port to new 4.0 code |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/2 2/2/12 6:34p atanugul |
|---|
| 27 | * SW3461-141: Add initializers for BTHD_SetAcquireParams |
|---|
| 28 | * BTHD_GetAcquireParams and BTHD_PowerUp |
|---|
| 29 | * |
|---|
| 30 | * Hydra_Software_Devel/1 10/10/11 2:13p farshidf |
|---|
| 31 | * SW7552-134: update to 2.0 of 3461 code |
|---|
| 32 | * |
|---|
| 33 | * Hydra_Software_Devel/7 8/16/11 6:11p farshidf |
|---|
| 34 | * SW7552-105: update the frontend with 3461_V1_0_RC0 label |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/6 8/16/11 6:04p farshidf |
|---|
| 37 | * SW7552-105: update the frontend with 3461_V1_0_RC0 label |
|---|
| 38 | * |
|---|
| 39 | * Hydra_Software_Devel/5 6/10/11 2:44p farshidf |
|---|
| 40 | * SWDTV-7504: add the new isdbt flag |
|---|
| 41 | * |
|---|
| 42 | * Hydra_Software_Devel/4 6/2/11 10:16a atanugul |
|---|
| 43 | * SW3461-5: fix compilation error |
|---|
| 44 | * |
|---|
| 45 | * Hydra_Software_Devel/3 6/1/11 5:42p atanugul |
|---|
| 46 | * SW3461-5: Add initializer for BTHD_RequestThdAsyncStatus, |
|---|
| 47 | * BTHD_GetThdAsyncStatus, BTHD_InstallCallback |
|---|
| 48 | * |
|---|
| 49 | * Hydra_Software_Devel/2 4/27/11 12:13p farshidf |
|---|
| 50 | * SWDTV-6190: add the BBS call from Nexus |
|---|
| 51 | * |
|---|
| 52 | * Hydra_Software_Devel/1 4/21/11 6:39p farshidf |
|---|
| 53 | * SWDTV-6191: add the THD code |
|---|
| 54 | * |
|---|
| 55 | ***************************************************************************/ |
|---|
| 56 | #include "bstd.h" |
|---|
| 57 | #include "bthd.h" |
|---|
| 58 | #include "bthd.h" |
|---|
| 59 | #include "bthd_3x7x.h" |
|---|
| 60 | #include "bthd_api.h" |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | BDBG_MODULE(bthd_3x7x); |
|---|
| 64 | |
|---|
| 65 | static const BTHD_Settings defDevSettings = |
|---|
| 66 | { |
|---|
| 67 | { /* i2c settings */ |
|---|
| 68 | 0x00, /* chipAddr */ |
|---|
| 69 | NULL, /* interruptEnableFunc */ |
|---|
| 70 | NULL /* interruptEnableFuncParam */ |
|---|
| 71 | }, |
|---|
| 72 | { /* API function table */ |
|---|
| 73 | BTHD_3x7x_Open, |
|---|
| 74 | BTHD_3x7x_Close, |
|---|
| 75 | BTHD_3x7x_InitializeParams, /* BTHD_3x7x_InitializeParams */ |
|---|
| 76 | NULL, /*BTHD_3x7x_ReadRegister,*/ |
|---|
| 77 | NULL, /* BTHD_3x7x_WriteRegister, */ |
|---|
| 78 | NULL, /* BTHD_3x7x_Mi2cWrite, */ |
|---|
| 79 | NULL, /* BTHD_3x7x_Mi2cRead, */ |
|---|
| 80 | NULL, /* BTHD_SetAcquireParams */ |
|---|
| 81 | NULL, /* BTHD_GetAcquireParams */ |
|---|
| 82 | BTHD_3x7x_Acquire, |
|---|
| 83 | BTHD_3x7x_GetStatus, |
|---|
| 84 | BTHD_3x7x_ResetStatus, /*BTHD_3x7x_ResetInbandStatus,*/ |
|---|
| 85 | NULL, /*BTHD_3x7x_GetChipRevision,*/ |
|---|
| 86 | NULL, /*BTHD_3x7x_GetVersion,*/ |
|---|
| 87 | BTHD_3x7x_GetInterruptEventHandle, |
|---|
| 88 | NULL, /* BTHD_3x7x_HandleInterrupt_isr */ |
|---|
| 89 | BTHD_3x7x_ProcessInterruptEvent, |
|---|
| 90 | BTHD_3x7x_GetLockStateChangeEvent, |
|---|
| 91 | NULL, /* BTHD_3x7x_AcquireIfd,*/ |
|---|
| 92 | NULL, /* BTHD_3x7x_GetIfdStatus,*/ |
|---|
| 93 | BTHD_3x7x_GetConstellation, |
|---|
| 94 | BTHD_3x7x_GetDefaultInbandParams, |
|---|
| 95 | NULL, /* BTHD_7550_GetDefaultIfdParams, */ |
|---|
| 96 | NULL, /* BTHD_3x7x_ResetIfdStatus,*/ |
|---|
| 97 | NULL, /* BTHD_3x7x_SetIfdAudioSettings,*/ |
|---|
| 98 | NULL, /* BTHD_3x7x_GetIfdAudioSettings,*/ |
|---|
| 99 | BTHD_3x7x_PowerUp, |
|---|
| 100 | BTHD_3x7x_PowerDown, |
|---|
| 101 | BTHD_3x7x_GetEWSEventHandle, |
|---|
| 102 | BTHD_3x7x_GetLockStatus, |
|---|
| 103 | BTHD_3x7x_GetBBSInterruptEventHandle, |
|---|
| 104 | BTHD_3x7x_ProcessBBSInterruptEvent, |
|---|
| 105 | NULL, /* BTHD_RequestThdAsyncStatus */ |
|---|
| 106 | NULL, /* BTHD_GetThdAsyncStatus */ |
|---|
| 107 | BTHD_3x7x_InstallCallback |
|---|
| 108 | }, |
|---|
| 109 | NULL, /* BTMR_Handle */ |
|---|
| 110 | false, /* RF Delta Sigma Invert */ |
|---|
| 111 | false, /* IF Delta Sigma Invert */ |
|---|
| 112 | 0, |
|---|
| 113 | NULL, /* BMEM_Heap_Handle */ |
|---|
| 114 | false, /* IF AGC zero */ |
|---|
| 115 | NULL, |
|---|
| 116 | false |
|---|
| 117 | }; |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | static const BTHD_InbandParams defInbandParams = |
|---|
| 121 | { |
|---|
| 122 | BTHD_InbandMode_eDvbt, /* Inband mode */ |
|---|
| 123 | BTHD_Bandwidth_8Mhz, /* Bandwidth */ |
|---|
| 124 | 666000000, /* Tuner Frequency */ |
|---|
| 125 | 36000000, /* IF Frequency */ |
|---|
| 126 | BTHD_CCI_Auto, /* Co-channel filter options */ |
|---|
| 127 | BTHD_PullInRange_eWide, /* Pull-in range */ |
|---|
| 128 | true, /* Mode/Guard auto acquire */ |
|---|
| 129 | BTHD_TransmissionMode_e2K, /* Manual Transmission mode (FFT Size) */ |
|---|
| 130 | BTHD_GuardInterval_e1_4, /* Manual guard interval selection */ |
|---|
| 131 | false, /* acquire after tune does not apply to 7552*/ |
|---|
| 132 | BTHD_Decode_Hp, /* Decode mode */ |
|---|
| 133 | false, /* TPS Acquire */ |
|---|
| 134 | BTHD_Modulation_e64Qam, /* Modulation type */ |
|---|
| 135 | BTHD_CodeRate_e1_2, /* Manual coderate LP */ |
|---|
| 136 | BTHD_CodeRate_e1_2, /* Manual coderate HP */ |
|---|
| 137 | BTHD_Hierarchy_0, /* Hierarchy selection */ |
|---|
| 138 | true, /* ISDB-T TMCC acquire */ |
|---|
| 139 | false, /* ISDB-T partial reception */ |
|---|
| 140 | BTHD_Modulation_e16Qam, /* ISDB-T Layer A modulation type */ |
|---|
| 141 | BTHD_CodeRate_e1_2, /* ISDB-T Layer A code rate */ |
|---|
| 142 | BTHD_IsdbtTimeInterleaving_0X, /* ISDB-T Layer A time interleaving */ |
|---|
| 143 | 13, /*ISDB-T Layer A number of segments*/ |
|---|
| 144 | BTHD_Modulation_e16Qam, /* ISDB-T Layer B modulation type */ |
|---|
| 145 | BTHD_CodeRate_e1_2, /* ISDB-T Layer B code rate */ |
|---|
| 146 | BTHD_IsdbtTimeInterleaving_0X, /* ISDB-T Layer B time interleaving */ |
|---|
| 147 | 0, /*ISDB-T Layer A number of segments*/ |
|---|
| 148 | BTHD_Modulation_e16Qam, /* ISDB-T Layer B modulation type */ |
|---|
| 149 | BTHD_CodeRate_e1_2, /* ISDB-T Layer C code rate */ |
|---|
| 150 | BTHD_IsdbtTimeInterleaving_0X, /* ISDB-T Layer C time interleaving*/ |
|---|
| 151 | 0, /* ISDB-T Layer C number of segments*/ |
|---|
| 152 | BTHD_ThdAcquisitionMode_eAuto /* Auto Acquire */ |
|---|
| 153 | }; |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | /*************************************************************************** |
|---|
| 159 | * BTHD_3x7x_GetDefaultInbandParams |
|---|
| 160 | ***************************************************************************/ |
|---|
| 161 | BERR_Code BTHD_3x7x_GetDefaultInbandParams(BTHD_InbandParams *pDefSettings) |
|---|
| 162 | { |
|---|
| 163 | *pDefSettings = defInbandParams; |
|---|
| 164 | return BERR_SUCCESS; |
|---|
| 165 | } |
|---|
| 166 | |
|---|
| 167 | /*************************************************************************** |
|---|
| 168 | * BTHD_7550_GetDefaultSettings() |
|---|
| 169 | ***************************************************************************/ |
|---|
| 170 | BERR_Code BTHD_3x7x_GetDefaultSettings(BTHD_Settings *pDefSettings) |
|---|
| 171 | { |
|---|
| 172 | *pDefSettings = defDevSettings; |
|---|
| 173 | return BERR_SUCCESS; |
|---|
| 174 | } |
|---|
| 175 | |
|---|
| 176 | |
|---|