[Bugfix][T106BUG-312][codec] Add codec 3104 can't get down from sleep the first time, update power saving strategy, 26M clock only turns on when playing audio

Only Configure: No
Affected branch: master
Affected module: codec
Is it affected on both ZXIC and MTK:only zxic
Self-test: Yes
Doc Update:No

Change-Id: I7a06575709d10daba2151f274570ee968761788b
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)