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

drivers:alt1250: Add interface to get number of wakelocks #19

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
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
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