[Feature][T108][system][task-view-1692]Merged gsw hal code

Only Configure: No
Affected branch: GSW_V1453
Affected module: libgsw
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no

Change-Id: I7fb669b6afc6e2f92a1e86ec8543498eb73120b4
diff --git a/mbtk/libgsw_lib/gsw_pm_interface.c b/mbtk/libgsw_lib/gsw_pm_interface.c
index 886a512..f16b5da 100755
--- a/mbtk/libgsw_lib/gsw_pm_interface.c
+++ b/mbtk/libgsw_lib/gsw_pm_interface.c
@@ -32,7 +32,7 @@
 #endif

 

 #define GSW_PM "[HAL][GSW_PM]"

-

+#define GSW_WAKELOCK_NAME "gsw_app_wakelock"

 #define LOGV(fmt, args ...) \

     do{ \

         char *file_ptr_1001 = __FILE__; \

@@ -104,8 +104,6 @@
     } while(0)

     

 

-

-#define GSW_HAL_MEM_INVAILD -2 //表示入参地址为NULL

 #define LOCK_MAX_SIZE 129

 typedef void (*GSW_PM_WAKEUPCALLBACK)(int32_t wakeup_in);

 typedef void (*mbtk_lpm_handler_t)(int32_t wakeup_in);

@@ -348,4 +346,44 @@
         }

     }

     return;

-}
\ No newline at end of file
+}

+/**

+ * @brief enable autosleep

+ * @return int : 0 is success , other failed

+ */

+int gswAutoSleepEnable(void)

+{

+    return gsw_autosleep_enable();

+}

+

+/**

+ * @brief disenable autosleep

+ * @return int : 0 is success , other failed

+ */

+int gswAutoSleepDisable(void)

+{

+    return gsw_autosleep_disenable();

+}

+

+/**

+ * @brief modem relase wakeuplock

+ * @return void

+ */

+void gswPMStartSleep(void)

+{

+    gsw_pm_enter_sleep(GSW_WAKELOCK_NAME);

+}

+

+/**

+ * @brief modem add wakeuplock

+ * @return int : 0 is success , other failed

+ */

+int gswPMStopSleep(void)

+{

+    return gsw_pm_exit_sleep(GSW_WAKELOCK_NAME);

+}

+

+int gswPmSDKInit(gsw_pm_wakeup_handler gswPmCallBack)

+{

+    return gsw_pm_sdk_init(gswPmCallBack);

+}