[Feature]L805-2][codec] modify codec nau8810 compatible with both i2c0 and i2c1
Only Configure: No
Affected branch: Merge
Affected module: kernel
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No
Change-Id: Ibf1a58f408fd4a261cd8d8258754118d58ceaff5
diff --git a/src/kernel/linux/v4.19/sound/soc/mediatek/mt6880/mt6880-mt6359.c b/src/kernel/linux/v4.19/sound/soc/mediatek/mt6880/mt6880-mt6359.c
index 295b8ac..5680db0 100644
--- a/src/kernel/linux/v4.19/sound/soc/mediatek/mt6880/mt6880-mt6359.c
+++ b/src/kernel/linux/v4.19/sound/soc/mediatek/mt6880/mt6880-mt6359.c
@@ -1045,6 +1045,10 @@
//tianyan@2021.8.2 modify for compatible codec tlv320aic3104 and add loopback test start
#if defined(CONFIG_SND_SOC_NAU8810) || defined(CONFIG_SND_SOC_TLV320AIC3X)
dev_t devno;
+//you.chen@2023.8.16 modify for compatible codec on i2c1 start
+ char tmp[64];
+ struct device *dev;
+//you.chen@2023.8.16 modify for compatible codec on i2c1 end
#endif
//tianyan@2021.8.2 modify for compatible codec tlv320aic3104 and add loopback test end
@@ -1121,21 +1125,28 @@
#ifdef CONFIG_SND_SOC_NAU8810
//tianyan@2021.7.16 modify for compatible codec tlv320aic3104 start
- if(!mt6880_regmap){
- mt6880_regmap = nau8810_get_nau8810_config();
+//you.chen@2023.8.16 modify for compatible codec on i2c1 start
+ if(!mt6880_regmap && NULL != (mt6880_regmap = nau8810_get_nau8810_config())){
g_mt6880_codec_type = MT6880_CODEC_TYPE_NAU8810;
printk("change to codec nau8810\n");
+ strcpy(tmp, "nau8810-0.001a");
+ if (NULL != (dev=regmap_get_device(mt6880_regmap)))
+ {
+ sprintf(tmp, "%s.%s", dev->driver->name, dev_name(dev));
+ }
+
for (i = 0; i < card->num_links; i++) {
if(!strcmp(mt6880_mt6359_dai_links[i].name, "I2S0")){
mt6880_mt6359_dai_links[i].codec_dai_name = "nau8810-hifi";
- mt6880_mt6359_dai_links[i].codec_name = "nau8810.0-001a";
+ mt6880_mt6359_dai_links[i].codec_name = kstrdup(tmp, GFP_KERNEL);
}
if(!strcmp(mt6880_mt6359_dai_links[i].name, "I2S3")){
mt6880_mt6359_dai_links[i].codec_dai_name = "nau8810-hifi";
- mt6880_mt6359_dai_links[i].codec_name = "nau8810.0-001a";
+ mt6880_mt6359_dai_links[i].codec_name = kstrdup(tmp, GFP_KERNEL);
}
}
}
+//you.chen@2023.8.16 modify for compatible codec on i2c1 end
//tianyan@2021.7.16 modify for compatible codec tlv320aic3104 end
#endif