Skip to content

Commit

Permalink
modem/alt1250: Add lowerhalf I/F to set power manager
Browse files Browse the repository at this point in the history
Add new interface to set power manager for resuming LTE function
from sleep mode.
  • Loading branch information
SPRESENSE committed Jan 26, 2023
1 parent d859296 commit 93c5086
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions boards/arm/cxd56xx/common/src/cxd56_alt1250.c
Expand Up @@ -38,6 +38,7 @@

#include <arch/board/board.h>
#include <arch/board/cxd56_alt1250.h>
#include <arch/chip/pm.h>

#include "cxd56_spi.h"
#include "cxd56_dmac.h"
Expand Down Expand Up @@ -80,6 +81,7 @@
static struct spi_dev_s *alt1250_poweron(void);
static void alt1250_poweroff(void);
static bool alt1250_powerstatus(void);
static int alt1250_hibernation_mode(bool enable);
static void alt1250_reset(void);
static void alt1250_irqattach(xcpt_t handler);
static void alt1250_irqenable(bool enable);
Expand All @@ -97,6 +99,7 @@ static const struct alt1250_lower_s g_alt1250_lower =
.poweron = alt1250_poweron,
.poweroff = alt1250_poweroff,
.powerstatus = alt1250_powerstatus,
.hiber_mode = alt1250_hibernation_mode,
.reset = alt1250_reset,
.irqattach = alt1250_irqattach,
.irqenable = alt1250_irqenable,
Expand Down Expand Up @@ -307,6 +310,30 @@ static bool alt1250_powerstatus(void)
return board_alt1250_powerstatus();
}

/****************************************************************************
* Name: alt1250_hibernation_mode
*
* Description:
* Set power manager for entering hibernation mode.
*
****************************************************************************/

static int alt1250_hibernation_mode(bool enable)
{
uint32_t bootmask = 0;

if (enable)
{
/* Set GPIO interrupt for wake-up */

bootmask = up_pm_get_bootmask();
bootmask |= PM_BOOT_COLD_GPIO;
up_pm_set_bootmask(bootmask);
}

return board_alt1250_powerkeep(enable);
}

/****************************************************************************
* Name: alt1250_reset
*
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/modem/alt1250.h
Expand Up @@ -306,6 +306,7 @@ struct alt1250_lower_s
FAR struct spi_dev_s * (*poweron)(void);
void (*poweroff)(void);
bool (*powerstatus)(void);
int (*hiber_mode)(bool);
void (*reset)(void);
void (*irqattach)(xcpt_t handler);
void (*irqenable)(bool enable);
Expand Down

0 comments on commit 93c5086

Please sign in to comment.