Merge "[Feature][T106BUG-337] Solve no sound on the codec side during calls"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
index 2da25a3..1bc5af2 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
@@ -130,8 +130,8 @@
 SECURITY_PIE_CFLAGS = " -pie -fPIE"
 SECURITY_STACK_PROTECTOR = " -fstack-protector-all"
 #CUSTOM_MACRO += " -D_USE_CODEC_TI3100 "
-CUSTOM_MACRO += " -D_USE_CODEC_NAU8810 "
-#CUSTOM_MACRO += " -D_USE_CODEC_TI3104 "
+#CUSTOM_MACRO += " -D_USE_CODEC_NAU8810 "
+CUSTOM_MACRO += " -D_USE_CODEC_TI3104 "
 #CUSTOM_MACRO += " -D_USE_CODEC_MAX9867 "
 #CUSTOM_MACRO += " -D_USE_CODEC_ES8311 "
 CUSTOM_MACRO += "${@bb.utils.contains('DISTRO_FEATURES', 'voice_alsa', '-D_USE_VOICE_ALSA', '', d)}"
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
index 1eb4ccc..6156f46 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/libtinyalsa/audio_mixer_ctrl.c
@@ -796,7 +796,176 @@
 	return 255;
 
 }
- 
+
+//l.yang modify for bug id T106BUG-337 2023/11/9 start
+#elif defined _USE_CODEC_TI3104
+
+
+static struct audio_para_conf init_default_para[] = {  //¿¿¿¿¿¿¿
+
+};
+
+static struct audio_para_conf  common_out_para_audio[] = {  //¿¿¿¿¿¿
+    //{"DAC Soft Mute Control", {"0"}},
+};
+
+
+static struct audio_para_conf  common_in_para_audio[] = {  //¿¿¿¿¿¿
+	//{"Mic Gain Control", {"0"}},
+};
+
+static struct audio_para_conf  hp_outpath_para_audio[] = {  //¿¿¿Hp¿¿¿¿
+	{"Line Playback Switch", {"1","1"}},
+	{"PCM Playback Volume", {"110","110"}},
+	{"Line Playback Volume", {"8","8"}},
+	{"Line DAC Playback Volume", {"110","110"}},
+};
+
+static struct audio_para_conf  spk_outpath_para_audio[] = { //¿¿¿Spk¿¿¿¿
+	{"Line Playback Switch", {"1","1"}},
+	{"PCM Playback Volume", {"110","110"}},
+	{"Line Playback Volume", {"8","8"}},
+	{"Line DAC Playback Volume", {"110","110"}},
+};
+
+static  struct  audio_para_conf  main_mic_inpath_para_audio[] = { //¿¿¿Mic1lp_Mic1lm¿¿¿¿
+	{"MicBias VG", {"1"}},
+	{"PGA Capture Volume", {"100","100"}},
+	{"PGA Capture Switch", {"1","1"}},
+	{"ADC HPF Cut-off", {"1","1"}},
+
+	{"Left PGA Mixer Mic2L Switch",{"1"}},
+	{"Left PGA Mixer Mic2R Switch",{"1"}},
+	{"Right PGA Mixer Mic2L Switch",{"1"}},
+	{"Right PGA Mixer Mic2R Switch",{"1"}},
+};
+
+static  struct  audio_para_conf  aux_mic_inpath_para_audio[] = {//¿¿¿Mic1rp¿¿¿¿
+	{"MicBias VG", {"1"}},
+	{"PGA Capture Volume", {"100","100"}},
+	{"PGA Capture Switch", {"1","1"}},
+	{"ADC HPF Cut-off", {"1","1"}},
+
+	{"Left PGA Mixer Mic2L Switch",{"1"}},
+	{"Left PGA Mixer Mic2R Switch",{"1"}},
+	{"Right PGA Mixer Mic2L Switch",{"1"}},
+	{"Right PGA Mixer Mic2R Switch",{"1"}},
+};
+
+static struct audio_para_conf  handset_inoutpath_para_voice[] = {  //¿¿¿Hp¿¿¿¿Mic1lp_Mic1lm¿¿¿¿
+	//in
+	//#0x2d b6 pga mute
+	{"MicBias VG", {"1"}},
+	{"PGA Capture Volume", {"100","100"}},
+	{"PGA Capture Switch", {"1","1"}},
+	{"ADC HPF Cut-off", {"1","1"}},
+
+	{"Left PGA Mixer Mic2L Switch",{"1"}},
+	{"Left PGA Mixer Mic2R Switch",{"1"}},
+	{"Right PGA Mixer Mic2L Switch",{"1"}},
+	{"Right PGA Mixer Mic2R Switch",{"1"}},
+
+	//out
+	{"Line Playback Switch", {"1","1"}},
+	{"PCM Playback Volume", {"110","110"}},
+	{"Line Playback Volume", {"8","8"}},
+	{"Line DAC Playback Volume", {"110","110"}},
+
+	//voice
+	#ifndef USE_CAP_SUPPORT
+	{"voice processing path select", {"handset"}},  // handset speak headset bluetooth
+	#endif
+};
+
+static struct audio_para_conf  headset_inoutpath_para_voice[] = {  //¿¿¿Hp¿¿¿¿ Mic1rp¿¿¿¿
+	//in
+	//#0x2d b6 pga mute
+	{"MicBias VG", {"1"}},
+	{"PGA Capture Volume", {"100","100"}},
+	{"PGA Capture Switch", {"1","1"}},
+	{"ADC HPF Cut-off", {"1","1"}},
+
+	{"Left PGA Mixer Mic2L Switch",{"1"}},
+	{"Left PGA Mixer Mic2R Switch",{"1"}},
+	{"Right PGA Mixer Mic2L Switch",{"1"}},
+	{"Right PGA Mixer Mic2R Switch",{"1"}},
+
+	//out
+	{"Line Playback Switch", {"1","1"}},
+	{"PCM Playback Volume", {"110","110"}},
+	{"Line Playback Volume", {"8","8"}},
+	{"Line DAC Playback Volume", {"110","110"}},
+
+	//voice
+	#ifndef USE_CAP_SUPPORT
+	{"voice processing select", {"headset"}}, // handset speak headset bluetooth
+	#endif
+};
+
+static struct audio_para_conf  spk_inoutpath_para_voice[] = { //¿¿¿Spk¿¿¿¿Mic1lp_Mic1lm¿¿¿¿
+	//in
+	//#0x2d b6 pga mute
+	{"MicBias VG", {"1"}},
+	{"PGA Capture Volume", {"100","100"}},
+	{"PGA Capture Switch", {"1","1"}},
+	{"ADC HPF Cut-off", {"1","1"}},
+
+	{"Left PGA Mixer Mic2L Switch",{"1"}},
+	{"Left PGA Mixer Mic2R Switch",{"1"}},
+	{"Right PGA Mixer Mic2L Switch",{"1"}},
+	{"Right PGA Mixer Mic2R Switch",{"1"}},
+
+	//out
+	{"Line Playback Switch", {"1","1"}},
+	{"PCM Playback Volume", {"110","110"}},
+	{"Line Playback Volume", {"8","8"}},
+	{"Line DAC Playback Volume", {"110","110"}},
+	//voice
+
+	#ifndef USE_CAP_SUPPORT
+	{"voice processing path select", {"speak"}}, // handset speak headset bluetooth
+	#endif
+};
+
+static struct audio_para_conf output_dac_vol = {
+   {"PCM Playback Volume", {"110","110"}},
+};
+
+static struct audio_para_conf input_adc_vol = {
+	{"PGA Capture Volume", {"100","100"}},
+};
+
+static struct audio_para_conf dac_mute = {
+	"Line Playback Switch", {"0","0"}
+};
+
+static struct audio_para_conf adc_mute = {
+    "MicBias VG", {"0"}
+};
+
+static struct audio_para_conf spk_path_onoff[] = {
+	{"Mono Mixer PCM Playback Switch", {"0"}},
+};
+
+static struct audio_para_conf rcv_path_onoff[] = {
+	{"Mono Mixer PCM Playback Switch", {"0"}},
+};
+
+static struct audio_para_conf earp_path_onoff[] = {
+	{"Speaker Mixer PCM Playback Switch", {"0"}},
+};
+
+static int output_vol_conversion(int vol)
+{
+	return 120;
+}
+
+static int input_vol_conversion(int vol)
+{
+	return 100;
+}
+//l.yang modify for bug id T106BUG-337 2023/11/9 end
+
 #elif defined _USE_CODEC_ES8374
 
 
@@ -1851,8 +2020,10 @@
 
 }
 
+//l.yang modify for bug id T106BUG-337 2023/11/9 start
+#if (defined _USE_CODEC_TI3100)||(defined _USE_CODEC_AK4940)||(defined _USE_CODEC_NAU8810)||(defined _USE_CODEC_ES8311) || (defined _USE_CODEC_TI3104)
+//l.yang modify for bug id T106BUG-337 2023/11/9 end
 
-#if (defined _USE_CODEC_TI3100)||(defined _USE_CODEC_AK4940)||(defined _USE_CODEC_NAU8810)||(defined _USE_CODEC_ES8311)
 /*
 int mix_set_input_vol(struct mixer *mixer, int volume)
 {