drivers/modem/alt1250: Add LTE_CMDID_RESTARTAPI command

ALT1250 driver sends an event named LTE_CMDID_RESTARTAPI
to ALT1250 daemon when state is PM_NOARMAL in the function
of prepare registered by pm_register.
This commit is contained in:
SPRESENSE 2023-12-06 16:46:56 +09:00 committed by Xiang Xiao
parent cb32e6d50a
commit eaba1bef1e
3 changed files with 20 additions and 4 deletions

View File

@ -640,6 +640,7 @@ static int alt1250_power_control(FAR struct alt1250_dev_s *dev,
#ifdef CONFIG_PM
case LTE_CMDID_STOPAPI:
case LTE_CMDID_RESTARTAPI:
case LTE_CMDID_SUSPEND:
alt1250_receive_daemon_response(req);
break;
@ -1380,6 +1381,19 @@ static int alt1250_pm_prepare(struct pm_callback_s *cb, int domain,
ret = alt1250_send_daemon_request(ALT1250_EVTBIT_STOPAPI);
if (ret)
{
return ERROR;
}
else
{
return OK;
}
}
else if (pmstate == PM_NORMAL)
{
ret = alt1250_send_daemon_request(ALT1250_EVTBIT_RESTARTAPI);
if (ret)
{
return ERROR;

View File

@ -58,10 +58,11 @@
#define ALT1250_IOC_SETEVTBUFF _MODEMIOC(3)
#define ALT1250_IOC_EXCHGCONTAINER _MODEMIOC(4)
#define ALT1250_EVTBIT_RESET (1ULL << 63)
#define ALT1250_EVTBIT_REPLY (1ULL << 62)
#define ALT1250_EVTBIT_STOPAPI (1ULL << 61)
#define ALT1250_EVTBIT_SUSPEND (1ULL << 60)
#define ALT1250_EVTBIT_RESET (1ULL << 63)
#define ALT1250_EVTBIT_REPLY (1ULL << 62)
#define ALT1250_EVTBIT_STOPAPI (1ULL << 61)
#define ALT1250_EVTBIT_SUSPEND (1ULL << 60)
#define ALT1250_EVTBIT_RESTARTAPI (1ULL << 59)
/* Number of sockets */

View File

@ -158,6 +158,7 @@
#define LTE_CMDID_SETCTXCB _CMDGRP_NOMDM(0x40)
#define LTE_CMDID_COUNTWLOCK _CMDGRP_POWER(0x41)
#define LTE_CMDID_REPEVT_DUMMY _CMDGRP_EVENT(0x42)
#define LTE_CMDID_RESTARTAPI _CMDGRP_NORMAL(0x43)
#define LTE_CMDID_ACCEPT _CMDGRP_NORMAL(0x50)
#define LTE_CMDID_BIND _CMDGRP_NORMAL(0x51)