Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc: arm: nxp_imx: rt5xx: make deepsleep pin config functions weak #64808

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions soc/arm/nxp_imx/rt5xx/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ static uint32_t isp_pin[3];
/* System clock frequency. */
extern uint32_t SystemCoreClock;

__ramfunc void set_deepsleep_pin_config(void)
/* Weak so board can override */
__ramfunc void __weak rt5xx_set_deepsleep_pin_config(void)
{
/* Backup Pin configuration. */
isp_pin[0] = IOPCTL->PIO[1][15];
Expand All @@ -34,7 +35,7 @@ __ramfunc void set_deepsleep_pin_config(void)
IOPCTL->PIO[3][29] = 0;
}

__ramfunc void restore_deepsleep_pin_config(void)
__ramfunc void __weak rt5xx_restore_deepsleep_pin_config(void)
{
/* Restore the Pin configuration. */
IOPCTL->PIO[1][15] = isp_pin[0];
Expand Down Expand Up @@ -65,9 +66,9 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
POWER_EnterSleep();
break;
case PM_STATE_SUSPEND_TO_IDLE:
set_deepsleep_pin_config();
rt5xx_set_deepsleep_pin_config();
POWER_EnterDeepSleep(EXCLUDE_FROM_DEEPSLEEP);
restore_deepsleep_pin_config();
rt5xx_restore_deepsleep_pin_config();
break;
default:
LOG_DBG("Unsupported power state %u", state);
Expand Down
Loading