[Feature][ZXW-241]merge P56U01 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I7985538dde6951dd824c36149bf9a1e3ca23c734
diff --git a/ap/lib/libatext/ext_bsp_func.c b/ap/lib/libatext/ext_bsp_func.c
index ab2a226..cde961c 100755
--- a/ap/lib/libatext/ext_bsp_func.c
+++ b/ap/lib/libatext/ext_bsp_func.c
@@ -703,6 +703,39 @@
}
+#define ZX_RESET_DEV "/dev/zx_reset"
+
+#define ZX_RESET_IOC_MAGIC 'W'
+/*ioctl cmd usd by device*/
+#define ZX_RESET_FAST_REBOOT _IOW(ZX_RESET_IOC_MAGIC, 1, char *)
+
+static int fast_reboot(int at_fd,char * at_paras,void * *res_msg,int * res_msglen)
+{
+
+ int fd, ret;
+ char strCmd[AT_CMD_MAX] = {0};
+
+ fd =open(ZX_RESET_DEV, O_RDWR);
+ if(fd<0){
+ at_print(AT_NORMAL,"ap reset open FAIL\n");
+ return -1;
+ }
+
+ ret=ioctl(fd, ZX_RESET_FAST_REBOOT, NULL);
+ if(ret<0){
+ at_print(AT_NORMAL,"fast reboot add ioctl FAIL\n");
+ close(fd);
+ return AT_END;
+ }
+
+ close(fd);
+
+ *res_msg = at_query_result_build("fast reboot",strCmd);
+ *res_msglen = strlen(*res_msg);
+
+ return AT_END;
+}
+
/**************************init********************
@@ -728,6 +761,8 @@
register_serv_func2("probe2_get_thresh", 0, 0, 0,tsc_probe2_get_thresh,NULL);
register_serv_func2("probe3_set_thresh=", 0, 0, 0,tsc_probe3_set_thresh,NULL);
register_serv_func2("probe3_get_thresh", 0, 0, 0,tsc_probe3_get_thresh,NULL);
+
+ register_serv_func2("fast_reboot", 0, 0, 0,fast_reboot, NULL);
}