[Feature][T8TSK-133][codec]Merge codec tlv320aic3x from gsw branch

Change-Id: Ib1bae11902e68f7b2a32fa7300011ee66f819989
diff --git a/src/kernel/linux/v4.19/sound/soc/codecs/tlv320aic3x.c b/src/kernel/linux/v4.19/sound/soc/codecs/tlv320aic3x.c
index ad4c535..ee439f4 100644
--- a/src/kernel/linux/v4.19/sound/soc/codecs/tlv320aic3x.c
+++ b/src/kernel/linux/v4.19/sound/soc/codecs/tlv320aic3x.c
@@ -98,26 +98,27 @@
 	u8 ocmv;
 };
 
+
 static const struct reg_default aic3x_reg[] = {
 	{   0, 0x00 }, {   1, 0x00 }, {   2, 0x00 }, {   3, 0x10 },
 	{   4, 0x04 }, {   5, 0x00 }, {   6, 0x00 }, {   7, 0x00 },
 	{   8, 0x00 }, {   9, 0x00 }, {  10, 0x00 }, {  11, 0x01 },
 	{  12, 0x00 }, {  13, 0x00 }, {  14, 0x00 }, {  15, 0x80 },
-	{  16, 0x80 }, {  17, 0xff }, {  18, 0xff }, {  19, 0x78 },
+	{  16, 0x80 }, {  17, 0xf0 }, {  18, 0xf0 }, {  19, 0xff },
 	{  20, 0x78 }, {  21, 0x78 }, {  22, 0x78 }, {  23, 0x78 },
 	{  24, 0x78 }, {  25, 0x00 }, {  26, 0x00 }, {  27, 0xfe },
-	{  28, 0x00 }, {  29, 0x00 }, {  30, 0xfe }, {  31, 0x00 },
+	{  28, 0x00 }, {  29, 0x80 }, {  30, 0xec }, {  31, 0x00 },
 	{  32, 0x18 }, {  33, 0x18 }, {  34, 0x00 }, {  35, 0x00 },
-	{  36, 0x00 }, {  37, 0x00 }, {  38, 0x00 }, {  39, 0x00 },
+	{  36, 0x0f }, {  37, 0x00 }, {  38, 0x00 }, {  39, 0x00 },
 	{  40, 0x00 }, {  41, 0x00 }, {  42, 0x00 }, {  43, 0x80 },
-	{  44, 0x80 }, {  45, 0x00 }, {  46, 0x00 }, {  47, 0x00 },
-	{  48, 0x00 }, {  49, 0x00 }, {  50, 0x00 }, {  51, 0x04 },
+	{  44, 0x08 }, {  45, 0x00 }, {  46, 0x00 }, {  47, 0x00 },
+	{  48, 0x00 }, {  49, 0x00 }, {  50, 0x00 }, {  51, 0x8c },
 	{  52, 0x00 }, {  53, 0x00 }, {  54, 0x00 }, {  55, 0x00 },
-	{  56, 0x00 }, {  57, 0x00 }, {  58, 0x04 }, {  59, 0x00 },
+	{  56, 0x00 }, {  57, 0x8c }, {  58, 0x8c }, {  59, 0x00 },
 	{  60, 0x00 }, {  61, 0x00 }, {  62, 0x00 }, {  63, 0x00 },
-	{  64, 0x00 }, {  65, 0x04 }, {  66, 0x00 }, {  67, 0x00 },
+	{  64, 0x00 }, {  65, 0x8c}, {  66, 0x00 }, {  67, 0x00 },
 	{  68, 0x00 }, {  69, 0x00 }, {  70, 0x00 }, {  71, 0x00 },
-	{  72, 0x04 }, {  73, 0x00 }, {  74, 0x00 }, {  75, 0x00 },
+	{  72, 0x8c }, {  73, 0x00 }, { 74, 0x00 }, {  75, 0x00 },
 	{  76, 0x00 }, {  77, 0x00 }, {  78, 0x00 }, {  79, 0x00 },
 	{  80, 0x00 }, {  81, 0x00 }, {  82, 0x00 }, {  83, 0x00 },
 	{  84, 0x00 }, {  85, 0x00 }, {  86, 0x00 }, {  87, 0x00 },
@@ -390,10 +391,10 @@
 	/* Output pin mute controls */
 	SOC_DOUBLE_R("Line Playback Switch", LLOPM_CTRL, RLOPM_CTRL, 3,
 		     0x01, 0),
-	SOC_DOUBLE_R("HP Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3,
-		     0x01, 0),
-	SOC_DOUBLE_R("HPCOM Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3,
-		     0x01, 0),
+	//C_DOUBLE_R("HP Playback Switch", HPLOUT_CTRL, HPROUT_CTRL, 3,
+		//   0x01, 0),
+	//C_DOUBLE_R("HPCOM Playback Switch", HPLCOM_CTRL, HPRCOM_CTRL, 3,
+		//   0x01, 0),
 
 	/*
 	 * Note: enable Automatic input Gain Controller with care. It can
@@ -647,8 +648,8 @@
 	SND_SOC_DAPM_MUX("Right HPCOM Mux", SND_SOC_NOPM, 0, 0,
 			 &aic3x_right_hpcom_mux_controls),
 	SND_SOC_DAPM_PGA("Right Line Out", RLOPM_CTRL, 0, 0, NULL, 0),
-	SND_SOC_DAPM_PGA("Right HP Out", HPROUT_CTRL, 0, 0, NULL, 0),
-	SND_SOC_DAPM_PGA("Right HP Com", HPRCOM_CTRL, 0, 0, NULL, 0),
+	//D_SOC_DAPM_PGA("Right HP Out", HPROUT_CTRL, 0, 0, NULL, 0),
+	//D_SOC_DAPM_PGA("Right HP Com", HPRCOM_CTRL, 0, 0, NULL, 0),
 
 	/* Inputs to Left ADC */
 	SND_SOC_DAPM_ADC("Left ADC", "Left Capture", LINE1L_2_LADC_CTRL, 2, 0),
@@ -1541,16 +1542,16 @@
 	snd_soc_component_update_bits(component, LLOPM_CTRL, UNMUTE, UNMUTE);
 	snd_soc_component_update_bits(component, RLOPM_CTRL, UNMUTE, UNMUTE);
 	snd_soc_component_update_bits(component, HPLOUT_CTRL, UNMUTE, UNMUTE);
-	snd_soc_component_update_bits(component, HPROUT_CTRL, UNMUTE, UNMUTE);
+	//d_soc_component_update_bits(component, HPROUT_CTRL, UNMUTE, UNMUTE);
 	snd_soc_component_update_bits(component, HPLCOM_CTRL, UNMUTE, UNMUTE);
-	snd_soc_component_update_bits(component, HPRCOM_CTRL, UNMUTE, UNMUTE);
+	//d_soc_component_update_bits(component, HPRCOM_CTRL, UNMUTE, UNMUTE);
 
 	/* ADC default volume and unmute */
 	snd_soc_component_write(component, LADC_VOL, DEFAULT_GAIN);
 	snd_soc_component_write(component, RADC_VOL, DEFAULT_GAIN);
 	/* By default route Line1 to ADC PGA mixer */
-	snd_soc_component_write(component, LINE1L_2_LADC_CTRL, 0x0);
-	snd_soc_component_write(component, LINE1R_2_RADC_CTRL, 0x0);
+	snd_soc_component_write(component, LINE2L_2_LADC_CTRL, 0x0);
+	snd_soc_component_write(component, LINE2R_2_RADC_CTRL, 0x0);
 
 	/* PGA to HP Bypass default volume, disconnect from Output Mixer */
 	snd_soc_component_write(component, PGAL_2_HPLOUT_VOL, DEFAULT_VOL);
@@ -1673,6 +1674,7 @@
 		 */
 		break;
 	}
+	
 
 	aic3x_add_widgets(component);
 
@@ -1850,6 +1852,15 @@
 								GFP_KERNEL);
 		if (!ai3x_setup)
 			return -ENOMEM;
+		/*modify by chencheng 2022/3/22 start*/
+		ret = of_get_named_gpio(np, "gpio-power", 0);
+		printk("ret power gpio = %d\n",ret);
+		if(ret>0){
+	       aic3x->power = ret;
+		   gpio_direction_output(aic3x->power, 1);
+		   mdelay(100);
+		}
+		/*modify by chencheng 2022/3/22 end*/
 
 		ret = of_get_named_gpio(np, "reset-gpios", 0);
 		if (ret >= 0) {
@@ -1950,10 +1961,9 @@
 	list_add(&aic3x->list, &reset_list);
 
 //dongyu@2022.8.19 add codec boot without initialization start
-        gpio_direction_output(aic3x->power, 0);
-        gpio_direction_output(aic3x->gpio_reset, 0);
+	gpio_direction_output(aic3x->power, 0);
+	gpio_direction_output(aic3x->gpio_reset, 0);
 //dongyu@2022.8.19 add codec boot without initialization end
-
 	return 0;
 
 err_gpio: