PMI Instrumentation Library API Reference Guide
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator
PMILib.h
Go to the documentation of this file.
1 #ifndef __PMILIBRARY_H
2 #define __PMILIBRARY_H
3 /*
4  * PMILib.h
5  *
6  * Power Management Instrumentation API Definitions
7  *
8  * Copyright (C) 2009, 2010 Texas Instruments Incorporated - http://www.ti.com/
9  *
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  *
15  * Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  *
18  * Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the
21  * distribution.
22  *
23  * Neither the name of Texas Instruments Incorporated nor the names of
24  * its contributors may be used to endorse or promote products derived
25  * from this software without specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39 */
40 
41 
107 #ifdef _CIO
108 #include <stdio.h>
109 #endif
110 
111 #ifndef __linux__ //If linux don't need
112 #include <stdlib.h>
113 #include <stdint.h> // The library uses C99 exact-width integer types
114 #else
115 #include <linux/kernel.h>
116 #include <stddef.h>
117 #endif
118 
119 //Using forward slashes in the relative search path for linux compatibility
120 
121 #ifdef _OMAP4430 // must be OMAP4430 build
122 #include "../../PMICMILib/src/PCMI_Omap4430.h"
123 #endif
124 
125 #include "../../STMLib/include/StmLibrary.h"
126 #include "../../STMLib/src/StmSupport.h"
127 #include "../../PMICMILib/src/PCMI_Common.h"
128 
129 
130 
131 #ifdef __cplusplus
132 extern "C" {
133 #endif
134 
135 
137 //
138 // Public PMI Specific Enumerations
139 //
141 
145 typedef enum { ePMI_ENABLE_NONE =0,
152 
154 //
155 // Public Typedefs
156 //
158 
161 typedef enum { ePMI_PM,
163  } ePMI_ModID;
164 
169 typedef struct PMI_Handle_t PMI_Handle;
170 
175 
179 typedef struct _PMI_CfgParams {
185 #ifdef _STMLogging
186  STMHandle * pSTMHandle;
189  uint8_t STMMessageCh;
194 #endif
195  uint32_t FuncClockDivider;
197  uint32_t SampleWindowSize;
199  }PMI_CfgParams;
200 
206 //
208 // Public Function Definitions
209 //
211 
212 
262 ePMI_Error PMI_OpenModule(PMI_Handle_Pntr * pPMI_Handle, ePMI_ModID PMI_ModId, PMI_CfgParams * pPMI_CfgParams);
263 
288 ePMI_Error PMI_CloseModule(PMI_Handle_Pntr pPMI_Handle );
289 
320 ePMI_Error PMI_GetVersion(PMI_Handle_Pntr pPMI_Handle, uint32_t * pLibMajorVersion, uint32_t * pLibMinorVersion, uint32_t * pSWFuncID, uint32_t * pHwFuncID);
321 
343 ePMI_Error PMI_ModuleActivityEnable (PMI_Handle_Pntr pPMI_Handle );
344 
373 ePMI_Error PMI_ModuleActivityDisable(PMI_Handle_Pntr pPMI_Handle, int32_t retain);
374 
403 ePMI_Error PMI_ConfigModule(PMI_Handle_Pntr pPMI_Handle, ePCMI_Triggers triggerEnables, ePMI_EventEnables eventEnables);
404 
422 ePMI_Error PMI_GetSampleWindow(PMI_Handle_Pntr pPMI_Handle, uint32_t * pFuncClockDivider, uint32_t * pSampleWindowSize );
423 
441 const char * PMI_GetErrorMsg(ePMI_Error errorCode);
442 
467 ePMI_Error PMI_LogMsg(PMI_Handle_Pntr pPMI_Handle, const char * FmtString, int32_t * pValue);
468 
500 #ifndef _NoMark
501 ePMI_Error PMI_MarkLogicVoltageOPPChange(PMI_Handle_Pntr pPMI_Handle, ePMI_LVD_OPP pwrDomain, uint8_t pwrValue);
502 
532 ePMI_Error PMI_MarkMemoryVoltageOPPChange(PMI_Handle_Pntr pPMI_Handle, ePMI_MVD_OPP pwrDomain, ePMI_MVD_PwrState pwrState);
533 
563 ePMI_Error PMI_MarkLogicPowerStateChange(PMI_Handle_Pntr pPMI_Handle, ePMI_LPD_StateChange pwrDomain, ePMI_LPD_PwrState pwrState);
564 
593 ePMI_Error PMI_MarkMemoryPowerStateChange(PMI_Handle_Pntr pPMI_Handle, ePMI_MPD_StateChange pwrDomain, ePMI_MPD_PwrState pwrState);
594 #endif
595 
596 #ifdef __cplusplus
597 }
598 #endif
599 
600 #endif /* __PMILIBARY_H */
uint32_t PMI_Module_BaseAddr
Definition: PMILib.h:180
ePMI_Error PMI_ModuleActivityDisable(PMI_Handle_Pntr pPMI_Handle, int32_t retain)
ePMI_LPD_StateChange
Definition: PCMI_Omap4430.h:81
ePMI_LPD_PwrState
Definition: PCMI_Omap4430.h:139
Definition: PMILib.h:162
Definition: PMILib.h:145
Definition: PMILib.h:179
ePMI_MVD_OPP
Definition: PCMI_Omap4430.h:72
uint32_t FuncClockDivider
Definition: PMILib.h:195
ePMI_Error PMI_LogMsg(PMI_Handle_Pntr pPMI_Handle, const char *FmtString, int32_t *pValue)
ePCMI_Error ePMI_Error
Definition: PMILib.h:204
ePMI_MVD_PwrState
Definition: PCMI_Omap4430.h:131
ePMI_Error PMI_MarkMemoryPowerStateChange(PMI_Handle_Pntr pPMI_Handle, ePMI_MPD_StateChange pwrDomain, ePMI_MPD_PwrState pwrState)
const char * PMI_GetErrorMsg(ePMI_Error errorCode)
ePCMI_Error
Definition: PCMI_Common.h:89
ePMI_Error PMI_ConfigModule(PMI_Handle_Pntr pPMI_Handle, ePCMI_Triggers triggerEnables, ePMI_EventEnables eventEnables)
uint32_t SampleWindowSize
Definition: PMILib.h:197
ePMI_Error PMI_MarkLogicVoltageOPPChange(PMI_Handle_Pntr pPMI_Handle, ePMI_LVD_OPP pwrDomain, uint8_t pwrValue)
PMI_Handle * PMI_Handle_Pntr
Definition: PMILib.h:174
ePMI_Error PMI_MarkMemoryVoltageOPPChange(PMI_Handle_Pntr pPMI_Handle, ePMI_MVD_OPP pwrDomain, ePMI_MVD_PwrState pwrState)
ePMI_Error PMI_GetVersion(PMI_Handle_Pntr pPMI_Handle, uint32_t *pLibMajorVersion, uint32_t *pLibMinorVersion, uint32_t *pSWFuncID, uint32_t *pHwFuncID)
void(* PCMI_CallBack)(const char *funcName, ePCMI_Error)
Definition: PCMI_Common.h:120
struct _PMI_CfgParams PMI_CfgParams
uint32_t PMI_ClockCtl_BaseAddr
Definition: PMILib.h:181
ePMI_Error PMI_OpenModule(PMI_Handle_Pntr *pPMI_Handle, ePMI_ModID PMI_ModId, PMI_CfgParams *pPMI_CfgParams)
ePMI_Error PMI_CloseModule(PMI_Handle_Pntr pPMI_Handle)
ePMI_Error PMI_MarkLogicPowerStateChange(PMI_Handle_Pntr pPMI_Handle, ePMI_LPD_StateChange pwrDomain, ePMI_LPD_PwrState pwrState)
ePMI_MPD_StateChange
Definition: PCMI_Omap4430.h:100
ePMI_Error PMI_ModuleActivityEnable(PMI_Handle_Pntr pPMI_Handle)
Definition: PMILib.h:150
ePMI_Error PMI_GetSampleWindow(PMI_Handle_Pntr pPMI_Handle, uint32_t *pFuncClockDivider, uint32_t *pSampleWindowSize)
ePMI_LVD_OPP
Definition: PCMI_Omap4430.h:63
ePMI_EventEnables
Definition: PMILib.h:145
ePMI_ModID
Definition: PMILib.h:161
PCMI_CallBack pPMI_CallBack
Definition: PMILib.h:183
struct PMI_Handle_t PMI_Handle
Definition: PMILib.h:169
ePMI_MPD_PwrState
Definition: PCMI_Omap4430.h:149
Definition: PMILib.h:161