| 1 | /*************************************************************************** |
|---|
| 2 | * (c)2005-2011 Broadcom Corporation |
|---|
| 3 | * |
|---|
| 4 | * This program is the proprietary software of Broadcom Corporation and/or its licensors, |
|---|
| 5 | * and may only be used, duplicated, modified or distributed pursuant to the terms and |
|---|
| 6 | * conditions of a separate, written license agreement executed between you and Broadcom |
|---|
| 7 | * (an "Authorized License"). Except as set forth in an Authorized License, Broadcom grants |
|---|
| 8 | * no license (express or implied), right to use, or waiver of any kind with respect to the |
|---|
| 9 | * Software, and Broadcom expressly reserves all rights in and to the Software and all |
|---|
| 10 | * intellectual property rights therein. IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU |
|---|
| 11 | * HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY |
|---|
| 12 | * NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE. |
|---|
| 13 | * |
|---|
| 14 | * |
|---|
| 15 | * $brcm_Workfile: btnr_3x7x_priv.h $ |
|---|
| 16 | * $brcm_Revision: Hydra_Software_Devel/2 $ |
|---|
| 17 | * $brcm_Date: 12/16/11 3:47p $ |
|---|
| 18 | * |
|---|
| 19 | * [File Description:] |
|---|
| 20 | * |
|---|
| 21 | * Revision History: |
|---|
| 22 | * |
|---|
| 23 | * $brcm_Log: /magnum/portinginterface/tnr/7552/btnr_3x7x_priv.h $ |
|---|
| 24 | * |
|---|
| 25 | * Hydra_Software_Devel/2 12/16/11 3:47p farshidf |
|---|
| 26 | * SW7552-170: fix the Tnr to use the B0 code |
|---|
| 27 | * |
|---|
| 28 | * Hydra_Software_Devel/1 6/12/11 12:30p farshidf |
|---|
| 29 | * SW7552-36: code clean up |
|---|
| 30 | * |
|---|
| 31 | * |
|---|
| 32 | ***************************************************************************/ |
|---|
| 33 | |
|---|
| 34 | /*************************************************************************** |
|---|
| 35 | * Definitions |
|---|
| 36 | ***************************************************************************/ |
|---|
| 37 | #ifndef _BTNR_3x7x_PRIV_H__ |
|---|
| 38 | #define _BTNR_3x7x_PRIV_H__ |
|---|
| 39 | |
|---|
| 40 | #if __cplusplus |
|---|
| 41 | extern "C" { |
|---|
| 42 | #endif |
|---|
| 43 | |
|---|
| 44 | #include "btnr_struct.h" |
|---|
| 45 | #include "bmem.h" |
|---|
| 46 | #include "btnr_def.h" |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | #define BREG_WriteField(h, Register, Field, Data) \ |
|---|
| 50 | BREG_Write32(h, BCHP_##Register, ((BREG_Read32(h, BCHP_##Register) & \ |
|---|
| 51 | ~((uint32_t)BCHP_MASK(Register, Field))) | \ |
|---|
| 52 | BCHP_FIELD_DATA(Register, Field, Data))) |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | #define BREG_ReadField(h, Register, Field) \ |
|---|
| 56 | ((BREG_Read32(h, BCHP_##Register) & BCHP_MASK(Register,Field)) >> \ |
|---|
| 57 | BCHP_SHIFT(Register,Field)) |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | /*************************************************************************** |
|---|
| 62 | * Summary: |
|---|
| 63 | * Structure for chip-specific TNR handle |
|---|
| 64 | * |
|---|
| 65 | * Description: |
|---|
| 66 | * This is the chip-specific component of the BTNR_Handle. |
|---|
| 67 | * |
|---|
| 68 | * See Also: |
|---|
| 69 | * None. |
|---|
| 70 | * |
|---|
| 71 | ***************************************************************************/ |
|---|
| 72 | typedef struct BTNR_P_3x7x_Handle |
|---|
| 73 | { |
|---|
| 74 | uint32_t magicId; /* Used to check if structure is corrupt */ |
|---|
| 75 | BREG_Handle hRegister; |
|---|
| 76 | BTNR_3x7x_TuneParams_t *pTunerParams; |
|---|
| 77 | BTNR_3x7x_TuneStatus_t *pTunerStatus; |
|---|
| 78 | BTMR_TimerHandle hTimer; |
|---|
| 79 | BMEM_Heap_Handle hHeap; |
|---|
| 80 | BKNI_EventHandle hInterruptEvent; |
|---|
| 81 | } BTNR_P_3x7x_Handle; |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | typedef struct BTNR_P_3x7x_Handle *BTNR_3x7x_Handle; |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | /*************************************************************************** |
|---|
| 89 | * API function interface |
|---|
| 90 | ***************************************************************************/ |
|---|
| 91 | |
|---|
| 92 | BERR_Code BTNR_3x7x_Close( |
|---|
| 93 | BTNR_Handle hDev /* [in] Device handle */ |
|---|
| 94 | ); |
|---|
| 95 | BERR_Code BTNR_3x7x_SetSettings( |
|---|
| 96 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 97 | BTNR_Settings *settings /* [in] TNR settings. */ |
|---|
| 98 | ); |
|---|
| 99 | BERR_Code BTNR_3x7x_GetSettings( |
|---|
| 100 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 101 | BTNR_Settings *settings /* [out] TNR settings. */ |
|---|
| 102 | ); |
|---|
| 103 | BERR_Code BTNR_3x7x_SetRfFreq( |
|---|
| 104 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 105 | uint32_t rfFreq, /* [in] Requested tuner freq., in Hertz */ |
|---|
| 106 | BTNR_TunerMode tunerMode /* [in] Requested tuner mode */ |
|---|
| 107 | ); |
|---|
| 108 | BERR_Code BTNR_3x7x_GetRfFreq( |
|---|
| 109 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 110 | uint32_t *rfFreq, /* [output] Returns tuner freq., in Hertz */ |
|---|
| 111 | BTNR_TunerMode *tunerMode); |
|---|
| 112 | |
|---|
| 113 | BERR_Code BTNR_3x7x_GetInfo( |
|---|
| 114 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 115 | BTNR_TunerInfo *tnrInfo /* [out] Tuner information */ |
|---|
| 116 | ); |
|---|
| 117 | |
|---|
| 118 | BERR_Code BTNR_3x7x_PowerUp (BTNR_3x7x_Handle ); |
|---|
| 119 | BERR_Code BTNR_3x7x_PowerDown(BTNR_3x7x_Handle ); |
|---|
| 120 | BERR_Code BTNR_3x7x_SetPowerSaver( |
|---|
| 121 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 122 | BTNR_PowerSaverSettings *pwrSettings /* [in] Power saver settings. */ |
|---|
| 123 | ); |
|---|
| 124 | BERR_Code BTNR_3x7x_GetPowerSaver( |
|---|
| 125 | BTNR_3x7x_Handle hDev, /* [in] Device handle */ |
|---|
| 126 | BTNR_PowerSaverSettings *pwrSettings /* [in] Power saver settings. */ |
|---|
| 127 | ); |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | #ifdef __cplusplus |
|---|
| 131 | } |
|---|
| 132 | #endif |
|---|
| 133 | |
|---|
| 134 | #endif /* _BTNR_3x7x_PRIV_H__ */ |
|---|