Skip to content

Commit

Permalink
[nrf fromtree] soc: arm: nordic_nrf: fix poweroff for nrf53/91
Browse files Browse the repository at this point in the history
nRF53/91 require usage of nrf_regulators_system_off, so the API is not
common with nRF51/52. This was an oversight during the conversion.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
(cherry picked from commit b990082)
  • Loading branch information
gmarull committed Aug 28, 2023
1 parent 15f47a6 commit c709414
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions soc/arm/nordic_nrf/common/poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
#include <zephyr/sys/poweroff.h>
#include <zephyr/toolchain.h>

#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X)
#include <hal/nrf_power.h>
#else
#include <hal/nrf_regulators.h>
#endif

void z_sys_poweroff(void)
{
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X)
nrf_power_system_off(NRF_POWER);
#else
nrf_regulators_system_off(NRF_REGULATORS);
#endif

CODE_UNREACHABLE;
}

0 comments on commit c709414

Please sign in to comment.