1 /******************************************************************************
2 ** File Name: sc8800g_sleep_cfg.h *
5 ** Copyright: 2007 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic function for ldo management. *
7 ******************************************************************************/
9 /******************************************************************************
11 ** ------------------------------------------------------------------------- *
12 ** DATE NAME DESCRIPTION *
13 ** 07/09/2007 jiexia.yu Create. *
14 ******************************************************************************/
15 #ifndef _SC8800G_SLEEP_CFG_H_
16 #define _SC8800G_SLEEP_CFG_H_
18 /**---------------------------------------------------------------------------*
20 **---------------------------------------------------------------------------*/
23 /**---------------------------------------------------------------------------*
25 **---------------------------------------------------------------------------*/
31 /**---------------------------------------------------------------------------*
33 **---------------------------------------------------------------------------*/
34 #define SLEEP_MODULE_CONFIG_SLEEP_PIN_FEATURE 0
36 #define SLEEP_SUPPORT_BTCLK 0
37 #define SLEEP_SUPPORT_IVSP 1
38 #define SLEEP_SUPPORT_ISP 1
39 #define SLEEP_SUPPORT_DCAM 1
40 #define SLEEP_SUPPORT_LCDC 1
41 #define SLEEP_SUPPORT_SDIO 1
42 #define SLEEP_SUPPORT_BKLIGHT 1
43 #define SLEEP_SUPPORT_MMI 1
44 #define SLEEP_SUPPORT_USBD 0
45 #ifdef CHIP_VER_8800G2
46 #define SLEEP_SUPPORT_RETENTION 1
48 #define SLEEP_SUPPORT_RETENTION 0
51 typedef void (*SLP_ENTER_FUNC) (uint8 slp_type);
55 SLP_CFG_NULL = 0, //id for NULL
63 SLP_AHB_NULL = 0, //id for NULL
64 SLP_AHB_DCAM, //id for AHB device dcam
65 SLP_AHB_USBD, //id for AHB device usbd
66 SLP_AHB_EMC, //id for AHB device emc
67 SLP_AHB_DMA, //id for AHB device dma
68 SLP_AHB_BUS, //id for AHB device bus
74 SLP_APB_NULL = 0, //id for NULL
75 SLP_APB_WDG, //id for APB device watchdog
76 SLP_APB_ADC, //id for APB device adc
77 SLP_APB_TMR, //id for APB device timer
78 SLP_APB_SIM, //id for APB device sim
79 SLP_APB_I2C, //id for APB device i2c
80 SLP_APB_TPC, //id for APB device tpc
81 SLP_APB_PWM, //id for APB device pwm
82 SLP_APB_KPD, //id for APB device keypad
83 SLP_APB_GPIO, //id for APB device gpio
84 SLP_APB_GEA, //id for APB device gea
85 SLP_APB_SYSTMR, //id for APB device sys timer
86 SLP_APB_UART0, //id for APB device uart0
87 SLP_APB_UART1, //id for APB device uart1
88 SLP_APB_SPI0, //id for APB device spi0
89 SLP_APB_IIS, //id for APB device iis
90 SLP_APB_SPI1, //id for APB device spi1
91 SLP_APB_PIN, //id for APB device pin
98 SLP_CTL_NULL = 0, //id for NULL
99 SLP_CTRL_MCU_FORCE_STOP, //id for arm and ahb ctrl
100 SLP_CTRL_MCU_DMA_WAKEUP_EN, //id for dma wake up ctrl
101 SLP_CTRL_MCU_SYS_SLEEP_EN, //id for sys sleep ctrl
102 SLP_CTRL_MCU_DEEP_SLEEP_EN, //id for deep sleep ctrl
103 SLP_CTRL_APB_STOP, //id for APB sleep ctrl
104 SLP_CTRL_APB_FORCE_ON, //id for APB sleep ctrl
105 SLP_CTRL_APB_FORCE_SLEEP, //id for APB sleep ctrl
106 SLP_CTRL_XTLEN, //id for xtlen sleep ctrl
107 SLP_CTRL_DMA_SLEEP_MOD, //id for dma sleep mode ctrl
108 SLP_CTRL_MCU_PLL_EN, //id for mcu pll enable
115 AHB_CAN_SLP_APB_CAN_SLP,
116 AHB_CAN_SLP_APB_NO_SLP,
117 AHB_NO_SLP_APB_CAN_SLP,
118 AHB_NO_SLP_APB_NO_SLP,
120 } SLP_AHB_APB_TYPE_E;
148 } SLP_AHB_CTL_T, * SLP_AHB_CTL_PTR;
158 } SLP_APB_CTL_T, * SLP_APB_CTL_PTR;
168 } SLP_BIT_CTL_T, * SLP_BIT_CTL_PTR;
172 SLP_AHB_CTL_T ahb_ctrl[SLP_AHB_DEV_MAX];
173 SLP_APB_CTL_T apb_ctrl[SLP_APB_DEV_MAX];
174 SLP_BIT_CTL_T slp_bit_ctrl[SLP_CTRL_MAX];
175 SLP_ENTER_FUNC slp_handler;
176 } SLP_COM_CTL_T, *SLPCOMCTL_PTR;
180 SLP_COM_CTL_T slp_com_cfg;
181 } SLP_CTL_T, * SLPCTL_PTR;
185 CHIP_TYPE_E chip_type;
186 SLPCTL_PTR sleep_ctl;
187 } SLP_CFG_T, * SLP_CFG_PTR;
189 /*****************************************************************************/
190 // Function name: Slp_Get_Cfg
191 // Description : this function get sleep table entry according to chip type
192 // Global resource dependence:
195 /*****************************************************************************/
196 PUBLIC SLPCTL_PTR Slp_Get_Cfg (void);
197 /*****************************************************************************/
198 // Function name: Slp_Get_Apb_Status
199 // Description : this function get chip sleep status according ahb and apb
201 // Global resource dependence:
204 /*****************************************************************************/
206 PUBLIC int tx_enter_deep_sleep (uint32 level);
208 /**---------------------------------------------------------------------------*
210 **---------------------------------------------------------------------------*/
215 #endif // _LDO_MANAGER_H_