lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /*******************************************************************************
|
| 2 | * Copyright (C) 2010, ZTE Corporation.
|
| 3 | *
|
| 4 | * File Name:
|
| 5 | * File Mark:
|
| 6 | * Description:
|
| 7 | * Others:
|
| 8 | * Version: V1.0
|
| 9 | * Author: yuxiang
|
| 10 | * Date: 2013-9-4
|
| 11 | * History 1:
|
| 12 | * Date:
|
| 13 | * Version:
|
| 14 | * Author:
|
| 15 | * Modification:
|
| 16 | * History 2:
|
| 17 | ********************************************************************************/
|
| 18 |
|
| 19 | #ifndef _DRVS_PM_H
|
| 20 | #define _DRVS_PM_H
|
| 21 |
|
| 22 | /****************************************************************************
|
| 23 | * Include files
|
| 24 | ****************************************************************************/
|
| 25 |
|
| 26 |
|
| 27 | /****************************************************************************
|
| 28 | * Macros
|
| 29 | ****************************************************************************/
|
| 30 |
|
| 31 |
|
| 32 | /****************************************************************************
|
| 33 | * Types
|
| 34 | ****************************************************************************/
|
| 35 | typedef enum _T_ZDrvPmic_Enable{
|
| 36 | PM_DISABLE = 0,
|
| 37 | PM_ENABLE,
|
| 38 | PM_ENABLE_NOT_SUPPORT = -100,
|
| 39 | PM_ENABLE_MAX_STATUS = -255
|
| 40 | } T_ZDrvPmic_Enable;
|
| 41 |
|
| 42 | typedef enum _T_ZDrvPmic_NrmMode{
|
| 43 | PM_NRMMODE_AUTO = 0,
|
| 44 | PM_NRMMODE_PFM,
|
| 45 | PM_NRMMODE_PWM,
|
| 46 | PM_NRMMODE_NOT_SUPPORT = -100,
|
| 47 | PM_NRMMODE_MAX_STATUS = -255
|
| 48 | }T_ZDrvPmic_NrmMode;
|
| 49 |
|
| 50 | typedef enum _T_ZDrvPmic_SlpMode{
|
| 51 | PM_SLPMODE_AUTO_NORMAL = 0, //auto in dcdc, normal in ldo
|
| 52 | PM_SLPMODE_ECO_NRMV, //normal voltage
|
| 53 | PM_SLPMODE_ECO_SLPV, //sleep voltage
|
| 54 | PM_SLPMODE_OFF, //OFF
|
| 55 | PM_SLPMODE_NOT_SUPPORT = -100,
|
| 56 | PM_SLPMODE_MAX_STATUS = -255
|
| 57 | }T_ZDrvPmic_SlpMode;
|
| 58 |
|
| 59 | //consumer
|
| 60 | typedef enum _T_ZDrvPmic_Regulator{
|
| 61 | VCORE0 = 0,
|
| 62 | VCORE1,
|
| 63 | VDDR,
|
| 64 | VMMC,
|
| 65 | VSD0,
|
| 66 | VSD1,
|
| 67 | VIO_LO,
|
| 68 | VIO_HI,
|
| 69 | VUSB_0V9,
|
| 70 | VUSB_3v3,
|
| 71 | VPLL_LO,
|
| 72 | VPLL_HI,
|
| 73 | VSIM1,
|
| 74 | VSIM2,
|
| 75 | VRF_LO,
|
| 76 | VRF_HI,
|
| 77 | VRF_SW,
|
| 78 | VPA,
|
| 79 | VCTCXO1,
|
| 80 | VCTCXO2,
|
| 81 | VSSBUF,
|
| 82 | VRTC,
|
| 83 | } T_ZDrvPmic_Regulator;
|
| 84 |
|
| 85 | typedef enum _T_ZDrvPmic_Vcore{
|
| 86 | PM_VOLT_0_800 = 0,
|
| 87 | PM_VOLT_0_850 , //output V,
|
| 88 | PM_VOLT_0_875 , //output V,
|
| 89 | PM_VOLT_0_900 , //output V,
|
| 90 | PM_VOLT_0_925 , //output V,
|
| 91 | PM_VOLT_0_950 , //output V,
|
| 92 | PM_VOLT_1_100 , //output V,
|
| 93 | PM_VOLT_1_150 , //output V,
|
| 94 | PM_VOLT_1_200 , //output V,
|
| 95 | PM_VOLT_1_250 , //output V,
|
| 96 | PM_VOLT_1_600 , //output V,
|
| 97 | PM_VOLT_1_800 , //output V,
|
| 98 | PM_VOLT_2_750 , //output V,
|
| 99 | PM_VOLT_2_800 , //output V,
|
| 100 | PM_VOLT_2_850 , //output V,
|
| 101 | PM_VOLT_3_000 , //output V,
|
| 102 | PM_VOLT_3_300 , //output V,
|
| 103 | PM_VOLT_3_600 , //output V,
|
| 104 | PM_VOLT_NOT_SUPPORT = -100,
|
| 105 | PM_VOLT_MAX_STATUS = -255,
|
| 106 | } T_ZDrvPmic_Voltage;
|
| 107 |
|
| 108 |
|
| 109 | typedef struct _T_ZDrvPmic_Opt
|
| 110 | {
|
| 111 | SINT32 (*zDrvPmic_LdoInit)(VOID);
|
| 112 | }T_ZDrvPmic_Opt;
|
| 113 |
|
| 114 | /****************************************************************************
|
| 115 | * Constants
|
| 116 | ****************************************************************************/
|
| 117 |
|
| 118 | /****************************************************************************
|
| 119 | * Global Variables
|
| 120 | ****************************************************************************/
|
| 121 |
|
| 122 | /****************************************************************************
|
| 123 | * Function Prototypes
|
| 124 | ****************************************************************************/
|
| 125 | SINT32 zDrvPmic_Initiate(VOID);
|
| 126 |
|
| 127 | SINT32 zDrvPmic_SetNormalOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable enable);
|
| 128 | SINT32 zDrvPmic_SetNormalVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage voltage);
|
| 129 | SINT32 zDrvPmic_SetNormalMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_NrmMode nrmMode);
|
| 130 |
|
| 131 | SINT32 zDrvPmic_GetNormalOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable* enable);
|
| 132 | SINT32 zDrvPmic_GetNormalVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage* voltage);
|
| 133 | SINT32 zDrvPmic_GetNormalMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_NrmMode* nrmMode);
|
| 134 |
|
| 135 | SINT32 zDrvPmic_SetSleepOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable enable);
|
| 136 | SINT32 zDrvPmic_SetSleepVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage voltage);
|
| 137 | SINT32 zDrvPmic_SetSleepMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_SlpMode slpMode);
|
| 138 |
|
| 139 | SINT32 zDrvPmic_GetSleepOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable* enable);
|
| 140 | SINT32 zDrvPmic_GetSleepVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage* voltage);
|
| 141 | SINT32 zDrvPmic_GetSleepMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_SlpMode* slpMode);
|
| 142 |
|
| 143 | SINT32 zDrvPmic_SetOpt(T_ZDrvPmic_Opt* pPmicOpt);
|
| 144 |
|
| 145 | #endif
|
| 146 |
|