GROUP(uart_rts_c, 4, 22),
GROUP(spdif_out, 3, 30),
GROUP(spdif_in, 3, 31),
+ GROUP(i2s_aoclk_out_z, 4, 9),
GROUP(i2s_lrclk_out_z, 4, 8),
GROUP(i2s_aoclk_in_z, 4, 3),
GROUP(i2s_lrclk_in_z, 4, 2),
static const char * const i2s_groups[] = {
"i2s_lrclk_out_dv", "i2s_aoclk_in_dv", "i2s_lrclk_in_dv",
"i2s_amclk_dv", "i2s_out_ch01_dv", "i2s_in_ch01_dv",
-
+ "i2s_aoclk_out_z",
"i2s_lrclk_out_z", "i2s_aoclk_in_z", "i2s_lrclk_in_z",
"i2s_amclk_z", "i2s_out_ch01_z", "i2s_in_ch01_z",
snd-soc-pdm-dummy-objs := pdm_dummy.o
snd-soc-pcm2bt-objs := pcm2bt.o
snd-soc-aml_t9015-objs := aml_codec_t9015.o
+snd-soc-aml_t9015s-objs := aml_codec_t9015S.o
snd-soc-pmu3-objs := aml_pmu3.o
snd-soc-aml_codec_txlx_acodec-objs := aml_codec_txlx_acodec.o
obj-$(CONFIG_AMLOGIC_SND_CODEC_PDM_DUMMY_CODEC) += snd-soc-pdm-dummy.o
obj-$(CONFIG_AMLOGIC_SND_CODEC_PCM2BT) += snd-soc-pcm2bt.o
obj-$(CONFIG_AMLOGIC_SND_CODEC_AMLT9015) += snd-soc-aml_t9015.o
+obj-$(CONFIG_AMLOGIC_SND_CODEC_AMLT9015S) += snd-soc-aml_t9015s.o
obj-$(CONFIG_AMLOGIC_SND_CODEC_PMU3) += snd-soc-pmu3.o
obj-$(CONFIG_AMLOGIC_SND_CODEC_TXLX_ACODEC) += snd-soc-aml_codec_txlx_acodec.o
};
static const struct reg_default t9015s_init_list[] = {
- {AUDIO_CONFIG_BLOCK_ENABLE, 0x1403BCFF},
+ {AUDIO_CONFIG_BLOCK_ENABLE, 0x34003CFF},
{ADC_VOL_CTR_PGA_IN_CONFIG, 0x50502929},
{DAC_VOL_CTR_DAC_SOFT_MUTE, 0xFBFB0000},
{LINE_OUT_CONFIG, 0x00004444},
pr_info("It has risk of distortion!\n");
}
- snd_soc_write(codec, val, add);
+ snd_soc_write(codec, add, val);
return 0;
}
SND_SOC_DAPM_PGA("PGAL_IN_EN", AUDIO_CONFIG_BLOCK_ENABLE,
PGAL_IN_EN, 0, NULL, 0),
SND_SOC_DAPM_PGA("PGAR_IN_EN", AUDIO_CONFIG_BLOCK_ENABLE,
- PGAL_IN_EN, 0, NULL, 0),
+ PGAR_IN_EN, 0, NULL, 0),
/*PGA input source select */
SND_SOC_DAPM_MUX("Linein left switch", SND_SOC_NOPM,
break;
case SND_SOC_BIAS_STANDBY:
- if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
- codec->cache_only = false;
- codec->cache_sync = 1;
+ if (codec->component.dapm.bias_level == SND_SOC_BIAS_OFF)
snd_soc_cache_sync(codec);
- }
break;
case SND_SOC_BIAS_OFF:
default:
break;
}
- codec->dapm.bias_level = level;
+ codec->component.dapm.bias_level = level;
return 0;
}
static int aml_T9015S_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- /*struct snd_soc_codec *codec = dai->codec;*/
+ struct snd_soc_codec *codec = dai->codec;
+ u32 value = snd_soc_read(codec, AUDIO_CONFIG_BLOCK_ENABLE);
+ bool Vmid_eanble = (bool)((value >> VMID_GEN_EN) & 0x1);
+
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && !Vmid_eanble) {
+ pr_info("aml_T9015S_prepare caputre!\n");
+ value |= 0x1 << VMID_GEN_EN;
+ snd_soc_write(codec, AUDIO_CONFIG_BLOCK_ENABLE, value);
+ } else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ pr_info("aml_T9015S_prepare playback!\n");
+ value &= ~(0x1 << VMID_GEN_EN);
+ snd_soc_write(codec, AUDIO_CONFIG_BLOCK_ENABLE, value);
+ msleep(20);
+ value |= 0x1 << VMID_GEN_EN;
+ snd_soc_write(codec, AUDIO_CONFIG_BLOCK_ENABLE, value);
+ }
+
return 0;
}
aml_audin_update_bits(AUDIN_SOURCE_SEL, 3, 3);
- codec->dapm.bias_level = SND_SOC_BIAS_STANDBY;
+ codec->component.dapm.bias_level = SND_SOC_BIAS_STANDBY;
T9015S_audio->codec = codec;
return 0;
aml_T9015S_audio_reset(codec);
aml_T9015S_audio_start_up(codec);
aml_T9015S_audio_reg_init(codec);
- codec->dapm.bias_level = SND_SOC_BIAS_STANDBY;
+ codec->component.dapm.bias_level = SND_SOC_BIAS_STANDBY;
aml_T9015S_audio_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
}