77 lines
2.7 KiB
C
77 lines
2.7 KiB
C
/*================================================================
|
|
Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
|
|
Quectel Wireless Solutions Proprietary and Confidential.
|
|
=================================================================*/
|
|
#ifndef _QUEC_POWER_H_
|
|
#define _QUEC_POWER_H_
|
|
#include "pmic.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define QUEC_SLEEP_FLAGS_GROUP_ID ((unsigned int)0x514C504F)
|
|
#define QUEC_SLEEP_FLAGS_CLEAR_ID ((unsigned int)0x0)
|
|
|
|
#define QUEC_SLEEP_FLAGS_AND_MASK ((unsigned int)0x2)
|
|
#define QUEC_SLEEP_FLAGS_OR_MASK ((unsigned int)0x0)
|
|
|
|
#define QUEC_SLEEP_FLAGS_GROUP_EMPTY ((unsigned int)0x0)
|
|
|
|
#define QUEC_SLEEP_FLAGS_SUCCESS ((unsigned int)0x00)
|
|
#define QUEC_SLEEP_FLAGS_ERROR ((unsigned int)0x01)
|
|
#define QUEC_SLEEP_FLAGS_INVALID ((unsigned int)0x02)
|
|
|
|
typedef void* quec_sleep_flags_ref ;
|
|
|
|
typedef enum QUEC_SLEEP_FLAG_ENUM
|
|
{
|
|
QUEC_NOT_ALLOW_SLEEP = 0,
|
|
QUEC_ALLOW_SLEEP,
|
|
}QUEC_SLEEP_FLAG_E;
|
|
|
|
typedef struct QUEC_SLEEP_FLAGS_GROUP_STRUCT
|
|
{
|
|
char *quec_sleep_flag_group_name;
|
|
|
|
unsigned int quec_sleep_flag_group_id;
|
|
|
|
struct QUEC_SLEEP_FLAGS_GROUP_STRUCT
|
|
*quec_sleep_flags_group_next,
|
|
*quec_sleep_flags_group_previous;
|
|
|
|
unsigned int quec_sleep_flags_group_current;
|
|
|
|
unsigned int quec_sleep_flags_group_set_cnt;
|
|
}QUEC_SLEEP_FLAGS_GROUP;
|
|
|
|
unsigned int quec_sleep_flags_create(quec_sleep_flags_ref *group_ref , char *name_ptr);
|
|
unsigned int quec_sleep_flags_set(quec_sleep_flags_ref group_ref,unsigned int flags_to_set,unsigned int set_option);
|
|
unsigned int quec_sleep_flags_group_delete(quec_sleep_flags_ref group_ref);
|
|
unsigned int quec_get_current_sleep_flags(quec_sleep_flags_ref group_ref,unsigned int *current_flag_ptr);
|
|
void quec_autosleep_enable(QUEC_SLEEP_FLAG_E sleep_flag);
|
|
int quec_lpm_wakelock_create(char *lock_name, int name_size);
|
|
void quec_lpm_wakelock_delete(int wakelock_fd);
|
|
int quec_lpm_wakelock_lock(int wakelock_fd);
|
|
int quec_lpm_wakelock_unlock(int wakelock_fd);
|
|
int quec_lpm_get_wakelock_num(void);
|
|
int quec_lpm_init(void);
|
|
void quec_set_cam_vdd_output(Camera_Pwr_Val ldoVal);
|
|
|
|
|
|
typedef void (*quec_pwrkey_cb)(void);
|
|
void quec_pwrkey_intc_enable(unsigned char onoff);
|
|
void quec_pwrkey_register_irq(quec_pwrkey_cb callback);
|
|
void quec_power_down(unsigned char normal_flag);
|
|
void quec_power_reset(void);
|
|
void quec_power_reset_fast(void);
|
|
unsigned char quec_get_vbus_state(void);
|
|
unsigned char quec_get_pwrkey_status(void);
|
|
|
|
#ifdef __cplusplus
|
|
} /*"C" */
|
|
#endif
|
|
|
|
#endif /* _QUEC_POWER_H_ */
|
|
|
|
|