Merge "[Bugfix][T106BUG-557]fix qser_sim_changepin error"
diff --git a/ap/app/Script/scripts/wan_ipv4.sh b/ap/app/Script/scripts/wan_ipv4.sh
index dcbb548..7aac6ff 100755
--- a/ap/app/Script/scripts/wan_ipv4.sh
+++ b/ap/app/Script/scripts/wan_ipv4.sh
@@ -119,13 +119,11 @@
pswan_secdns=`nv get $wan_if"_secdns"`
pswan_nm=`nv get $wan_if"_nm"`
-#xf.li@20240306 modify for [Bugfix][T106BUG-469]Fix the bug of probability datacall fail start
-# #ifconfig $wan_if down 2>>$test_log
-# ifconfig $wan_if $pswan_ip netmask 255.255.255.0 up 2>>$test_log
-# if [ $? -ne 0 ];then
-# echo "Error: ifconfig $wan_if $pswan_ip up failed." >> $test_log
-# fi
-#xf.li@20240306 modify for [Bugfix][T106BUG-469]Fix the bug of probability datacall fail end
+ #ifconfig $wan_if down 2>>$test_log
+ ifconfig $wan_if $pswan_ip netmask 255.255.255.0 up 2>>$test_log
+ if [ $? -ne 0 ];then
+ echo "Error: ifconfig $wan_if $pswan_ip up failed." >> $test_log
+ fi
pswan_pri=`nv get pswan_priority`
rt_num=`expr $pswan_pri \* 10 + $c_id`
diff --git a/ap/app/zte_comm/zte_mainctrl/netdev_proc.c b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
index 8ec3e52..15b3c0e 100755
--- a/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
+++ b/ap/app/zte_comm/zte_mainctrl/netdev_proc.c
@@ -1812,10 +1812,7 @@
//sprintf(cmd, "/sbin/wan_ipv4.sh \"linkup\" \"pswan\" \"%d\"", actinfo->c_id);
sprintf(cmd, "/sbin/wan_ipv4.sh linkup pswan %d", actinfo->c_id);
//zxic_system(cmd);
- //xf.li@20240314 modify for T106BUG-520 start
- //fpv4 = popen(cmd, "r");
- system_cmd_ex(cmd);
- //xf.li@20240314 modify for T106BUG-520 end
+ fpv4 = popen(cmd, "r");
}
if (actinfo->act_info.ip46flag == V6_VALID || actinfo->act_info.ip46flag == V46_VALID) {
@@ -1832,17 +1829,12 @@
//sprintf(cmd, "/sbin/wan_ipv6.sh \"linkup\" \"pswan\" \"%d\"", actinfo->c_id);
sprintf(cmd, "/sbin/wan_ipv6.sh linkup pswan %d", actinfo->c_id);
//zxic_system(cmd);
- //xf.li@20240314 modify for T106BUG-520 start
- //fpv6 = popen(cmd, "r");
- system_cmd_ex(cmd);
- //xf.li@20240314 modify for T106BUG-520 end
+ fpv6 = popen(cmd, "r");
}
- //xf.li@20240314 modify for T106BUG-520 start
- /*if(fpv4 != NULL)
+ if(fpv4 != NULL)
pclose(fpv4);
if(fpv6 != NULL)
- pclose(fpv6);*/
- //xf.li@20240314 modify for T106BUG-520 end
+ pclose(fpv6);
return 1;
}
@@ -2410,7 +2402,11 @@
defwan_change = 1;
//Êý¾ÝÏÈͨ£¬ºó×öÆäËûÅäÖã¬×¢Òâµã: ·À»ðǽ¶Ìʱ¼äÄÚ¿ÉÄÜδÉúЧ
+//xf.li@20240327 modify for T106BUG-578 start
+#ifndef USE_CAP_SUPPORT
if (defwan_change)
+#endif
+//xf.li@20240327 modify for T106BUG-578 end
system_cmd_ex("nat.sh");
defwan_set(defwan_if);
diff --git a/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/bin/zte_volte_main b/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/bin/zte_volte_main
index 472ca9b..a07030d 100755
--- a/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/bin/zte_volte_main
+++ b/ap/project/zx297520v3/prj_vehicle_dc_ref/fs/normal/rootfs/bin/zte_volte_main
Binary files differ
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-customer/adb-login/files/adb_shell b/cap/zx297520v3/sources/meta-zxic-custom/recipes-customer/adb-login/files/adb_shell
index fd7f4cb..e63fdfe 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-customer/adb-login/files/adb_shell
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-customer/adb-login/files/adb_shell
@@ -1,2 +1,6 @@
#!/bin/sh
-/bin/sh
+if [ $1 = '-c' ];then
+ /bin/sh -c "$2"
+else
+ /bin/sh
+fi
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-wifi/liblynq-qser-wifi.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-wifi/liblynq-qser-wifi.bb
index 82f7925..abda323 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-wifi/liblynq-qser-wifi.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-wifi/liblynq-qser-wifi.bb
@@ -5,7 +5,7 @@
#LICENSE = "Mobiletek""
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4f60c98fa94e02f659ef5939f67fa8ae"
-DEPENDS += "bootchart libupi-ab openssl libsctel"
+DEPENDS += "bootchart liblynq-log libupi-ab openssl libsctel"
#inherit workonsrc
WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-qser-wifi/"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
index d6ddaf1..41c5c97 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.cpp
@@ -24,12 +24,14 @@
{3, "qser_voice_call_answer"},
{4, "qser_voice_set_speech_volume"},
{5, "qser_voice_get_speech_volume"},
- {6, "qser_voice_set_dtmf"},
+ {6, "qser_voice_set_dtmf"},
+#ifdef ECALL_SUPPORT
+ {7, "qser_voice_set_test_num"},
+ {8, "qser_voice_fast_ecall"},
+#endif
{-1, NULL}
};
-
-
typedef uint32_t voice_client_handle_type;
@@ -50,6 +52,37 @@
int (*qser_voice_get_speech_volume)(int *volume);
int (*qser_voice_set_dtmf)(const char callnum);
+#ifdef ECALL_SUPPORT
+int (*qser_voice_set_test_num)(voice_client_handle_type* h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);
+int (*qser_voice_fast_ecall)(voice_client_handle_type* h_voice,
+ int *call_id,
+ E_QSER_VOICE_ECALL_CATEGORY_T cat,
+ E_QSER_VOICE_ECALL_VARIANT_T variant,
+ const char *addr,
+ int addr_length,
+ const unsigned char *msd_data,
+ int msd_length); //msd_length should <= QSER_MSD_MAX_LENGTH
+int (*qser_voice_set_msd)(int callid, const unsigned char *msd_data, int msd_length); //msd_length should <= QSER_MSD_MAX_LENGTH
+int (*qser_voice_add_ecall_indhandler)(voice_client_handle_type* h_voice,
+ QSER_ECall_IndHandlerFunc_t handlerPtr,
+ void* contextPtr);
+
+static void yk_voice_ecall_cb_func(int callid, E_QSER_VOICE_ECALL_INDICATION_T ind, void* contextPtr)
+{
+ unsigned char msd_data[QSER_MSD_MAX_LENGTH]={1,1,2,2,3,3,4,4};
+
+ printf("######### Call id=%d, event=%d! ######\n", callid, ind);
+
+ if(ind == E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE || ind == E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START)
+ {
+ /*customer should construct msd including GPS data, here use msd_data for illustrate,*/
+ qser_voice_set_msd(callid,msd_data,8);
+ }
+}
+
+#endif
+
+
void *dlHandle_call = NULL;
static void yk_voice_call_cb_func(int call_id,
@@ -62,6 +95,8 @@
printf("######### Call id=%d, PhoneNum:%s, event=%s! ######\n", call_id, phone_num, call_state[state]);
}
+
+
void print_help(void)
{
int i;
@@ -76,6 +111,8 @@
}
}
+
+
int main(int argc, char const *argv[])
{
int cmdIdx = 0;
@@ -164,6 +201,36 @@
printf("qser_voice_set_dtmf not defined or exported in %s\n", lynqLibPath_Call);
return -1;
}
+
+#ifdef ECALL_SUPPORT
+ qser_voice_fast_ecall = (int (*)(voice_client_handle_type*, int*, E_QSER_VOICE_ECALL_CATEGORY_T, E_QSER_VOICE_ECALL_VARIANT_T, const char*, int, const unsigned char*, int))dlsym(dlHandle_call,"qser_voice_fast_ecall");
+ if(qser_voice_fast_ecall == NULL)
+ {
+ printf("qser_voice_fast_ecall not defined or exported in %s\n", lynqLibPath_Call);
+ return -1;
+ }
+
+ qser_voice_set_test_num = (int (*)(voice_client_handle_type*, E_QSER_VOICE_ECALL_SET_TYPE_T, const char* , int))dlsym(dlHandle_call,"qser_voice_set_test_num");
+ if(qser_voice_set_test_num == NULL)
+ {
+ printf("qser_voice_set_test_num not defined or exported in %s\n", lynqLibPath_Call);
+ return -1;
+ }
+
+ qser_voice_set_msd = (int (*)(int , const unsigned char *, int))dlsym(dlHandle_call,"qser_voice_set_msd");
+ if(qser_voice_set_msd == NULL)
+ {
+ printf("qser_voice_set_msd not defined or exported in %s\n", lynqLibPath_Call);
+ return -1;
+ }
+
+ qser_voice_add_ecall_indhandler = (int (*)(voice_client_handle_type* h_voice, QSER_ECall_IndHandlerFunc_t, void*))dlsym(dlHandle_call,"qser_voice_add_ecall_indhandler");
+ if(qser_voice_add_ecall_indhandler == NULL)
+ {
+ printf("qser_voice_add_ecall_indhandler not defined or exported in %s\n", lynqLibPath_Call);
+ return -1;
+ }
+#endif
ret = qser_voice_call_client_init(&h_voice);
if(ret != 0 )
@@ -179,6 +246,14 @@
return -1;
}
+#ifdef ECALL_SUPPORT
+ ret = qser_voice_add_ecall_indhandler(&h_voice, yk_voice_ecall_cb_func, NULL);
+ if(ret != 0)
+ {
+ printf("qser_voice_add_ecall_indhandler FAIL\n");
+ return -1;
+ }
+#endif
print_help();
while(1)
@@ -270,7 +345,39 @@
}
break;
}
-
+#ifdef ECALL_SUPPORT
+ case 7:
+ {
+ char PhoneNum[32] = {0};
+ printf("please input test phone number: \n");
+ scanf("%s", PhoneNum);
+ ret = qser_voice_set_test_num(&h_voice, E_QSER_VOICE_ECALL_SET_NUMBER, PhoneNum, strlen(PhoneNum)+1);
+ printf("qser_voice_set_test_num ret = %d\n", ret);
+ break;
+ }
+ case 8:
+ {
+ int call_id = -1;
+ int cat;
+ int var;
+ int length;
+ unsigned char msd[QSER_MSD_MAX_LENGTH]={0};
+
+ printf("please input ecall cat: 0 manual, 1 auto\n");
+ scanf("%d", &cat);
+ printf("please input ecall type: 0 test, 1 emergency\n");
+ scanf("%d", &var);
+ printf("please input msd content length (max length is 140)\n");
+ scanf("%d", &length);
+ printf("please input %d unsigned char (0-255):\n", length);
+ for (int i = 0; i < length; i++) {
+ scanf("%hhu", &msd[i]);
+ }
+ ret = qser_voice_fast_ecall(&h_voice, &call_id, (E_QSER_VOICE_ECALL_CATEGORY_T) cat, (E_QSER_VOICE_ECALL_VARIANT_T) var, "null",5,msd,length);
+ printf("qser_voice_fast_ecall ret = %d, call id is %d\n", ret, call_id);
+ break;
+ }
+#endif
default:
print_help();
break;
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
index 79977b9..82bf388 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/files/lynq-qser-voice-demo.h
@@ -29,3 +29,69 @@
void *contextPtr
);
+
+#ifdef ECALL_SUPPORT
+
+#define QSER_MSD_MAX_LENGTH 140
+
+typedef enum{
+ E_QSER_VOICE_ECALL_SET_NUMBER = 0, /* Set Number */
+ E_QSER_VOICE_ECALL_SET_URI = 1, /* Set Uri */
+}E_QSER_VOICE_ECALL_SET_TYPE_T;
+
+typedef enum{
+ E_QSER_VOICE_ECALL_CAT_MANUAL = 0, /* Manual Emergency eCall */
+ E_QSER_VOICE_ECALL_CAT_AUTO = 1, /* Automatic Emergency eCall */
+}E_QSER_VOICE_ECALL_CATEGORY_T;
+
+
+typedef enum{
+ E_QSER_VOICE_ECALL_TEST = 0, /* Test eCall */
+ E_QSER_VOICE_ECALL_EMERGENCY = 1, /* Emergency eCall */
+ E_QSER_VOICE_ECALL_RECONFIG = 2, /* Reconfiguration eCall */
+}E_QSER_VOICE_ECALL_VARIANT_T;
+
+typedef enum{
+ E_QSER_VOICE_ECALL_IND_SENDING_START = 1,
+ E_QSER_VOICE_ECALL_IND_SENDING_MSD = 2,
+ E_QSER_VOICE_ECALL_IND_LLACK_RECEIVED = 3,
+ E_QSER_VOICE_ECALL_IND_ALACK_POSITIVE_RECEIVED = 4,
+ E_QSER_VOICE_ECALL_IND_ALACK_CLEARDOWN_RECEIVED = 5,
+ E_QSER_VOICE_ECALL_IND_DAILING = 9,
+ E_QSER_VOICE_ECALL_IND_ALERTING = 10,
+ E_QSER_VOICE_ECALL_IND_ACTIVE = 11,
+ E_QSER_VOICE_ECALL_IND_DISCONNECTED = 12,
+ E_QSER_VOICE_ECALL_IND_IMS_ACTIVE = 13,
+ E_QSER_VOICE_ECALL_IND_IMS_DISCONNECTED = 14,
+ E_QSER_VOICE_ECALL_IND_ABNORMAL_HANGUP=15,
+ E_QSER_VOICE_ECALL_IND_IMS_MSD_ACK = 20,
+ E_QSER_VOICE_ECALL_IND_IMS_UPDATE_MSD = 21,
+ E_QSER_VOICE_ECALL_IND_IMS_IN_BAND_TRANSFER = 22,
+ E_QSER_VOICE_ECALL_IND_IMS_MSD_NACK = 23,
+ E_QSER_VOICE_ECALL_IND_IMS_SRVCC = 24,
+ E_QSER_VOICE_ECALL_IND_ONLY_DEREGISTRATION = 31,
+ E_QSER_VOICE_ECALL_IND_MAY_DEREGISTER = 32,
+ E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START = 40,
+ E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_IMS_UPDATE_MSD = 41,
+ E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE=8000,
+ E_QSER_VOICE_ECALL_IND_T2_TIMER_OUT = 9000,
+ E_QSER_VOICE_ECALL_IND_T5_TIMER_OUT = 9001,
+ E_QSER_VOICE_ECALL_IND_T6_TIMER_OUT = 9002,
+ E_QSER_VOICE_ECALL_IND_T7_TIMER_OUT = 9003,
+ E_QSER_VOICE_ECALL_IND_REDIAL_TIMER_OUT = 9004,
+ E_QSER_VOICE_ECALL_IND_AUTO_ANS_TIMER_OUT = 9005,
+ E_QSER_VOICE_ECALL_IND_AUTO_ANS_IMS_TIMER_OUT = 9006,
+ E_QSER_VOICE_ECALL_IND_UNSPECIFIED = 0xffff,
+}E_QSER_VOICE_ECALL_INDICATION_T;
+
+typedef void (*QSER_ECall_IndHandlerFunc_t)
+(
+ int callid,
+ E_QSER_VOICE_ECALL_INDICATION_T ind,
+ void *contextPtr
+);
+
+
+
+#endif
+
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
old mode 100644
new mode 100755
index 1fb0142..480d42f
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-voice-demo/lynq-qser-voice-demo.bb
@@ -24,7 +24,7 @@
#INHIBIT_PACKAGE_STRIP = "1"
do_compile () {
- ${CXX} -Wall lynq-qser-voice-demo.cpp ${LOCAL_LIBS} ${LOCAL_C_INCLUDES} -o lynq-qser-voice-demo
+ ${CXX} -Wall lynq-qser-voice-demo.cpp ${LOCAL_LIBS} -DECALL_SUPPORT ${LOCAL_C_INCLUDES} -o lynq-qser-voice-demo
}
do_install() {
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
index b26121e..3e3e049 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-wifi-demo/files/lynq-wifi-demo.cpp
@@ -19,21 +19,44 @@
{
if (argc == 2 )
{
- if(strcmp(argv[1], "1") == 0){
+ if(strcmp(argv[1], "0") == 0){
+ qser_wifi_enable(); //enable wifi
+ qser_wifi_ap_stop(LYNQ_WIFI_AP_INDEX_AP0); //Disable ap mode for wlan0
+ qser_wifi_disable(); //Turn off WiFi
+ }
+ else if(strcmp(argv[1], "1") == 0){
char pw[65] = {0};
sprintf(pw, "lynq123456");
qser_wifi_enable(); //enable wifi
- qser_wifi_ap_ssid_set(0,"hello"); //Set the ssid of wlan0 to hello
- qser_wifi_ap_max_sta_set(0,22); //Example Set the maximum number of connections to 22
- qser_wifi_ap_channel_set(0,"CN",13); //Set the country code to CN and channel to 13
- qser_wifi_ap_mode_set(0,LYNQ_WIFI_MODE_80211BGN); //Set the working protocol mode of wlan0 to 80211BGN
- qser_wifi_ap_auth_set(0,LYNQ_WIFI_AUTH_WPA2_PSK,pw); //Set the authentication of wlan0 to wpa2 and the password to lynq123456
- qser_wifi_ap_start(0); //Set the ap mode of wlan0
+ qser_wifi_ap_ssid_set(LYNQ_WIFI_AP_INDEX_AP0,"hello"); //Set the ssid of wlan0 to hello
+ qser_wifi_ap_max_sta_set(LYNQ_WIFI_AP_INDEX_AP0,22); //Example Set the maximum number of connections to 22
+ qser_wifi_ap_channel_set(LYNQ_WIFI_AP_INDEX_AP0,"CN",13); //Set the country code to CN and channel to 13
+ qser_wifi_ap_mode_set(LYNQ_WIFI_AP_INDEX_AP0,LYNQ_WIFI_MODE_80211BGN); //Set the working protocol mode of wlan0 to 80211BGN
+ qser_wifi_ap_auth_set(LYNQ_WIFI_AP_INDEX_AP0,LYNQ_WIFI_AUTH_WPA2_PSK,pw); //Set the authentication of wlan0 to wpa2 and the password to lynq123456
+ qser_wifi_ap_start(LYNQ_WIFI_AP_INDEX_AP0); //Set the ap mode of wlan0
}
- else if(strcmp(argv[1], "0") == 0){
+ else if(strcmp(argv[1], "2") == 0){
+ char pw[65] = {0};
+ char ssid[33] = {0};
+ char country_code[12] = {0};
+ int channel, max_sta_num;
+ lynq_wifi_mode_type_e mode;
+ lynq_wifi_auth_e auth_mode;
+ lynq_wifi_bandwidth_type_e bandwidth;
+ int ret = -1;
qser_wifi_enable(); //enable wifi
- qser_wifi_ap_stop(0); //Disable ap mode for wlan0
- qser_wifi_disable(); //Turn off WiFi
+ ret = qser_wifi_ap_ssid_get(LYNQ_WIFI_AP_INDEX_AP0,ssid); //Gets the ssid of wlan0
+ printf("[lynq-wifi-demo] ssid=%s ret = %d\n",ssid, ret);
+ ret = qser_wifi_ap_max_sta_get(LYNQ_WIFI_AP_INDEX_AP0,&max_sta_num); //Gets the maximum sta number for wlan0
+ printf("[lynq-wifi-demo] max_sta_num = %d ret = %d\n",max_sta_num, ret);
+ ret = qser_wifi_ap_mode_get(LYNQ_WIFI_AP_INDEX_AP0,&mode); //Gets the working protocol mode for wlan0
+ printf("[lynq-wifi-demo] mode = %d ret = %d\n",mode, ret);
+ ret = qser_wifi_ap_auth_get(LYNQ_WIFI_AP_INDEX_AP0,&auth_mode,pw); //Get wlan0's password security authentication and password
+ printf("[lynq-wifi-demo] pw = %s auth_mode = %d ret = %d\n",pw, auth_mode, ret);
+ ret = qser_wifi_ap_channel_get(LYNQ_WIFI_AP_INDEX_AP0,country_code,&channel); //Get the country code and channel of wlan0
+ printf("[lynq-wifi-demo] country_code = %s channel = %d ret = %d\n",country_code, channel, ret);
+ ret = qser_wifi_ap_bandwidth_get(LYNQ_WIFI_AP_INDEX_AP0,&bandwidth); //Gets the bandwidth of wlan0
+ printf("[lynq-wifi-demo] bandwidth = %d ret = %d\n",bandwidth, ret);
}
else{
printf(" [lynq-wifi-demo]Parameter error, please re-enter\n");
@@ -41,7 +64,8 @@
}
else
{
- printf("[lynq-wifi-demo]Please enter parameter 0 or 1\n");
+ printf("[lynq-wifi-demo]Please enter one of the parameters 0,1,2\n");
+ printf(" [lynq-wifi-demo]2: View information such as ssid, password, and channel in ap mode\n");
printf(" [lynq-wifi-demo]1: initializes wifi and enables and sets ap mode\n");
printf(" [lynq-wifi-demo]0: indicates off.\n");
return 0;
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-app/adb/adb/adb_shell b/cap/zx297520v3/sources/meta-zxic/recipes-app/adb/adb/adb_shell
index fd7f4cb..e63fdfe 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-app/adb/adb/adb_shell
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-app/adb/adb/adb_shell
@@ -1,2 +1,6 @@
#!/bin/sh
-/bin/sh
+if [ $1 = '-c' ];then
+ /bin/sh -c "$2"
+else
+ /bin/sh
+fi
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
index 5dab391..749eb39 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-fota/lynq-qser-fota.cpp
@@ -152,14 +152,29 @@
fp =fopen(FOTA_REBOOT_FLAG,"w+");
if(fp == NULL)
{
- LYERRLOG("Creaf get upgrade status flag failed");
+ LYERRLOG("Creat get upgrade status flag failed");
return -1;
}
fwrite(&reboot_flg,sizeof(int),1,fp);
fclose(fp);
system("sync");
-
+
+ //fix T106BUG-585 start
+ total_size = 0;
+ upgrade_size = 0;
+
+ fp = fopen(FOTA_UPGRADE_PROCESS,"w+");
+ if(fp == NULL)
+ {
+ LYERRLOG("Error opening file");
+ return -1;
+ }
+
+ fprintf(fp, "%d,%d\n", total_size, upgrade_size);
+ fclose(fp);
+ //fix T106BUG-585 end
+
ret = lynq_fota_verify();
if(ret != 0)
{
@@ -263,6 +278,8 @@
upgrade_size = p_status->upgraded_size;
FILE *fp = NULL;
+
+
fp = fopen(FOTA_UPGRADE_PROCESS,"w");
if (fp == NULL)
{
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
index 1fb0e01..8de497a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/include/lynq-qser-voice.h
@@ -116,6 +116,83 @@
*/
+
+#ifdef ECALL_SUPPORT
+
+#define QSER_MSD_MAX_LENGTH 140
+
+typedef enum{
+ E_QSER_VOICE_ECALL_SET_NUMBER = 0, /* Set Number */
+ E_QSER_VOICE_ECALL_SET_URI = 1, /* Set Uri */
+}E_QSER_VOICE_ECALL_SET_TYPE_T;
+
+typedef enum{
+ E_QSER_VOICE_ECALL_CAT_MANUAL = 0, /* Manual Emergency eCall */
+ E_QSER_VOICE_ECALL_CAT_AUTO = 1, /* Automatic Emergency eCall */
+}E_QSER_VOICE_ECALL_CATEGORY_T;
+
+
+typedef enum{
+ E_QSER_VOICE_ECALL_TEST = 0, /* Test eCall */
+ E_QSER_VOICE_ECALL_EMERGENCY = 1, /* Emergency eCall */
+ E_QSER_VOICE_ECALL_RECONFIG = 2, /* Reconfiguration eCall */
+}E_QSER_VOICE_ECALL_VARIANT_T;
+
+typedef enum{
+ E_QSER_VOICE_ECALL_IND_SENDING_START = 1,
+ E_QSER_VOICE_ECALL_IND_SENDING_MSD = 2,
+ E_QSER_VOICE_ECALL_IND_LLACK_RECEIVED = 3,
+ E_QSER_VOICE_ECALL_IND_ALACK_POSITIVE_RECEIVED = 4,
+ E_QSER_VOICE_ECALL_IND_ALACK_CLEARDOWN_RECEIVED = 5,
+ E_QSER_VOICE_ECALL_IND_DAILING = 9,
+ E_QSER_VOICE_ECALL_IND_ALERTING = 10,
+ E_QSER_VOICE_ECALL_IND_ACTIVE = 11,
+ E_QSER_VOICE_ECALL_IND_DISCONNECTED = 12,
+ E_QSER_VOICE_ECALL_IND_IMS_ACTIVE = 13,
+ E_QSER_VOICE_ECALL_IND_IMS_DISCONNECTED = 14,
+ E_QSER_VOICE_ECALL_IND_ABNORMAL_HANGUP=15,
+ E_QSER_VOICE_ECALL_IND_IMS_MSD_ACK = 20,
+ E_QSER_VOICE_ECALL_IND_IMS_UPDATE_MSD = 21,
+ E_QSER_VOICE_ECALL_IND_IMS_IN_BAND_TRANSFER = 22,
+ E_QSER_VOICE_ECALL_IND_IMS_MSD_NACK = 23,
+ E_QSER_VOICE_ECALL_IND_IMS_SRVCC = 24,
+ E_QSER_VOICE_ECALL_IND_ONLY_DEREGISTRATION = 31,
+ E_QSER_VOICE_ECALL_IND_MAY_DEREGISTER = 32,
+ E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_START = 40,
+ E_QSER_VOICE_ECALL_IND_PSAP_CALLBACK_IMS_UPDATE_MSD = 41,
+ E_QSER_VOICE_ECALL_IND_SENDING_START_IN_VOICE=8000,
+ E_QSER_VOICE_ECALL_IND_T2_TIMER_OUT = 9000,
+ E_QSER_VOICE_ECALL_IND_T5_TIMER_OUT = 9001,
+ E_QSER_VOICE_ECALL_IND_T6_TIMER_OUT = 9002,
+ E_QSER_VOICE_ECALL_IND_T7_TIMER_OUT = 9003,
+ E_QSER_VOICE_ECALL_IND_REDIAL_TIMER_OUT = 9004,
+ E_QSER_VOICE_ECALL_IND_AUTO_ANS_TIMER_OUT = 9005,
+ E_QSER_VOICE_ECALL_IND_AUTO_ANS_IMS_TIMER_OUT = 9006,
+ E_QSER_VOICE_ECALL_IND_UNSPECIFIED = 0xffff,
+}E_QSER_VOICE_ECALL_INDICATION_T;
+
+typedef void (*QSER_ECall_IndHandlerFunc_t)
+(
+ int callid,
+ E_QSER_VOICE_ECALL_INDICATION_T ind,
+ void *contextPtr
+);
+
+int qser_voice_set_test_num(voice_client_handle_type* h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length);
+int qser_voice_fast_ecall(voice_client_handle_type* h_voice,
+ int *call_id,
+ E_QSER_VOICE_ECALL_CATEGORY_T cat,
+ E_QSER_VOICE_ECALL_VARIANT_T variant,
+ const char *addr,
+ int addr_length,
+ const unsigned char *msd_data,
+ int msd_length); //msd_length should <= QSER_MSD_MAX_LENGTH
+int qser_voice_set_msd( int callid, const unsigned char *msd_data, int msd_length); // msd_length should <= QSER_MSD_MAX_LENGTH
+int qser_voice_add_ecall_indhandler(voice_client_handle_type* h_voice,
+ QSER_ECall_IndHandlerFunc_t handlerPtr,
+ void* contextPtr);
+
+#endif
#ifdef __cplusplus
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
index d32a69e..7d68695 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/lynq-qser-voice.cpp
@@ -19,6 +19,11 @@
#define MIN_VOLUME 0
#define MAX_VOLUME 5
+#ifdef ECALL_SUPPORT
+static pthread_t s_lynq_ecall_tid = -1;
+static QSER_ECall_IndHandlerFunc_t s_ecall_cb = NULL;
+static int s_ecall_thread_status = 0;
+#endif
static pthread_t s_lynq_voice_tid = -1;
static QSER_VoiceCall_StateHandlerFunc_t s_voice_cb = NULL;
@@ -112,6 +117,24 @@
LYERRLOG("init first");
return RESULT_ERROR;
}
+
+
+#ifdef ECALL_SUPPORT
+ s_ecall_thread_status = 0;
+
+ if(s_lynq_ecall_tid!=-1)
+ {
+ int ret = pthread_cancel(s_lynq_ecall_tid);
+ LYINFLOG("pthread cancel waiting urc thread, ret = %d",ret);
+
+ ret = pthread_join(s_lynq_ecall_tid,NULL);
+ LYINFLOG("pthread join waiting urc thread ret = %d",ret);
+ s_lynq_ecall_tid =-1;
+ }
+
+ s_ecall_cb=NULL;
+#endif
+
return lynq_deinit_call();
}
@@ -235,5 +258,89 @@
}
+#ifdef ECALL_SUPPORT
+int qser_voice_fast_ecall(voice_client_handle_type* h_voice,
+ int *call_id,
+ E_QSER_VOICE_ECALL_CATEGORY_T cat,
+ E_QSER_VOICE_ECALL_VARIANT_T variant,
+ const char *addr,
+ int addr_length,
+ const unsigned char *msd_data,
+ int msd_length)
+{
+ if(h_voice == NULL || (*h_voice) == 0 )
+ {
+ LYERRLOG("%s input error", __func__);
+ return RESULT_ERROR;
+ }
+
+ return lynq_fast_ecall(call_id,(LYNQ_ECall_Category) cat,(LYNQ_ECall_Variant) variant,addr,addr_length,msd_data,msd_length);
+}
+
+int qser_voice_set_test_num(voice_client_handle_type* h_voice,E_QSER_VOICE_ECALL_SET_TYPE_T type, const char *test_num, int test_num_length)
+{
+ if(h_voice == NULL || (*h_voice) == 0 )
+ {
+ LYERRLOG("%s input error", __func__);
+ return RESULT_ERROR;
+ }
+
+ return lynq_set_test_num((LYNQ_ECall_Set_Type) type, test_num, test_num_length);
+}
+
+int qser_voice_set_msd(int callid, const unsigned char *msd_data, int msd_length)
+{
+ return lynq_set_msd(callid, msd_data, msd_length);
+}
+
+void *ecall_thread_recv(void *context)
+{
+ int handle = 0;
+ LYNQ_ECall_Indication eCall_Indication;
+ while (s_ecall_thread_status)
+ {
+ lynq_wait_ecall_indication(&handle, &eCall_Indication);
+ if(s_ecall_thread_status == 0)
+ {
+ return NULL;
+ }
+
+ if (s_ecall_cb != NULL)
+ {
+ s_ecall_cb(&handle,(E_QSER_VOICE_ECALL_INDICATION_T) eCall_Indication,context);
+ }
+ }
+ return NULL;
+}
+
+int qser_voice_add_ecall_indhandler(voice_client_handle_type* h_voice,
+ QSER_ECall_IndHandlerFunc_t handlerPtr,
+ void* contextPtr)
+{
+ if(h_voice == NULL || (*h_voice) == 0 || handlerPtr== NULL)
+ {
+ LYERRLOG("input error");
+ return RESULT_ERROR;
+ }
+ if (s_ecall_cb != NULL)
+ {
+ LYERRLOG("The existing state handle does not need to be added");
+ return RESULT_ERROR;
+ }
+ s_ecall_cb = handlerPtr;
+ s_ecall_thread_status = 1;
+ int rt = pthread_create(&s_lynq_ecall_tid, NULL, ecall_thread_recv, contextPtr);
+ if(rt < 0)
+ {
+ LYDBGLOG("qser_voice_call_addstatehandler pthread_create error!!!\n");
+ s_ecall_cb = NULL;
+ s_ecall_thread_status = 0;
+ s_lynq_ecall_tid = -1;
+ return RESULT_ERROR;
+ }
+ return RESULT_OK;
+}
+#endif
+
DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_CALL)
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
old mode 100644
new mode 100755
index b5b7d36..241cdec
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-voice/makefile
@@ -7,6 +7,7 @@
-flto \
-fPIC \
-fpermissive \
+ -DECALL_SUPPORT \
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
index 734d1b4..fa021c0 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/include/lynq-qser-wifi.h
@@ -15,6 +15,11 @@
extern "C" {
#endif
+typedef enum {
+ LYNQ_WIFI_AP_INDEX_AP0 = 0, /* Index 0 of AP/AP-STA/AP-AP Mode */
+ LYNQ_WIFI_AP_INDEX_AP1 /* Index 1 of AP/AP-STA/AP-AP Mode */
+} lynq_wifi_ap_index_e;
+
typedef enum
{
LYNQ_WIFI_MODE_MIN = -1,
@@ -51,15 +56,21 @@
int qser_wifi_enable(void);
int qser_wifi_disable(void);
-int qser_wifi_ap_ssid_set(int idx, const char *ssid);
-int qser_wifi_ap_mode_set(int idx, lynq_wifi_mode_type_e mode);
-int qser_wifi_ap_bandwidth_set(int idx, lynq_wifi_bandwidth_type_e bandwidth);
-int qser_wifi_ap_channel_set(int idx, const char *country_code, int channel);
-int qser_wifi_ap_auth_set(int idx, lynq_wifi_auth_e auth_mode, const char * auth_passwd);
-int qser_wifi_ap_max_sta_set(int idx, int max_sta_num);
-int qser_wifi_ap_start(int idx);
-int qser_wifi_ap_stop(int idx);
-int qser_wifi_ap_restart(int idx);
+int qser_wifi_ap_ssid_set(lynq_wifi_ap_index_e idx, const char *ssid);
+int qser_wifi_ap_ssid_get(lynq_wifi_ap_index_e idx, char *ssid);
+int qser_wifi_ap_mode_set(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e mode);
+int qser_wifi_ap_mode_get(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e *mode);
+int qser_wifi_ap_bandwidth_set(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e bandwidth);
+int qser_wifi_ap_bandwidth_get(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e *bandwidth);
+int qser_wifi_ap_channel_set(lynq_wifi_ap_index_e idx, const char *country_code, int channel);
+int qser_wifi_ap_channel_get(lynq_wifi_ap_index_e idx, char *country_code, int *channel);
+int qser_wifi_ap_auth_set(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e auth_mode, const char * auth_passwd);
+int qser_wifi_ap_auth_get(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e *auth_mode, char * auth_passwd);
+int qser_wifi_ap_max_sta_set(lynq_wifi_ap_index_e idx, int max_sta_num);
+int qser_wifi_ap_max_sta_get(lynq_wifi_ap_index_e idx, int *max_sta_num);
+int qser_wifi_ap_start(lynq_wifi_ap_index_e idx);
+int qser_wifi_ap_stop(lynq_wifi_ap_index_e idx);
+int qser_wifi_ap_restart(lynq_wifi_ap_index_e idx);
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
index c14ce3a..91f1112 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/lynq-qser-wifi.cpp
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-
+#include "liblog/lynq_deflog.h"
#ifdef __cplusplus
extern "C" {
@@ -20,12 +20,22 @@
*********************************************************************/
int qser_wifi_enable(void)
{
- int ret = sc_wifi_init();
+ int ret = -1;
+ ret = sc_wifi_init();
if (0 != ret)
{
- return -1;
+ LYERRLOG("[%s ] init : %d ret = %d\n", __func__,ret);
+ return ret;
}
- return sc_wifi_enable();
+
+ ret = sc_wifi_enable();
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] enable : %d ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ]\n", __func__);
+ return 0;
}
/********************************************************************
@@ -37,12 +47,22 @@
*********************************************************************/
int qser_wifi_disable(void)
{
- int ret = sc_wifi_disable();
+ int ret = -1;
+ ret = sc_wifi_disable();
if (0 != ret)
{
- return -1;
+ LYERRLOG("[%s ] disable : %d ret = %d\n", __func__,ret);
+ return ret;
}
- return sc_wifi_uninit();
+
+ ret = sc_wifi_uninit();
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] uninit: %d ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ]\n", __func__);
+ return 0;
}
/********************************************************************
@@ -54,9 +74,46 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_ssid_set(int idx, const char *ssid)
+int qser_wifi_ap_ssid_set(lynq_wifi_ap_index_e idx, const char *ssid)
{
- return sc_wifi_ap_ssid_set((sc_wifi_ap_index_e)idx, ssid);
+ int ret = -1;
+ if (ssid == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer ssid = 0x%p \n", __func__, ssid);
+ return ret;
+ }
+ ret = sc_wifi_ap_ssid_set((sc_wifi_ap_index_e)idx, ssid);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d ssid = %s \n", __func__, idx, ssid);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_ssid_get, Get the name of the ssid of wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param ssid [OUT]: char *, Get the ssid name
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_ssid_get(lynq_wifi_ap_index_e idx, char *ssid)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d ssid = %s \n", __func__, idx, param.ssid);
+ strncpy(ssid, param.ssid, sizeof(param.ssid) - 1);
+ return 0;
}
/********************************************************************
@@ -68,8 +125,9 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_mode_set(int idx, lynq_wifi_mode_type_e mode)
+int qser_wifi_ap_mode_set(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e mode)
{
+ int ret = -1;
sc_wifi_ap_mode_type_e type;
switch(mode)
{
@@ -83,7 +141,56 @@
type = SC_WIFI_AP_MODE_MIN;
break;
}
- return sc_wifi_ap_mode_set((sc_wifi_ap_index_e)idx, type);
+ ret = sc_wifi_ap_mode_set((sc_wifi_ap_index_e)idx, type);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d mode = %d \n", __func__, idx, mode);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_mode_get, Get the working protocol mode of wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param mode [OUT]: lynq_wifi_mode_type_e *, Get the working protocol mode
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_mode_get(lynq_wifi_ap_index_e idx, lynq_wifi_mode_type_e *mode)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ if (mode == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer mode = 0x%p \n", __func__, mode);
+ return ret;
+ }
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d mode = %d \n", __func__, idx, param.mode);
+ lynq_wifi_mode_type_e type;
+ switch(param.mode)
+ {
+ case SC_WIFI_AP_MODE_80211BGN:
+ type = LYNQ_WIFI_MODE_80211BGN;
+ break;
+ case SC_WIFI_AP_MODE_80211BGNAX_2G:
+ type = LYNQ_WIFI_MODE_80211BGNAX_2G;
+ break;
+ default:
+ type = LYNQ_WIFI_MODE_MIN;
+ break;
+ }
+ *mode = type;
+ return 0;
}
/********************************************************************
@@ -95,9 +202,46 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_bandwidth_set(int idx, lynq_wifi_bandwidth_type_e bandwidth)
+int qser_wifi_ap_bandwidth_set(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e bandwidth)
{
- return sc_wifi_ap_bandwidth_set((sc_wifi_ap_index_e)idx, (sc_wifi_bandwidth_e)bandwidth);
+ int ret = -1;
+ ret = sc_wifi_ap_bandwidth_set((sc_wifi_ap_index_e)idx, (sc_wifi_bandwidth_e)bandwidth);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d bandwidth = %d \n", __func__, idx, bandwidth);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_bandwidth_get, Get the bandwidth of wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param bandwidth [OUT]: lynq_wifi_bandwidth_type_e *, Get the bandwidth
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_bandwidth_get(lynq_wifi_ap_index_e idx, lynq_wifi_bandwidth_type_e *bandwidth)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ if (bandwidth == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer bandwidth = 0x%p \n", __func__, bandwidth);
+ return ret;
+ }
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d bandwidth = %d \n", __func__, idx, param.bandwidth);
+ *bandwidth = (lynq_wifi_bandwidth_type_e)param.bandwidth;
+ return 0;
}
/********************************************************************
@@ -110,9 +254,53 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_channel_set(int idx, const char *country_code, int channel)
+int qser_wifi_ap_channel_set(lynq_wifi_ap_index_e idx, const char *country_code, int channel)
{
- return sc_wifi_ap_cc_ch_set((sc_wifi_ap_index_e)idx, country_code, channel);
+ int ret = -1;
+ if (country_code == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer country_code = 0x%p \n", __func__, country_code);
+ return ret;
+ }
+ ret = sc_wifi_ap_cc_ch_set((sc_wifi_ap_index_e)idx, country_code, channel);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d country_code = %s channel = %d\n", __func__, idx, country_code, channel);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_channel_get, Get the channel for wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param country_code [OUT]: char *, Get country code
+* @param channel [OUT]: int *, Get the channel
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_channel_get(lynq_wifi_ap_index_e idx, char *country_code, int *channel)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ if (country_code == NULL || channel == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer country_code = 0x%p channel = 0x%p\n", __func__, country_code, channel);
+ return ret;
+ }
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d country_code = %s channel = %d\n", __func__, idx, param.countrycode, param.channel);
+ strncpy(country_code, param.countrycode, sizeof(param.countrycode) - 1);
+ *channel = param.channel;
+ return 0;
}
/********************************************************************
@@ -125,9 +313,15 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_auth_set(int idx, lynq_wifi_auth_e auth_mode, const char *auth_passwd)
+int qser_wifi_ap_auth_set(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e auth_mode, const char *auth_passwd)
{
+ int ret = -1;
sc_wifi_auth_e type;
+ if (auth_passwd == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer auth_passwd = 0x%p\n", __func__, auth_passwd);
+ return ret;
+ }
switch (auth_mode)
{
case LYNQ_WIFI_AUTH_OPEN:
@@ -152,7 +346,67 @@
sc_wifi_ap_auth_t auth;
auth.auth = (sc_wifi_auth_e)type;
strncpy(auth.passwd, auth_passwd, sizeof(auth.passwd) - 1);
- return sc_wifi_ap_auth_set((sc_wifi_ap_index_e)idx, &auth);
+ ret = sc_wifi_ap_auth_set((sc_wifi_ap_index_e)idx, &auth);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d auth_mode = %d auth_passwd = %s\n", __func__, idx, auth_mode, auth_passwd);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_auth_get, Get the security authentication mode and password of wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param auth_mode [OUT]: lynq_wifi_auth_e *, Get the security authentication mode
+* @param auth_passwd [OUT]: char *, Get password
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_auth_get(lynq_wifi_ap_index_e idx, lynq_wifi_auth_e *auth_mode, char *auth_passwd)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ if (auth_mode == NULL || auth_passwd == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer auth_mode = 0x%p auth_passwd = 0x%p\n", __func__, auth_mode, auth_passwd);
+ return ret;
+ }
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d auth_mode = %d auth_passwd = %s \n", __func__, idx, param.auth.auth, param.auth.passwd);
+ strncpy(auth_passwd, param.auth.passwd, sizeof(param.auth.passwd) - 1);
+ lynq_wifi_auth_e type;
+ switch (param.auth.auth)
+ {
+ case SC_WIFI_AUTH_OPEN:
+ type = LYNQ_WIFI_AUTH_OPEN;
+ break;
+ case SC_WIFI_AUTH_WPA2_PSK:
+ type = LYNQ_WIFI_AUTH_WPA2_PSK;
+ break;
+ case SC_WIFI_AUTH_WPA_WPA2_PSK_BOTH:
+ type = LYNQ_WIFI_AUTH_WPA_WPA2_PSK_BOTH;
+ break;
+ case SC_WIFI_AUTH_WPA3_PSK:
+ type = LYNQ_WIFI_AUTH_WPA3_PSK;
+ break;
+ case SC_WIFI_AUTH_WPA2_WPA3_PSK_BOTH:
+ type = LYNQ_WIFI_AUTH_WPA2_WPA3_PSK_BOTH;
+ break;
+ default:
+ type = LYNQ_WIFI_AUTH_MIN;
+ break;
+ }
+ *auth_mode = type;
+ return 0;
}
/********************************************************************
@@ -164,9 +418,46 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_max_sta_set(int idx, int max_sta_num)
+int qser_wifi_ap_max_sta_set(lynq_wifi_ap_index_e idx, int max_sta_num)
{
- return sc_wifi_ap_max_sta_num_set((sc_wifi_ap_index_e)idx, max_sta_num);
+ int ret = -1;
+ ret = sc_wifi_ap_max_sta_num_set((sc_wifi_ap_index_e)idx, max_sta_num);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d max_sta_num = %d \n", __func__, idx, max_sta_num);
+ return 0;
+}
+
+/********************************************************************
+* @brief: qser_wifi_ap_max_sta_get, Get the maximum number of STAs for wlan0 or wlan1
+* @param idx [IN]: int, Set wlan0 or wlan1
+* @param max_sta_num [OUT]: int *, Get the maximum number
+* @return : int, If equal to 0 succeeds, others fail
+* @todo: NA
+* @see: NA
+* @warning: NA
+*********************************************************************/
+int qser_wifi_ap_max_sta_get(lynq_wifi_ap_index_e idx, int *max_sta_num)
+{
+ int ret = -1;
+ sc_wifi_ap_param_t param = {0};
+ if (max_sta_num == NULL)
+ {
+ LYERRLOG("[%s ] Null pointer max_sta_num = 0x%p\n", __func__,max_sta_num);
+ return ret;
+ }
+ ret = sc_wifi_ap_param_get((sc_wifi_ap_index_e)idx, ¶m);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d max_sta_num = %d \n", __func__, idx, param.max_sta_num);
+ *max_sta_num = param.max_sta_num;
+ return 0;
}
/********************************************************************
@@ -177,9 +468,17 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_start(int idx)
+int qser_wifi_ap_start(lynq_wifi_ap_index_e idx)
{
- return sc_wifi_ap_start((sc_wifi_ap_index_e)idx);
+ int ret = -1;
+ ret = sc_wifi_ap_start((sc_wifi_ap_index_e)idx);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d \n", __func__, idx);
+ return 0;
}
/********************************************************************
@@ -190,9 +489,17 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_stop(int idx)
+int qser_wifi_ap_stop(lynq_wifi_ap_index_e idx)
{
- return sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
+ int ret = -1;
+ ret = sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d \n", __func__, idx);
+ return 0;
}
/********************************************************************
@@ -203,17 +510,26 @@
* @see: NA
* @warning: NA
*********************************************************************/
-int qser_wifi_ap_restart(int idx)
+int qser_wifi_ap_restart(lynq_wifi_ap_index_e idx)
{
- int ret = sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
+ int ret = -1;
+ ret = sc_wifi_ap_stop((sc_wifi_ap_index_e)idx);
if (0 != ret)
{
- return -1;
+ LYERRLOG("[%s ] stop: %d ret = %d\n", __func__,ret);
+ return ret;
}
- return sc_wifi_ap_start((sc_wifi_ap_index_e)idx);
+ ret = sc_wifi_ap_start((sc_wifi_ap_index_e)idx);
+ if (0 != ret)
+ {
+ LYERRLOG("[%s ] start: %d ret = %d\n", __func__,ret);
+ return ret;
+ }
+ LYINFLOG("[%s ] idx = %d \n", __func__, idx);
+ return 0;
}
-//DEFINE_LYNQ_LIB_LOG(LYNQ_WIFI)
+DEFINE_LYNQ_LIB_LOG(LYNQ_WIFI)
#ifdef __cplusplus
}
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/makefile
index 5d2fc23..6707cdd 100644
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-wifi/makefile
@@ -13,11 +13,14 @@
-I. \
-I$(LOCAL_PATH)/include \
-I$(LOCAL_PATH)/ \
+ -I$(ROOT)$(includedir)/logger \
+ -I$(ROOT)$(includedir)/liblog \
LOCAL_LIBS := \
-L. \
-ldl \
-lstdc++ \
+ -llynq-log \
-lsctel \
SOURCES = lynq-qser-wifi.cpp
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-pinctrl.dtsi b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-pinctrl.dtsi
index 5a5eb0a..db91206 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-pinctrl.dtsi
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-pinctrl.dtsi
@@ -23,8 +23,19 @@
bias-pull-up;
// input-schmitt-disable;
};
+//xf.li@20240327 modify for T106BUG-567 start
+ rmii_active: rmii_active {
+ pins ="RMII_TXEN", "RMII_RXEN", "RMII_RXD0", "RMII_RXD1", "RMII_TXD0", "RMII_TXD1";
+ function = "RMII";
+ bias-disabled;
+ };
-
+ rmii_sleep: rmii_sleep {
+ pins = "RMII_TXEN", "RMII_RXEN", "RMII_RXD0", "RMII_RXD1", "RMII_TXD0", "RMII_TXD1";
+ function = "BGPIO";
+ bias-pull-down;
+ input-enable;
+ };
i2c0_active: i2c0_active {
pins = "I2C0_SCL", "I2C0_SDA";
@@ -36,8 +47,8 @@
i2c0_sleep: i2c0_sleep {
pins = "I2C0_SCL", "I2C0_SDA";
function = "BGPIO";
-
- bias-disabled;
+ input-enable;
+ bias-pull-down;
};
i2c1_active: i2c1_active {
@@ -50,10 +61,10 @@
i2c1_sleep: i2c1_sleep {
pins = "I2C1_SCL", "I2C1_SDA";
function = "BGPIO";
-
- bias-disabled;
+ input-enable;
+ bias-pull-down;
};
-
+//xf.li@20240327 modify for T106BUG-567 end
sd1_gpio: sd1_gpio {
pins = "SD1_CMD", "SD1_D0";
function = "BGPIO";
@@ -166,9 +177,12 @@
pins = "UART0_RXD", "UART0_TXD";
function = "UART0";
};
+//xf.li@20240327 modify for T106BUG-567 start
uart0_sleep: uart0_sleep {
pins = "UART0_RXD", "UART0_TXD";
function = "BGPIO";
+ input-enable;
+ bias-pull-down;
};
uart1_active: uart1_active {
pins = "UART1_RXD", "UART1_TXD";
@@ -185,13 +199,15 @@
uart2_sleep: uart2_sleep {
pins = "EXT_INT10", "EXT_INT11";
function = "BGPIO";
+ input-enable;
+ bias-pull-down;
};
-
+//xf.li@20240327 modify for T106BUG-567 end
codec_reset_pins:codec_reset_pins {
pins = "EXT_INT10", "EXT_INT11";
function = "BGPIO";
};
-
+//xf.li@20240327 modify for T106BUG-567 start
ssp0_active:ssp0_active {
pins = "SSP0_CLK","SSP0_RXD","SSP0_TXD";
function = "SSP0";
@@ -200,9 +216,16 @@
pins = "SSP0_CLK","SSP0_RXD","SSP0_TXD";
function = "BGPIO";
};
- ssp0_cs_gpio:ssp0_cs_gpio {
+ ssp0_cs_gpio_active:ssp0_cs_gpio_active {
pins = "SSP0_CS";
function = "BGPIO";
+ bias-pull-up;
+ };
+ ssp0_cs_gpio_sleep:ssp0_cs_gpio_sleep {
+ pins = "SSP0_CS";
+ function = "BGPIO";
+ bias-pull-down;
+ input-enable;
};
ssp0_cs_func:ssp0_cs_func {
pins = "SSP0_CS";
@@ -217,15 +240,22 @@
pins = "CAM_SPI_CLK","CAM_SPI_D0","CAM_SPI_D1";
function = "BGPIO";
};
- ssp1_cs_gpio:ssp1_cs_gpio {
+ ssp1_cs_gpio_active:ssp1_cs_gpio_active {
pins = "CAM_SPI_CS";
function = "BGPIO";
+ bias-pull-up;
+ };
+ ssp1_cs_gpio_sleep:ssp1_cs_gpio_sleep {
+ pins = "CAM_SPI_CS";
+ function = "BGPIO";
+ bias-pull-down;
+ input-enable;
};
ssp1_cs_func:ssp1_cs_func {
pins = "CAM_SPI_CS";
function = "CAM_SPI";
};
-
+//xf.li@20240327 modify for T106BUG-567 end
spidev0_ex_gpio_pins:gpio129 {
pins = "GPIO129";
function = "BGPIO";
@@ -251,17 +281,19 @@
input-schmitt-disable;
};
-
+//xf.li@20240327 modify for T106BUG-567 start
i2s0_sleep: i2s0_sleep {
pins = "I2S0_WS","I2S0_CLK","I2S0_DIN","I2S0_DOUT";
function = "BGPIO";
- bias-disable;
+ input-enable;
+ bias-pull-down;
};
i2s1_sleep: i2s1_sleep {
pins = "I2S1_WS","I2S1_CLK","I2S1_DIN","I2S1_DOUT";
function = "BGPIO";
- bias-disable;
+ input-enable;
+ bias-pull-down;
};
tdm_pins: tdm_pins {
pins = "I2S0_WS","I2S0_CLK","I2S0_DIN","I2S0_DOUT";
@@ -274,9 +306,10 @@
tdm_sleep: tdm_sleep {
pins = "I2S0_WS","I2S0_CLK","I2S0_DIN","I2S0_DOUT";
function = "BGPIO";
- bias-disable;
+ input-enable;
+ bias-pull-down;
};
-
+//xf.li@20240327 modify for T106BUG-567 end
clk0_func_pins: clk0_func_pins
{
pins = "CLK_OUT0";
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
index ef16a4e..4aa7dd9 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3-vehicle_dc_ref.dts
@@ -164,9 +164,10 @@
&gmac {
port-nums = <1>;
rmii-ports = <1>;
- pinctrl-names = "state0";
- pinctrl-0 = <&rmii_clki_pins>;
-
+//xf.li@20240327 modify for T106BUG-567 start
+ //pinctrl-names = "state0";
+ //pinctrl-0 = <&rmii_clki_pins>;
+//xf.li@20240327 modify for T106BUG-567 end
gpios = <&bgpio 83 GPIO_ACTIVE_HIGH>,
<&bgpio 63 GPIO_ACTIVE_HIGH>;
status = "okay";
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
index 6c69adc..c52f699 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/arch/arm/boot/dts/zx297520v3.dtsi
@@ -527,7 +527,11 @@
interrupts = <GIC_SPI GMAC_INT IRQ_TYPE_LEVEL_HIGH>;
phy-mode = "rmii";
port-mask = <0x00000000>;
-
+//xf.li@20240327 modify for T106BUG-567 start
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&rmii_active>;
+ pinctrl-1 = <&rmii_sleep>;
+//xf.li@20240327 modify for T106BUG-567 end
status = "disabled";
};
@@ -626,11 +630,12 @@
clock-frequency = <52000000>;
clocks = <&clkc SSP0_WCLK>, <&clkc SSP0_PCLK>;
clock-names = "work_clk", "apb_clk";
- pinctrl-names = "default","sleep","cs_gpio","cs_func";
+ pinctrl-names = "default","sleep","cs_gpio_active","cs_func","cs_gpio_sleep";
pinctrl-0 = <&ssp0_active>;
pinctrl-1 = <&ssp0_sleep>;
- pinctrl-2 = <&ssp0_cs_gpio>;
+ pinctrl-2 = <&ssp0_cs_gpio_active>;
pinctrl-3 = <&ssp0_cs_func>;
+ pinctrl-4 = <&ssp0_cs_gpio_sleep>;
gpios = <&bgpio 25 GPIO_ACTIVE_HIGH>,
<&bgpio 26 GPIO_ACTIVE_HIGH>,/*clk*/
<&bgpio 28 GPIO_ACTIVE_HIGH>,/*tx*/
@@ -676,11 +681,12 @@
clock-frequency = <52000000>;
clocks = <&clkc SSP1_WCLK>, <&clkc SSP1_PCLK>;
clock-names = "work_clk", "apb_clk";
- pinctrl-names = "default","sleep","cs_gpio","cs_func";
+ pinctrl-names = "default","sleep","cs_gpio_active","cs_func","cs_gpio_sleep";
pinctrl-0 = <&ssp1_active>;
pinctrl-1 = <&ssp1_sleep>;
- pinctrl-2 = <&ssp1_cs_gpio>;
+ pinctrl-2 = <&ssp1_cs_gpio_active>;
pinctrl-3 = <&ssp1_cs_func>;
+ pinctrl-4 = <&ssp1_cs_gpio_sleep>;
gpios = <&bgpio 87 GPIO_ACTIVE_LOW>,
<&bgpio 88 GPIO_ACTIVE_LOW>,/*clk*/
<&bgpio 90 GPIO_ACTIVE_LOW>,/*tx*/
@@ -850,8 +856,15 @@
};
zx29_es8311: zx29_es8311{
compatible = "zxic,zx29_es8311";
- pinctrl-names = "top_i2s";
+//xf.li@20240327 modify for T106BUG-567 start
+ pinctrl-names = "top_i2s0","top_i2s1","top_tdm","topi2s0_sleep","topi2s1_sleep","toptdm_sleep";
pinctrl-0 = <&i2s0_pins>;
+ pinctrl-1 = <&i2s1_pins>;
+ pinctrl-2 = <&tdm_pins>;
+ pinctrl-3 = <&i2s0_sleep>;
+ pinctrl-4 = <&i2s1_sleep>;
+ pinctrl-5 = <&tdm_sleep>;
+//xf.li@20240327 modify for T106BUG-567 end
reg = <0x0 0x00140000 0x0 0x00001000>;
reg-names = "soc_sys";
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/i2c/busses/i2c-zx29.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/i2c/busses/i2c-zx29.c
index b8fce94..2d52e80 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/i2c/busses/i2c-zx29.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/i2c/busses/i2c-zx29.c
@@ -1897,21 +1897,37 @@
}
-
+//xf.li@20240327 modify for T106BUG-567 start
#ifdef CONFIG_PM
static int zx29_i2c_suspend(struct platform_device *pdev, pm_message_t state)
{
-// pinctrl_pm_select_sleep_state(&pdev->dev);
+ printk("LYNQ: in zx29_i2c_suspend");
+ if(pdev == NULL)
+ return -1;
+ if(pdev && &pdev->dev)
+ {
+ printk("LYNQ: select sleep state");
+ pinctrl_pm_select_sleep_state(&pdev->dev);
+ }
+
return 0;
};
static int zx29_i2c_resume(struct platform_device *pdev)
{
-// pinctrl_pm_select_default_state(&pdev->dev);
+ printk("LYNQ: in zx29_i2c_resume");
+ if(pdev == NULL)
+ return -1;
+ if(pdev && &pdev->dev)
+ {
+ printk("LYNQ: select default state");
+ pinctrl_pm_select_default_state(&pdev->dev);
+ }
+
return 0;
};
#endif
-
+//xf.li@20240327 modify for T106BUG-567 end
static const struct of_device_id zx29_i2c_match[] = {
{.compatible = "zte,zx29_i2c"},
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
index fd87356..c46406d 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/net/ethernet/zte/zx29_gmac.c
@@ -24,7 +24,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
-#include <linux/device.h>
+#include <linux/device.h>
#include "zx29_gmac.h"
#define gmac_printk(_format, _args...) do{printk(KERN_INFO"gmac," _format "\n",##_args);}while(0)
@@ -491,18 +491,33 @@
struct mdio_device *mdio_dev = NULL;
int ret = 0;
- if (priv->nports == 1) {
- p = phy_find_first(priv->mii.bus);
- } else if (priv->rmii_port < PHY_MAX_ADDR) {
- mdio_dev = priv->mii.bus->mdio_map[priv->rmii_port];
- p = container_of(mdio_dev, struct phy_device, mdio);
- }
-
-
- if (!p) {
- printk("%s: no PHY found\n", dev->name);
- return -ENODEV;
- }
+ //zw.wang Without phy, gmac's gpio output power is removed on 20240328 start
+ int i = 0;
+ for(i = 0;i <= 5;i++)
+ {
+ if (priv->nports == 1) {
+ p = phy_find_first(priv->mii.bus);
+ } else if (priv->rmii_port < PHY_MAX_ADDR) {
+ mdio_dev = priv->mii.bus->mdio_map[priv->rmii_port];
+ p = container_of(mdio_dev, struct phy_device, mdio);
+ }
+
+ if (!p) {
+ if(i == 5){
+ gpio_direction_output(priv->gpio_power[0], 0);
+#ifdef CONFIG_MDIO_C45
+ gpio_direction_output(priv->gpio_power[1], 0);
+#endif
+ }
+ else
+ continue;
+ printk("%s: no PHY found\n", dev->name);
+ return -ENODEV;
+ }
+ else
+ break;
+ }
+ //zw.wang Without phy, gmac's gpio output power is removed on 20240328 end
ret = phy_connect_direct(dev, p, zx29_gmac_adjust_link, PHY_INTERFACE_MODE_RMII); /* phy_start_machine */
/* supported and advertising */
@@ -897,7 +912,7 @@
gmac = (unsigned *)ndev->base_addr;
enum of_gpio_flags flags;
- unsigned long flag;
+ unsigned long flag;
int gpio = 0;
int ret = 0;
@@ -905,7 +920,7 @@
if (ndev && !priv->stopped) {
if (netif_running(ndev)) {
- spin_lock_irqsave(&priv->lock, flag);
+ spin_lock_irqsave(&priv->lock, flag);
netif_stop_queue(ndev);
netif_carrier_off(ndev);
priv->stopped = 1;
@@ -918,12 +933,12 @@
gpio_direction_output(priv->gpio_power[0], 0);
gmac_stop((void*)ndev->base_addr);
- spin_unlock_irqrestore(&priv->lock, flag);
+ spin_unlock_irqrestore(&priv->lock, flag);
// netif_device_detach(ndev);
}
- pm_relax(&pdev->dev);
- // printk("[%s] sleep\n");
+ pm_relax(&pdev->dev);
+ // printk("[%s] sleep\n");
}
#endif
//printk("[%s] exit\n", __func__);
@@ -951,7 +966,7 @@
pm_stay_awake(&pdev->dev);
if( netif_running(ndev)) {
printk("[%s] enter\n", __func__);
- spin_lock_irqsave(&priv->lock, flag);
+ spin_lock_irqsave(&priv->lock, flag);
gpio_direction_output(priv->gpio_power[0], 1);
base = base_clk;
@@ -960,8 +975,8 @@
base = base_phy_release;
gmac_phy_release();
- mdelay(500); //icplus ping need
-
+ mdelay(500); //icplus ping need
+
priv->phydev->drv->config_init(priv->phydev);
gmac_hw_init(ndev);
@@ -972,7 +987,7 @@
hrtimer_start(priv->timer, ktime_set(0, GTIMER_INTERVAL * 1000), HRTIMER_MODE_REL);
#endif
priv->stopped = 0;
- spin_unlock_irqrestore(&priv->lock, flag);
+ spin_unlock_irqrestore(&priv->lock, flag);
printk("[%s] enter\n", __func__);
// netif_device_attach(ndev);
}
@@ -1153,6 +1168,9 @@
#endif
}
}
+//xf.li@20240327 modify for T106BUG-567 start
+ pinctrl_pm_select_sleep_state(&pdev->dev);
+//xf.li@20240327 modify for T106BUG-567 end
return 0;
}
@@ -1167,6 +1185,9 @@
gmac = (unsigned *)ndev->base_addr;
unsigned long flag = 0;
+//xf.li@20240327 modify for T106BUG-567 start
+ pinctrl_pm_select_default_state(&pdev->dev);
+//xf.li@20240327 modify for T106BUG-567 end
if(ndev) {
if(netif_running(ndev)) {
// gmac_start((void*)ndev->base_addr);
@@ -1225,60 +1246,60 @@
.ndo_set_mac_address = zx29_gmac_set_mac_address,
};
-
-
-ssize_t show_fun(struct device *dev, struct device_attribute *attr, char *buf)
-{
+
+
+ssize_t show_fun(struct device *dev, struct device_attribute *attr, char *buf)
+{
struct platform_device *pdev = to_platform_device(dev);
struct net_device *ndev = platform_get_drvdata(pdev);
- int status = 0;
- volatile unsigned *gmac = (unsigned *)ndev->base_addr;
- struct zx29_gmac_dev *priv = (struct zx29_gmac_dev *)netdev_priv(ndev);
- printk("MAC(1000) :0x%x\n", MAC(0x1000));
- printk("MAC(1004) :0x%x\n", MAC(0x1004));
- printk("MAC(1008) :0x%x\n", MAC(0x1008));
- printk("MAC(100c) :0x%x\n", MAC(0x100c));
- printk("MAC(1010) :0x%x\n", MAC(0x1010));
- printk("MAC(1014) int status:0x%x\n", MAC(0x1014));
- printk("MAC(1018) :0x%x\n", MAC(0x1018));
- printk("MAC(101c) :0x%x\n", MAC(0x101c));
- printk("MAC(0000) :0x%x\n", MAC(0x0000));
- printk("MAC(0004) :0x%x\n", MAC(0x0004));
- printk("MAC(0010) :0x%x\n", MAC(0x0010));
-
- status = mdiobus_read(priv->phydev->mdio.bus, 21, 1);
- printk("phy status:0x%x\n", status);
- status = mdiobus_read(priv->phydev->mdio.bus, 0, 1);
- printk("phy status port0:0x%x\n", status);
- status = mdiobus_read(priv->phydev->mdio.bus, 1, 1);
- printk("phy status port1:0x%x\n", status);
- status = mdiobus_read(priv->phydev->mdio.bus, 2, 1);
- printk("phy status port2:0x%x\n", status);
- status = mdiobus_read(priv->phydev->mdio.bus, 3, 1);
- printk("phy status port3:0x%x\n", status);
- status = mdiobus_read(priv->phydev->mdio.bus, 4, 1);
- printk("phy status port4:0x%x\n", status);
-
- status = mdiobus_read(priv->phydev->mdio.bus, 21, 20);
- status |= 0x4;
- mdiobus_write(priv->phydev->mdio.bus, 21, 20, status);
-
- status = mdiobus_read(priv->phydev->mdio.bus, 21, 21);
- printk("phy status loop port:0x%x\n", status);
-
-
- return 0;
-}
-
-ssize_t store_fun(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
-{
+ int status = 0;
+ volatile unsigned *gmac = (unsigned *)ndev->base_addr;
+ struct zx29_gmac_dev *priv = (struct zx29_gmac_dev *)netdev_priv(ndev);
+ printk("MAC(1000) :0x%x\n", MAC(0x1000));
+ printk("MAC(1004) :0x%x\n", MAC(0x1004));
+ printk("MAC(1008) :0x%x\n", MAC(0x1008));
+ printk("MAC(100c) :0x%x\n", MAC(0x100c));
+ printk("MAC(1010) :0x%x\n", MAC(0x1010));
+ printk("MAC(1014) int status:0x%x\n", MAC(0x1014));
+ printk("MAC(1018) :0x%x\n", MAC(0x1018));
+ printk("MAC(101c) :0x%x\n", MAC(0x101c));
+ printk("MAC(0000) :0x%x\n", MAC(0x0000));
+ printk("MAC(0004) :0x%x\n", MAC(0x0004));
+ printk("MAC(0010) :0x%x\n", MAC(0x0010));
+
+ status = mdiobus_read(priv->phydev->mdio.bus, 21, 1);
+ printk("phy status:0x%x\n", status);
+ status = mdiobus_read(priv->phydev->mdio.bus, 0, 1);
+ printk("phy status port0:0x%x\n", status);
+ status = mdiobus_read(priv->phydev->mdio.bus, 1, 1);
+ printk("phy status port1:0x%x\n", status);
+ status = mdiobus_read(priv->phydev->mdio.bus, 2, 1);
+ printk("phy status port2:0x%x\n", status);
+ status = mdiobus_read(priv->phydev->mdio.bus, 3, 1);
+ printk("phy status port3:0x%x\n", status);
+ status = mdiobus_read(priv->phydev->mdio.bus, 4, 1);
+ printk("phy status port4:0x%x\n", status);
+
+ status = mdiobus_read(priv->phydev->mdio.bus, 21, 20);
+ status |= 0x4;
+ mdiobus_write(priv->phydev->mdio.bus, 21, 20, status);
+
+ status = mdiobus_read(priv->phydev->mdio.bus, 21, 21);
+ printk("phy status loop port:0x%x\n", status);
+
+
+ return 0;
+}
+
+ssize_t store_fun(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
struct platform_device *pdev = to_platform_device(dev);
struct net_device *ndev = platform_get_drvdata(pdev);
- printk("[%s]", __func__);
- return 1;
-}
-
-
+ printk("[%s]", __func__);
+ return 1;
+}
+
+
ssize_t mdio_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -1695,7 +1716,7 @@
/*zw.wang add for switching the primary/secondary mode of gmac on 20240118 end */
-static DEVICE_ATTR(gmac_test, 0664, show_fun, store_fun);
+static DEVICE_ATTR(gmac_test, 0664, show_fun, store_fun);
static DEVICE_ATTR(mdio_test, 0664, mdio_show, mdio_store);
static DEVICE_ATTR(free_mdio, 0664, free_mdio_show, free_mdio_store);
static DEVICE_ATTR(debug_on, 0664, debug_on_show, debug_on_store);
@@ -1723,7 +1744,7 @@
if (!ndev)
return -ENOMEM;
- device_create_file(&pdev->dev, &dev_attr_gmac_test);
+ device_create_file(&pdev->dev, &dev_attr_gmac_test);
device_create_file(&pdev->dev, &dev_attr_mdio_test);
device_create_file(&pdev->dev, &dev_attr_free_mdio);
device_create_file(&pdev->dev, &dev_attr_debug_on);
@@ -1733,22 +1754,24 @@
prv = netdev_priv(ndev);
memset(prv, 0, sizeof(*prv));
prv->stopped = 1;
-
+
pctrl = devm_pinctrl_get(&pdev->dev);
if (IS_ERR(pctrl)) {
- dev_warn(&pdev->dev, "Failed to get test pins");
+ dev_warn(&pdev->dev, "Failed to get test pins");
pctrl = NULL;
- goto errirq;
+ goto errirq;
}
-
- state0 = pinctrl_lookup_state(pctrl, "state0");
+//xf.li@20240327 modify for T106BUG-567 start
+ //state0 = pinctrl_lookup_state(pctrl, "state0");
+ state0 = pinctrl_lookup_state(pctrl, "default");
+//xf.li@20240327 modify for T106BUG-567 end
if (IS_ERR(state0)) {
- dev_err(&pdev->dev, "TEST: missing state0\n");
+ dev_err(&pdev->dev, "TEST: missing state0\n");
goto pinctrl_init_end;
}
if (pinctrl_select_state(pctrl, state0) < 0) {
- dev_err(&pdev->dev, "setting state0 failed\n");
+ dev_err(&pdev->dev, "setting state0 failed\n");
goto pinctrl_init_end;
}
@@ -1756,7 +1779,7 @@
ret = gpio_request(prv->gpio_power[0], "gmac_power"); /* gpio 83/124 */
gpio_direction_output(prv->gpio_power[0], 1);
mdelay(15);
-#ifdef CONFIG_MDIO_C45 //zw.wang Customer chooses phy c22/c45 issues on 20240301
+#ifdef CONFIG_MDIO_C45 //zw.wang Customer chooses phy c22/c45 issues on 20240301
prv->gpio_power[1] = of_get_gpio_flags(pdev->dev.of_node, 1, &flags);
ret = gpio_request(prv->gpio_power[1], "phy_rst"); /* gpio 63 */
gpio_direction_output(prv->gpio_power[1], 0);
@@ -1768,7 +1791,7 @@
SET_NETDEV_DEV(ndev, &pdev->dev); //if not, will panic
base = devm_platform_ioremap_resource(pdev, 0);
- gmac_power_flag = prv->gpio_power[0];//jb.qi add for gamc power down on 20231116
+ gmac_power_flag = prv->gpio_power[0];//jb.qi add for gamc power down on 20231116
ndev->base_addr = base;/*iomem->start;*/
if (!ndev->base_addr)
return -ENXIO;
@@ -1867,8 +1890,8 @@
printk("set gmac wakelock!\n");
} else {
strcpy(board_name, "mdl");
- netif_device_detach(ndev);
- }
+ netif_device_detach(ndev);
+ }
platform_set_drvdata(pdev, ndev);
@@ -1963,7 +1986,7 @@
free_netdev(ndev);
platform_set_drvdata(pdev, NULL);
-#ifdef CONFIG_MDIO_C45 //zw.wang Customer chooses phy c22/c45 issues on 20240301
+#ifdef CONFIG_MDIO_C45 //zw.wang Customer chooses phy c22/c45 issues on 20240301
gpio_free(priv->gpio_power[1]);
#endif
gpio_direction_output(priv->gpio_power[0], 0);
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
index 4000729..b18019f 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/spi/spi-zx29.c
@@ -288,12 +288,14 @@
struct zx29_ssp_pins
{
struct device *dev;
-
+ //xf.li@20240327 modify for T106BUG-567 start
struct pinctrl *pctrl;
struct pinctrl_state *pfunc;
struct pinctrl_state *pgpio;
- struct pinctrl_state *pcs_gpio;
+ struct pinctrl_state *pcs_gpio_active;
struct pinctrl_state *pcs_func;
+ struct pinctrl_state *pcs_gpio_sleep;
+ //xf.li@20240327 modify for T106BUG-567 end
int gpio_cs;
int gpio_clk;
int gpio_tx;
@@ -1992,7 +1994,7 @@
};
/*
-* spi ʹÓÃGPIOģʽ¶ÁÈ¡LCD µÄID Begin
+* spi ʹ\D3\C3GPIOģʽ\B6\C1ȡLCD \B5\C4ID Begin
*/
static void spi_set_gpio_function(int dev_id)
{
@@ -2592,18 +2594,23 @@
}
ssp_pins[pdev->id].pctrl=pctrl;
- ssp_pins[pdev->id].pcs_gpio = pinctrl_lookup_state(pctrl, "cs_gpio");
- if (IS_ERR(ssp_pins[pdev->id].pcs_gpio)) {
- dev_err(&pdev->dev, "missing cs_gpio \n");
+ ssp_pins[pdev->id].pcs_gpio_active = pinctrl_lookup_state(pctrl, "cs_gpio_active");
+ if (IS_ERR(ssp_pins[pdev->id].pcs_gpio_active)) {
+ dev_err(&pdev->dev, "missing cs_gpio_active \n");
}
-
+//xf.li@20240327 modify for T106BUG-567 start
+ ssp_pins[pdev->id].pcs_gpio_sleep = pinctrl_lookup_state(pctrl, "cs_gpio_sleep");
+ if (IS_ERR(ssp_pins[pdev->id].pcs_gpio_sleep)) {
+ dev_err(&pdev->dev, "missing cs_gpio_sleep \n");
+ }
+//xf.li@20240327 modify for T106BUG-567 end
ssp_pins[pdev->id].pcs_func = pinctrl_lookup_state(ssp_pins[pdev->id].pctrl, "cs_func");
if (IS_ERR(ssp_pins[pdev->id].pcs_func)) {
dev_err(&pdev->dev, "missing cs_func \n");
}
if(zx29spi->master->slave == false) {
- if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio) < 0) {
+ if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio_active) < 0) {
printk("spi%d setting cs_gpio pin ctrl failed\n",pdev->id);
}
}else {
@@ -3222,14 +3229,23 @@
return -1;
if(pdev && &pdev->dev)
pinctrl_pm_select_sleep_state(&pdev->dev);
-
+//xf.li@20240327 modify for T106BUG-567 start
zx29spi = (struct zx29_spi *)platform_get_drvdata(pdev);
if(zx29spi && (zx29spi->master->slave == true)) {
- if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio) < 0) {
+ if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio_sleep) < 0) {
printk("spi%d setting cs_gpio pin ctrl failed\n",pdev->id);
return -1;
}
}
+
+ if(zx29spi && (zx29spi->master->slave == false)) {
+ if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio_sleep) < 0) {
+ printk("spi%d setting cs_gpio_sleep pin ctrl failed\n",pdev->id);
+ return -1;
+ }
+ printk("spi%d setting cs_gpio_sleep pin ctrl\n",pdev->id);
+ }
+//xf.li@20240327 modify for T106BUG-567 end
return 0;
}
@@ -3241,7 +3257,7 @@
return -1;
if(pdev && &pdev->dev)
pinctrl_pm_select_default_state(&pdev->dev);
-
+//xf.li@20240327 modify for T106BUG-567 start
zx29spi = (struct zx29_spi *)platform_get_drvdata(pdev);
if(zx29spi && (zx29spi->master->slave == true)) {
if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_func) < 0) {
@@ -3249,6 +3265,15 @@
return -1;
}
}
+ if(zx29spi && (zx29spi->master->slave == false)) {
+ if (pinctrl_select_state(ssp_pins[pdev->id].pctrl, ssp_pins[pdev->id].pcs_gpio_active) < 0) {
+ printk("spi%d setting cs_gpio_active pin ctrl failed\n",pdev->id);
+ return -1;
+ }
+ printk("spi%d setting cs_gpio_active pin ctrl\n",pdev->id);
+ gpio_direction_output(ssp_pins[pdev->id].gpio_cs,SPI_GPIO_HIGH);
+ }
+//xf.li@20240327 modify for T106BUG-567 end
return 0;
}
#endif
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/tty/serial/zx29_uart.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/tty/serial/zx29_uart.c
index 608ff72..bfa5cc4 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/tty/serial/zx29_uart.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/tty/serial/zx29_uart.c
@@ -3773,9 +3773,11 @@
enable_irq(zup->rxd_irq);
zup->rxd_int_depth = 1;
}
-#if 0
+//xf.li@20240327 modify for T106BUG-567 start
+#if 1
pinctrl_pm_select_sleep_state(dev);
#endif
+//xf.li@20240327 modify for T106BUG-567 end
return 0;
}
@@ -3799,9 +3801,11 @@
// zup->rxd_int_depth--;
//}
//return uart_resume_port(&amba_reg, &uap->port);
-#if 0
+//xf.li@20240327 modify for T106BUG-567 start
+#if 1
pinctrl_pm_select_default_state(dev);
#endif
+//xf.li@20240327 modify for T106BUG-567 end
return 0;
}
#endif
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/sanechips/zx29_es83xx.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/sanechips/zx29_es83xx.c
index 050a0f8..6af8b65 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/sanechips/zx29_es83xx.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/sound/soc/sanechips/zx29_es83xx.c
@@ -77,6 +77,10 @@
int gpio_pdn;
void __iomem *sys_base_va;
+ struct pinctrl *p;
+ struct pinctrl_state *s;
+ struct pinctrl_state *s_sleep;
+
};
@@ -703,15 +707,19 @@
static void zx29_i2s_top_pin_cfg(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct pinctrl *p,*p2;
- struct pinctrl_state *s,*s2;
+ struct pinctrl *p;
+ struct pinctrl_state *s;
+ struct pinctrl_state *s_sleep;
int ret = 0;
- printk("%s start n",__func__);
+ printk("%s start \n",__func__);
struct resource *res;
void __iomem *reg_base;
unsigned int val;
+
+ struct zx29_board_data *info = s_board;
+ pr_info("%s: board name(%s)!\n", __func__,info->name);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "soc_sys");
@@ -732,7 +740,7 @@
#endif
//#if 1 //CONFIG_USE_PIN_I2S0
-#ifdef CONFIG_USE_TOP_I2S0
+#if defined(CONFIG_USE_TOP_I2S0)
dev_info(dev, "%s: arm i2s1 to top i2s0!!\n", __func__);
//9300
@@ -742,7 +750,7 @@
val &= ~(0x7<<0);
val |= 0x1<<0; // inter arm_i2s1--top i2s1
zx_write_reg(reg_base+ZX29_I2S_TOP_LOOP_REG, val);
-#else //(CONFIG_USE_PIN_I2S1)
+#elif defined(CONFIG_USE_TOP_I2S1)//defined(CONFIG_USE_PIN_I2S1)
//8501evb
dev_info(dev, "%s: arm i2s1 to top i2s1!\n", __func__);
@@ -762,13 +770,89 @@
}
dev_info(dev, "%s: get pinctrl ,p=0x%llx,dev=0x%llx!!\n", __func__,p,dev);
+#if defined(CONFIG_USE_TOP_I2S0)
+ dev_info(dev, "%s: top_i2s0 pinctrl sel!!\n", __func__);
- s = pinctrl_lookup_state(p, "top_i2s");
+ s = pinctrl_lookup_state(p, "top_i2s0");
if (IS_ERR(s)) {
devm_pinctrl_put(p);
dev_err(dev, " get state failure!!\n");
return;
}
+
+ dev_info(dev, "%s: get top_i2s sleep pinctrl sel!!\n", __func__);
+
+ s_sleep = pinctrl_lookup_state(p, "topi2s0_sleep");
+ if (IS_ERR(s_sleep)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+
+
+
+#elif defined(CONFIG_USE_TOP_I2S1)
+ dev_info(dev, "%s: top_i2s1 pinctrl sel!!\n", __func__);
+
+ s = pinctrl_lookup_state(p, "top_i2s1");
+ if (IS_ERR(s)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+ dev_info(dev, "%s: get top_i2s sleep pinctrl sel!!\n", __func__);
+
+ s_sleep = pinctrl_lookup_state(p, "topi2s1_sleep");
+ if (IS_ERR(s_sleep)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+
+#elif defined(CONFIG_USE_TOP_TDM)
+ dev_info(dev, "%s: top_tdm pinctrl sel!!\n", __func__);
+ s = pinctrl_lookup_state(p, "top_tdm");
+ if (IS_ERR(s)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+ dev_info(dev, "%s: get top_i2s sleep pinctrl sel!!\n", __func__);
+
+ s_sleep = pinctrl_lookup_state(p, "toptdm_sleep");
+ if (IS_ERR(s_sleep)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+
+#else
+ dev_info(dev, "%s: default top_i2s pinctrl sel!!\n", __func__);
+
+ s = pinctrl_lookup_state(p, "top_i2s0");
+ if (IS_ERR(s)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+
+ dev_info(dev, "%s: get top_i2s sleep pinctrl sel!!\n", __func__);
+
+ s_sleep = pinctrl_lookup_state(p, "topi2s0_sleep");
+ if (IS_ERR(s_sleep)) {
+ devm_pinctrl_put(p);
+ dev_err(dev, " get state failure!!\n");
+ return;
+ }
+
+#endif
+ if(info != NULL){
+
+ info->p = p;
+ info->s = s;
+ info->s_sleep = s_sleep;
+ }
+
ret = pinctrl_select_state(p, s);
if (ret < 0) {
devm_pinctrl_put(p);
@@ -851,6 +935,104 @@
return ret;
}
+#ifdef CONFIG_PM
+static int zx29_audio_suspend(struct platform_device * pdev, pm_message_t state)
+{
+ pr_info("%s: start!\n",__func__);
+
+ //pinctrl_pm_select_sleep_state(&pdev->dev);
+ return 0;
+}
+
+static int zx29_audio_resume(struct platform_device *pdev)
+{
+ pr_info("%s: start!\n",__func__);
+
+ //pinctrl_pm_select_default_state(&pdev->dev);
+
+ return 0;
+}
+
+int zx29_snd_soc_suspend(struct device *dev)
+{
+
+ int ret = 0;
+ struct zx29_board_data *info = s_board;
+
+ pr_info("%s: start![8311]\n",__func__);
+
+ //pinctrl_pm_select_sleep_state(dev);
+ if((info->p != NULL)&&(info->s_sleep != NULL)){
+ ret = pinctrl_select_state(info->p, info->s_sleep);
+ if (ret < 0) {
+ //devm_pinctrl_put(info->p);
+ dev_err(dev, " select state failure!!\n");
+ //return;
+ }
+ dev_info(dev, "%s: set pinctrl sleep end!\n", __func__);
+ }
+ return snd_soc_suspend(dev);
+
+}
+int zx29_snd_soc_resume(struct device *dev)
+{
+ int ret = 0;
+ struct zx29_board_data *info = s_board;
+
+ pr_info("%s: start!\n",__func__);
+
+ //pinctrl_pm_select_default_state(dev);
+ if((info->p != NULL)&&(info->s != NULL)){
+ ret = pinctrl_select_state(info->p, info->s);
+ if (ret < 0) {
+ //devm_pinctrl_put(info->p);
+ dev_err(dev, " select state failure!!\n");
+ //return;
+ }
+ dev_info(dev, "%s: set pinctrl active end!\n", __func__);
+ }
+
+
+ return snd_soc_resume(dev);
+
+}
+
+#else
+static int zx29_audio_suspend(struct platform_device * pdev, pm_message_t state)
+{
+
+ return 0;
+}
+
+static int zx29_audio_resume(struct platform_device *pdev)
+{
+
+
+ return 0;
+}
+
+int zx29_snd_soc_suspend(struct device *dev)
+{
+
+
+ return snd_soc_suspend(dev);
+
+}
+int zx29_snd_soc_resume(struct device *dev)
+{
+
+
+ return snd_soc_resume(dev);
+
+}
+
+
+#endif
+
+struct dev_pm_ops zx29_snd_soc_pm_ops = {
+ .suspend = zx29_snd_soc_suspend,
+ .resume = zx29_snd_soc_resume,
+};
static struct platform_driver zx29_platform_driver = {
.driver = {
#if defined(CONFIG_SND_SOC_ZX29_ES8311)
@@ -862,7 +1044,7 @@
.name = "zx29_es8311",
#endif
.of_match_table = of_match_ptr(zx29_codec_of_match),
- .pm = &snd_soc_pm_ops,
+ .pm = &zx29_snd_soc_pm_ops,
},
.probe = zx29_audio_probe,
};
diff --git a/update_version.sh b/update_version.sh
index f8cfb58..c25970f 100755
--- 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="T106-V2.01.01.02P56U01.AP.12.03"
-LYNQ_CAP_INSIDE_VERSION="CAP.12.03"
-LYNQ_CAP_VERSION="CAP.12.03"
+LYNQ_AP_VERSION="T106-V2.01.01.02P56U01.AP.12.04"
+LYNQ_CAP_INSIDE_VERSION="CAP.12.04"
+LYNQ_CAP_VERSION="CAP.12.04"
COMMIT_ID="$(git rev-parse HEAD)"
LYNQ_SW_INSIDE_VERSION="LYNQ_CONFIG_VERSION = \"${LYNQ_AP_VERSION}_${LYNQ_CAP_INSIDE_VERSION}\""