[Feature][ZXW-132]Supports codec 3104 playback of audio recordings
Only Configure:No
Affected branch:master
Affected module:codec
Is it affected on both ZXIC and MTK:only ZXIC
Self-test:Yes
Doc Update:Yes
Change-Id: I0b42c350793458bb7459f3330a3e446d6853b5df
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
index b4b886e..6c84688 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
@@ -1975,24 +1975,22 @@
# CONFIG_SND_SOC_ZX29_TI3100 is not set
#dongyu@modify for codec start
# CONFIG_SND_SOC_ZX29_NAU8810 is not set
-# CONFIG_SND_SOC_ZX29_TI3104 is not set
+CONFIG_SND_SOC_ZX29_TI3104=y
# CONFIG_SND_SOC_ZX29_ES8374 is not set
# CONFIG_SND_SOC_ZX29_ES8312 is not set
# CONFIG_SND_SOC_ZX29_AK4940 is not set
# CONFIG_SND_SOC_ZX29_MAX9867 is not set
# CONFIG_SND_SOC_ZX29_ES8311 is not set
-CONFIG_SND_SOC_ZX29_ES8311=y
CONFIG_SND_SOC_ZX_VOICE=y
CONFIG_SND_SOC_ZX297520V3=y
CONFIG_SND_SOC_ZX_I2S=y
CONFIG_SND_SOC_ZX_PCM=y
# CONFIG_SND_SOC_ZX_TDM is not set
# CONFIG_SND_SOC_TLV320AIC31XX is not set
-CONFIG_SND_SOC_NAU8810=y
-# CONFIG_SND_SOC_TLV320AIC3X is not set
+# CONFIG_SND_SOC_NAU8810 is not set
+CONFIG_SND_SOC_TLV320AIC3X=y
# CONFIG_SND_SOC_MAX9867 is not set
# CONFIG_SND_SOC_ES8311 is not set
-CONFIG_SND_SOC_ES8311=y
#dongyu@modify for codec end
CONFIG_SND_EXTRA_CTRL=y
CONFIG_USE_TOP_I2S0=y
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 1067603..d6968ac 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
@@ -130,14 +130,14 @@
// status = "okay";
};
&codec_ti3104 {
-// status = "okay";
+ status = "okay";
};
&zx29_ti3104 {
pinctrl-0 = <&i2s0_pins>;
-// status = "okay";
+ status = "okay";
};
&codec_nau8810 {
- status = "okay";
+// status = "okay";
};
&zx29_nau8810 {
pinctrl-0 = <&i2s0_pins>;
@@ -155,11 +155,11 @@
// status = "okay";
};
&codec_es8311 {
- status = "okay";
+// status = "okay";
};
&zx29_es8311 {
pinctrl-0 = <&i2s0_pins>;
- status = "okay";
+// status = "okay";
};
&gmac {
port-nums = <1>;
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 24faec9..7a57181 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
@@ -488,13 +488,13 @@
codec_ti3104: ti3104@18 {
compatible = "ti,tlv320aic3104";
reg = <0x18>;
- reset-gpios = <&bgpio 122 GPIO_ACTIVE_HIGH>;/*RST*/
+ reset-gpios = <&bgpio 119 GPIO_ACTIVE_HIGH>;/*RST*/
ai3x-micbias-vg = <MICBIAS_2_0V>;
- clocks = <&clkc CLKOUT1_CLK>;
+ clocks = <&clkc CLKOUT2_CLK>;
clock-names = "clk_out";
pinctrl-names = "clk_out","reset_gpio122";
- pinctrl-0 = <&clk1_func_pins>;
+ pinctrl-0 = <&clk2_func_pins>;
pinctrl-1 = <&codec_reset_pins>;
status = "disabled";
};
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 4f01cbc..09ef085 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,6 +1018,15 @@
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){
@@ -1059,7 +1068,7 @@
clk = of_clk_get_by_name(np, "clk_out");
if (IS_ERR(clk)) {
- dev_err(dev, "Could not get clk_out\n");
+ dev_err(dev, "Could not get clk_out0\n");
ret = PTR_ERR(clk);
goto err_put_pinctrl;
}
@@ -1203,7 +1212,7 @@
regmap_read(info->regmap, AIC3X_PAGE_SELECT, &pre_page);
regmap_write(info->regmap, AIC3X_PAGE_SELECT, 0);
- for (i = regmin; i < regmax; i++) {
+ for (i = regmin; i <= regmax; i++) {
//val = snd_soc_component_read(info->component, i);
regmap_read(info->regmap, i, &val);
@@ -1260,6 +1269,7 @@
if( ret == 0)
{
dev_info(dev, "reg_read start\n");
+ /*
if(param1 > 1){
dev_err(dev, "reg_read param invalidate fail,param1=%d \n",param1);
return -1;
@@ -1268,10 +1278,14 @@
if(param2 > regmax){
dev_err(dev, "reg_read param invalidate fail,param2=%d \n",param2);
return -1;
- }
-
+ }
+ */
-
+ if(param1 < 0 || param1 > 109){
+ dev_err(dev, "reg_read param invalidate fail,param1=%d \n",param1);
+ return -1;
+ }
+
regmap_read(info->regmap, AIC3X_PAGE_SELECT, &pre_page);
regmap_write(info->regmap, AIC3X_PAGE_SELECT, regpage);
@@ -1295,6 +1309,8 @@
//u32 offset = param1;
//u32 mask = param2;
dev_info(dev, "reg_write start\n");
+
+ /*
if(param1 > 1){
dev_err(dev, "reg_write param invalidate fail,param1=%d \n",param1);
return -1;
@@ -1303,9 +1319,14 @@
if(param2 > regmax){
dev_err(dev, "reg_write param invalidate fail,param1=%d \n",param1);
return -1;
- }
+ }
+ */
-
+ if(param1 < 0 || param1 > 109){
+ dev_err(dev, "reg_write param invalidate fail,param1=%d \n",param1);
+ return -1;
+ }
+
regmap_read(info->regmap, AIC3X_PAGE_SELECT, &pre_page);
regmap_write(info->regmap, AIC3X_PAGE_SELECT, regpage);
@@ -1846,13 +1867,15 @@
.name = "tlv320aic3x-hifi",
.playback = {
.stream_name = "Playback",
- .channels_min = 2,
+ //.channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = AIC3X_RATES,
.formats = AIC3X_FORMATS,},
.capture = {
.stream_name = "Capture",
- .channels_min = 2,
+ //.channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = AIC3X_RATES,
.formats = AIC3X_FORMATS,},