Skip to content

Commit

Permalink
drivers:alt1250: Add interface to get number of wakelocks
Browse files Browse the repository at this point in the history
  • Loading branch information
SPRESENSE committed Feb 6, 2023
2 parents f420cf4 + e777576 commit b13c5ae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/modem/alt1250/alt1250.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ static int alt1250_power_control(FAR struct alt1250_dev_s *dev,
ret = altmdm_give_wlock();
break;

case LTE_CMDID_COUNTWLOCK:
ret = altmdm_count_wlock();
break;

#ifdef CONFIG_PM
case LTE_CMDID_STOPAPI:
case LTE_CMDID_SUSPEND:
Expand Down
5 changes: 5 additions & 0 deletions drivers/modem/alt1250/altmdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,11 @@ int altmdm_give_wlock(void)
return cnt;
}

int altmdm_count_wlock(void)
{
return g_altmdm_dev.wcounter;
}

uint32_t altmdm_get_reset_reason(void)
{
return get_reset_reason();
Expand Down
16 changes: 16 additions & 0 deletions drivers/modem/alt1250/altmdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,22 @@ int altmdm_take_wlock(void);

int altmdm_give_wlock(void);

/****************************************************************************
* Name: altmdm_count_wlock
*
* Description:
* Returns the count of wakelocks currently acquired.
*
* Input Parameters:
* None
*
* Returned Value:
* Returns the count of wakelocks currently acquired.
*
****************************************************************************/

int altmdm_count_wlock(void);

/****************************************************************************
* Name: altmdm_poweron
*
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/wireless/lte/lte_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
#define LTE_CMDID_RETRYDISABLE _CMDGRP_POWER(0x3e)
#define LTE_CMDID_GET_POWER_STAT _CMDGRP_POWER(0x3f)
#define LTE_CMDID_SETCTXCB _CMDGRP_NOMDM(0x40)
#define LTE_CMDID_COUNTWLOCK _CMDGRP_POWER(0x41)

#define LTE_CMDID_ACCEPT _CMDGRP_NORMAL(0x50)
#define LTE_CMDID_BIND _CMDGRP_NORMAL(0x51)
Expand Down

0 comments on commit b13c5ae

Please sign in to comment.