source: svn/newcon3bcm2_21bu/nexus/modules/i2c/7552/src/nexus_i2c_module.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: 5.0 KB
Line 
1/***************************************************************************
2 *     (c)2007-2009 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 *  Except as expressly set forth in the Authorized License,
15 *
16 *  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17 *  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18 *  and to use this information only in connection with your use of Broadcom integrated circuit products.
19 *
20 *  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21 *  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22 *  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23 *  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24 *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25 *  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26 *  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27 *  USE OR PERFORMANCE OF THE SOFTWARE.
28 *
29 *  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30 *  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31 *  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32 *  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33 *  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34 *  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35 *  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36 *  ANY LIMITED REMEDY.
37 *
38 * $brcm_Workfile: nexus_i2c_module.c $
39 * $brcm_Revision: 5 $
40 * $brcm_Date: 1/26/09 12:05p $
41 *
42 * Module Description:
43 *
44 * Revision History:
45 *
46 * $brcm_Log: /nexus/modules/i2c/7400/src/nexus_i2c_module.c $
47 *
48 * 5   1/26/09 12:05p erickson
49 * PR51468: global variable naming convention
50 *
51 * 4   1/26/09 11:29a erickson
52 * PR51468: global variable naming convention
53 *
54 * 3   8/14/08 5:26p katrep
55 * PR45674: Fix compiiler warning in kernel mode non debug builds
56 *
57 * 2   5/12/08 4:25p erickson
58 * PR42628: call BI2C_Close
59 *
60 * 1   1/18/08 2:21p jgarrett
61 * PR 38808: Merging to main branch
62 *
63 * Nexus_Devel/2   10/11/07 9:23a erickson
64 * PR36017: clean up on Uninit
65 *
66 * Nexus_Devel/1   10/5/07 1:42p jgarrett
67 * PR 35744: Adding initial version
68 *
69 * Nexus_Devel/3   9/28/07 5:14p jgarrett
70 * PR 34594: Adding sync thunks
71 *
72 * Nexus_Devel/2   9/27/07 9:19p jgarrett
73 * PR 34954: Adding SPDIF
74 *
75 * Nexus_Devel/1   9/27/07 7:52p jgarrett
76 * PR 34594: Adding module calls
77 *
78 **************************************************************************/
79#include "nexus_i2c_module.h"
80#include "nexus_i2c_init.h"
81
82BDBG_MODULE(nexus_i2c_module);
83
84/* global module handle & data */
85BI2C_Handle g_NEXUS_i2cHandle;
86NEXUS_ModuleHandle g_NEXUS_i2cModule;
87
88NEXUS_ModuleHandle NEXUS_I2cModule_Init(const NEXUS_I2cModuleSettings *pSettings)
89{
90    BERR_Code errCode;
91    NEXUS_ModuleSettings moduleSettings;
92    BI2C_Settings i2cSettings;
93
94    BDBG_ASSERT(NULL == g_NEXUS_i2cModule);
95    BSTD_UNUSED(pSettings);
96
97    /* init global module handle */
98    NEXUS_Module_GetDefaultSettings(&moduleSettings);
99    moduleSettings.priority = NEXUS_ModulePriority_eIdle; /* i2c interface is extremely slow */
100    g_NEXUS_i2cModule = NEXUS_Module_Create("i2c", &moduleSettings);
101    if ( NULL == g_NEXUS_i2cModule )
102    {
103        errCode=BERR_TRACE(BERR_NOT_SUPPORTED);
104        return NULL;
105    }
106
107    BI2C_GetDefaultSettings(&i2cSettings, g_pCoreHandles->chp);
108    BDBG_MSG(("Opening I2C Device"));
109    errCode = BI2C_Open(&g_NEXUS_i2cHandle, g_pCoreHandles->chp, g_pCoreHandles->reg, g_pCoreHandles->bint, &i2cSettings);
110    if ( errCode )
111    {
112        BDBG_ERR(("Unable to open I2C Device"));
113        errCode = BERR_TRACE(errCode);
114        NEXUS_Module_Destroy(g_NEXUS_i2cModule);
115        return NULL;
116    }
117
118    /* Success */
119    return g_NEXUS_i2cModule;
120}
121
122void NEXUS_I2cModule_Uninit(void)
123{
124    NEXUS_I2c_P_CloseAll();
125    BI2C_Close(g_NEXUS_i2cHandle);
126    NEXUS_Module_Destroy(g_NEXUS_i2cModule);
127    g_NEXUS_i2cModule = NULL;
128}
129
130void NEXUS_I2cModule_GetDefaultSettings(
131    NEXUS_I2cModuleSettings *pSettings    /* [out] */
132    )
133{
134    BSTD_UNUSED(pSettings);
135}
136
Note: See TracBrowser for help on using the repository browser.