Merge "[Feature][ZXW-197]add T106E Agps function and the user information can be configured"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
index 01be6b1..f50d299 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-at-common/liblynq-at-common.bb
@@ -3,7 +3,7 @@
 DESCRIPTION = "liblynq-at-common"
 LICENSE = "CLOSED"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3f86c7f456a6d0bbeca155e65084eee1"
-DEPENDS += "liblynq-log"
+DEPENDS += "liblynq-log liblynq-qser-autosuspend"
 #inherit workonsrc
 WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-at-common/"
 FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
index ba29e2d..0cb7976 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
@@ -30,7 +30,7 @@
 int (*qser_sms_setsmscenteraddress)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg);

 

 void qser_sms_handler(QSER_SMS_MsgRef msgRef, void* contextPtr) {

-    printf("[%s-%d] sms handler, msgRef->sms_data = %s\n", __FUNCTION__, __LINE__, msgRef->sms_data);

+    printf("[%s-%d] sms handler, msgRef->sms_data = %s,addr =%s\n", __FUNCTION__, __LINE__, msgRef->sms_data, msgRef->src_addr);

 }

 

 bool isNumeric(char *phnum) {

diff --git a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
index b6fb1a4..1fa3af5 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
+++ b/cap/zx297520v3/src/lynq/framework/lynq-atcid/lynq_atsvc_plugin.xml
@@ -10,10 +10,10 @@
   />
   <module name="/lib/liblynq-at-common.so"
                  register="lynq_register_at_common"
-                 cmd="AT+MNETCALL;AT+GTARNDIS;AT+CGIR;AT+LGMDS;AT+LRNDISHANDLE"
+                 cmd="AT+MNETCALL;AT+GTARNDIS;AT+CGIR;AT+LGMDS;AT+LRNDISHANDLE;AT+LEELSP"
   />
   <module name="/lib/liblynq-at-factory.so"
                  register="lynq_register_at_factory"
                  cmd="AT+LYNQFACTORY"
   />
-</lynq_atsvc_plugin>
\ No newline at end of file
+</lynq_atsvc_plugin>
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
index ccb8eaa..c8acceb 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
@@ -6,6 +6,7 @@
 #include <errno.h>
 #include <liblog/lynq_deflog.h>
 #include "include/liblynq-at-common.h"
+#include <include/lynq-qser-autosuspend.h>
 
 DEFINE_LYNQ_LIB_LOG(LYNQ_AT_COMMON)
 
@@ -44,9 +45,31 @@
     return;
 }
 
-static Command commands[] = 
+void lynq_handle_autosuspend(char* input)
+{
+    int len;
+    int ret;
+    char buf[64] = {0};
+    ALOGE("lynq_handle_autosuspend start\n");
+    len = strlen(input);
+    ret = qser_autosuspend_enable(input[len-1]);
+    if(ret != 0)
+    {
+        sprintf(buf,"+CME ERROR: 100\r\n");
+        handle_output(buf, strlen(buf), Response);
+    }
+    else
+    {
+        lynq_response_ok();
+    }
+
+    return;
+}
+
+static Command commands[] =
 {
     {"CGIR",lynq_handle_version},
+    {"LEELSP",lynq_handle_autosuspend},
     {NULL, NULL}
 };
 
@@ -102,4 +125,4 @@
         ALOGD("function %s line %d\n", __FUNCTION__, __LINE__);
         return lynq_at_common_cb;
     }
-}
\ No newline at end of file
+}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
index 2cfedec..e5a1c20 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/makefile
@@ -37,6 +37,7 @@
     -lbinder \

     -lpthread \

     -llynq-log \

+    -llynq-qser-autosuspend \

 

 

 SOURCES = $(wildcard *.cpp)

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp
index 66ff18d..453a29c 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-led/lynq_led.cpp
@@ -15,6 +15,8 @@
 {

     char buf_netled[BUF_LEN] = "";

 

+    if(led_mode != 0 && led_mode != 1)

+        return -1;

     sprintf(buf_netled,"%s.%s.%s=%d", LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_STATUSLED_KEY, led_mode);

     lynq_uci_set(buf_netled);

 

@@ -25,8 +27,11 @@
 {

     char buf_statusled[BUF_LEN] = "";

 

+    if(led_mode != 0 && led_mode != 1)

+        return -1;

     sprintf(buf_statusled,"%s.%s.%s=%d", LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, led_mode);

     lynq_uci_set(buf_statusled);

 

+    system("/usr/bin/lynq-led-sev");

     return 0;

 }
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
index 47b5562..2928d8d 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -990,6 +990,10 @@
     if (NULL == data_call || NULL == err)
     {
         LYERRLOG("call start incoming paramters error");
+        if(err != NULL)
+        {
+            *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
+        }
         return ret;
     }
     if (data_call->profile_idx == 0)
@@ -1004,12 +1008,13 @@
         if (ret != 0)
         {
             LYERRLOG("qser_apn_get error");
+            *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
             return ret;
         }
         judge_pdp_type(apn_info.pdp_type,pdptype);
         ret = lynq_setup_data_call_sp(&handle,apn_info.apn_name,apn_info.apn_type,apn_info.username,apn_info.password,NULL,pdptype,pdptype);
     }
-    if (ret < 0)
+    if (ret != 0)
     {
         *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
     }
@@ -1026,12 +1031,18 @@
         LYERRLOG("call stop incoming paramters error");
         return ret;
     }
-    data_call_handle_get(profile_idx,&handle);
+    ret = data_call_handle_get(profile_idx,&handle);
+    if(ret != 0)
+    {
+        LYERRLOG("datacall handle get error");
+        *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
+        return ret;
+    }
     ret = lynq_deactive_data_call(&handle);
-    if (ret < 0)
+    if (ret != 0)
     {
         *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
-        return *err;
+        return ret;
     }
     return ret;
 }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
index fb8a686..a86d8a5 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-sms/lynq_qser_sms.cpp
@@ -43,12 +43,17 @@
             {
                 QSER_sms_info.storage_index = handle;
                 QSER_sms_info.format = (QSER_SMS_T)charset;
+                memset(QSER_sms_info.sms_data, 0, sizeof(QSER_sms_info.sms_data));
+                memset(QSER_sms_info.src_addr, 0, sizeof(QSER_sms_info.src_addr));
+                memcpy(QSER_sms_info.src_addr, teleNum, strlen(teleNum));
                 memcpy(QSER_sms_info.sms_data, message, smslen);
                 QSER_sms_info.sms_data[smslen] = '\0';
                 QSER_sms_info.sms_data_len = smslen;
                 if(total > 1)
                 {
                     QSER_sms_info.user_data_head_valid = 1;
+                    QSER_sms_info.user_data_head.seg_number = current;
+                    QSER_sms_info.user_data_head.total_segments = total;
                 }
                 else
                 {
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/data.cpp b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/data.cpp
index b3d1971..01ba78e 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/data.cpp
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/data.cpp
@@ -167,6 +167,7 @@
     memcpy(datacall.cdma_password, argv[5], QSER_APN_PASSWORD_SIZE);    

     

     ret = qser_data_call_start(&datacall, &err);

+    printf("LYNQ_QSER_SETUP_DATA_CALL err = %d\n", err);

     printf("%s%d\n",TEST_RESULT,ret);

     return ret;

 }

@@ -197,6 +198,7 @@
     }

 

     ret = qser_data_call_stop(profile_idx_int, ip_family, &err);

+    printf("LYNQ_QSER_DEACTIVATE_DATA_CALL err = %d\n", err);

     printf("%s%d\n",TEST_RESULT,ret);

     return ret;

 }

diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
index 706aa6f..f86f8e0 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
+++ b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
@@ -9,12 +9,12 @@
 int main(int argc, const char *argv[])
 {
     int ret = 0;
-    ret = lynq_set_netled_on(1);
+    ret = lynq_set_netled_on(atoi(argv[1]));
     if(ret){
         printf("[%s-%d] lynq_set_netled_on error\n", __FUNCTION__, __LINE__);
         return -1;
     }
-    ret = lynq_set_statusled_on(1);
+    ret = lynq_set_statusled_on(atoi(argv[1]));
     if(ret){
         printf("[%s-%d] lynq_set_statusled_on error\n", __FUNCTION__, __LINE__);
         return -1;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/tlv320aic3x.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/tlv320aic3x.c
index 09ef085..c1fd5d4 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/tlv320aic3x.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/codecs/tlv320aic3x.c
@@ -1018,15 +1018,6 @@
 	struct aic3x_priv *info = dev_get_drvdata(dev);
 	struct device_node *np = dev->of_node;
 
-        #if 1
-        unsigned tmp;
-        void __iomem 	*reg_base;
-        reg_base = ioremap(0x13B000+0x94 ,4);
-        tmp  = ioread32(reg_base);
-        tmp |= (1<<0)|(1<<2);
-        iowrite32(tmp,reg_base);
-        #endif
-
 	dev_info(dev, "%s:start!\n", __func__);
 
 	if(dev == NULL){
@@ -2068,6 +2059,39 @@
 	return 0;
 }
 
+static int component_open(struct snd_soc_component *component,
+                struct snd_pcm_substream *substream)
+{
+        int ret = 0;
+        struct aic3x_priv *info = snd_soc_component_get_drvdata(component);
+        printk("Enter into %s()\n", __func__);
+
+        if(info->clk != NULL) {
+                ret = clk_enable(info->clk);
+                if(ret) {
+                        pr_err("failed to enable clkout");
+                }
+        }
+        pr_info("%s:clk en end!\n", __func__);
+
+        return ret;
+}
+
+static int component_close(struct snd_soc_component *component,
+                struct snd_pcm_substream *substream)
+{
+        int ret = 0;
+        struct aic3x_priv *info = snd_soc_component_get_drvdata(component);
+        printk("Enter into %s()\n", __func__);
+
+        if(info->clk != NULL) {
+                clk_disable(info->clk);
+        }
+        pr_info("%s:clk dis end!\n", __func__);
+
+        return ret;
+}
+
 static const struct snd_soc_component_driver soc_component_dev_aic3x = {
 	.set_bias_level		= aic3x_set_bias_level,
 	.probe			= aic3x_probe,
@@ -2080,6 +2104,8 @@
 	.use_pmdown_time	= 1,
 	.endianness		= 1,
 	.non_legacy_dai_naming	= 1,
+        .open = component_open,
+        .close = component_close,
 };
 
 static void aic3x_configure_ocmv(struct i2c_client *client)
diff --git a/update_version.sh b/update_version.sh
index 0c38314..83fa9b8 100644
--- a/update_version.sh
+++ b/update_version.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 #export LYNQ_VERSION="T106_lynq_version_ap_build_sh"
-LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P52U02.AP.09.01"
-LYNQ_CAP_INSIDE_VERSION="CAP.09.01"
-LYNQ_CAP_VERSION="CAP.09.01"
+LYNQ_AP_VERSION="T106CN-ZS03.V2.01.01.02P52U02.AP.09.02"
+LYNQ_CAP_INSIDE_VERSION="CAP.09.02"
+LYNQ_CAP_VERSION="CAP.09.02"
 COMMIT_ID="$(git rev-parse HEAD)"
 
 LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""