Skip to content

Commit

Permalink
DELIA-63626: Power manger and deep sleep sky reviewed header merge
Browse files Browse the repository at this point in the history
Reason for change: RDK-38571 RDK-38568
Updating power and deepsleep platfrom code with the API

Change-Id: Ib939c06eb140dc2de5107e24de886ef34e63135d
  • Loading branch information
scthunderbolt committed Mar 29, 2024
1 parent b160644 commit 5cac317
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
23 changes: 13 additions & 10 deletions deepsleep/plat-deepsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@
* @return Return Code.
* @retval 0 if successful.
*/
int PLAT_DS_INIT(void)
DeepSleep_Return_Status_t PLAT_DS_INIT(void)
{
return 0;
return DEEPSLEEPMGR_SUCCESS;
}



void PLAT_DS_TERM(void)
DeepSleep_Return_Status_t PLAT_DS_TERM(void)
{
return DEEPSLEEPMGR_SUCCESS;
}

/**
Expand All @@ -83,10 +84,10 @@ void PLAT_DS_TERM(void)
* @return Return Code.
* @retval 0 if successful.
*/
int PLAT_DS_SetDeepSleep(uint32_t deep_sleep_timeout, bool *isGPIOWakeup)
DeepSleep_Return_Status_t PLAT_DS_SetDeepSleep(uint32_t deep_sleep_timeout, bool *isGPIOWakeup, bool networkStandby)
{
DEBUG_MSG("PLAT_DS_SetDeepSleep: putting to sleep, wakeup %d..\r\n", deep_sleep_timeout);
return 0;
return DEEPSLEEPMGR_SUCCESS;
}


Expand All @@ -98,22 +99,24 @@ int PLAT_DS_SetDeepSleep(uint32_t deep_sleep_timeout, bool *isGPIOWakeup)
* @param None
* @return None
*/
void PLAT_DS_DeepSleepWakeup(void)
DeepSleep_Return_Status_t PLAT_DS_DeepSleepWakeup(void)
{
DEBUG_MSG("PLAT_DS_DeepSleepWakeup: waking up from deep sleep\r\n");
DEBUG_MSG("PLAT_DS_DeepSleepWakeup: waking up from deep sleep\r\n");
return DEEPSLEEPMGR_SUCCESS;
}

int PLAT_DS_GetLastWakeupReason(DeepSleep_WakeupReason_t *wakeupReason)
DeepSleep_Return_Status_t PLAT_DS_GetLastWakeupReason(DeepSleep_WakeupReason_t *wakeupReason)
{
DEBUG_MSG("PLAT_DS_GetLastWakeupReason: Get Last Wakeup Reason: DEEPSLEEP_WAKEUPREASON_UNKNOWN");
*wakeupReason = DEEPSLEEP_WAKEUPREASON_UNKNOWN;
return DEEPSLEEPMGR_SUCCESS;
}

int PLAT_DS_GetLastWakeupKeyCode(IARM_Bus_DeepSleepMgr_WakeupKeyCode_Param_t *wakeupKeyCode)
DeepSleep_Return_Status_t PLAT_DS_GetLastWakeupKeyCode(DeepSleepMgr_WakeupKeyCode_Param_t *wakeupKeyCode)
{
DEBUG_MSG("PLAT_DS_GetLastWakeupKeyCode: Get Last Wakeup KeyCode: 0");
wakeupKeyCode->keyCode = 0;
return 0;
return DEEPSLEEPMGR_SUCCESS;
}

int32_t PLAT_API_SetWakeupSrc(WakeupSrcType_t srcType, bool enable)
Expand Down
19 changes: 10 additions & 9 deletions power/plat-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <stdlib.h>
#include "plat_power.h"

static IARM_Bus_PWRMgr_PowerState_t power_state;
static PWRMgr_PowerState_t power_state;

/**
* @brief Initialize the underlying Power Management module.
Expand All @@ -31,10 +31,10 @@ static IARM_Bus_PWRMgr_PowerState_t power_state;
* @return Return Code.
* @retval 0 if successful.
*/
int PLAT_INIT(void)
pmStatus_t PLAT_INIT(void)
{
power_state = IARM_BUS_PWRMGR_POWERSTATE_ON;
return 0;
power_state = PWRMGR_POWERSTATE_ON;
return PWRMGR_SUCCESS;
}

/**
Expand All @@ -46,7 +46,7 @@ int PLAT_INIT(void)
* @return Return Code.
* @retval 0 if successful.
*/
int PLAT_API_SetPowerState(IARM_Bus_PWRMgr_PowerState_t newState)
pmStatus_t PLAT_API_SetPowerState( PWRMgr_PowerState_t newState )
{
/* TODO: Add standby mode */
power_state = newState;
Expand All @@ -63,7 +63,7 @@ int PLAT_API_SetPowerState(IARM_Bus_PWRMgr_PowerState_t newState)
* @return Return Code.
* @retval 0 if successful.
*/
int PLAT_API_GetPowerState(IARM_Bus_PWRMgr_PowerState_t *curState)
pmStatus_t PLAT_API_GetPowerState( PWRMgr_PowerState_t *curState )
{
*curState = power_state;
return 0;
Expand Down Expand Up @@ -204,14 +204,15 @@ int PLAT_API_GetClockSpeed(uint32_t *speed)
* @param None.
* @return None.
*/
void PLAT_TERM(void)
pmStatus_t PLAT_TERM( void )
{
return;
return PWRMGR_SUCCESS;
}

void PLAT_Reset(IARM_Bus_PWRMgr_PowerState_t newState)
pmStatus_t PLAT_Reset( PWRMgr_PowerState_t newState )
{
system("reboot");
return PWRMGR_SUCCESS;
}

void PLAT_WHReset()
Expand Down

0 comments on commit 5cac317

Please sign in to comment.