diff --git a/ac101.c b/ac101.c index 2b4b003..644cab0 100644 --- a/ac101.c +++ b/ac101.c @@ -260,16 +260,17 @@ static int ac101_headphone_event(struct snd_soc_codec* codec, int event) { /*open*/ AC101_DBG("post:open:%s,line:%d\n", __func__, __LINE__); ac101_update_bits(codec, OMIXER_DACA_CTRL, (0xf<codec, SND_SOC_DAPM_PRE_PMU); + #endif + late_enable_dac(codec, SND_SOC_DAPM_PRE_PMU); ac101_headphone_event(codec, SND_SOC_DAPM_POST_PMU); if (drc_used) { drc_enable(codec, 1); } + + /* Enable Left & Right Speaker */ + ac101_update_bits(codec, SPKOUT_CTRL, (0x1 << LSPK_EN) | (0x1 << RSPK_EN), (0x1 << LSPK_EN) | (0x1 << RSPK_EN)); if (ac10x->gpiod_spk_amp_gate) { gpiod_set_value(ac10x->gpiod_spk_amp_gate, 1); } - #if _MASTER_MULTI_CODEC != _MASTER_AC101 - /* enable global clock */ - ac101_aif1clk(static_ac10x->codec, SND_SOC_DAPM_PRE_PMU); - #endif + } else { if (ac10x->gpiod_spk_amp_gate) { - gpiod_set_value(ac10x->gpiod_spk_amp_gate, 0); + gpiod_set_value(ac10x->gpiod_spk_amp_gate, 1); } + /* Disable Left & Right Speaker */ + ac101_update_bits(codec, SPKOUT_CTRL, (0x1 << LSPK_EN) | (0x1 << RSPK_EN), (0x0 << LSPK_EN) | (0x0 << RSPK_EN)); if (drc_used) { drc_enable(codec, 0); } @@ -578,6 +586,11 @@ static int ac101_set_pll(struct snd_soc_dai *codec_dai, int pll_id, int source, AC101_DBG("%s, line:%d, pll_id:%d\n", __func__, __LINE__, pll_id); + /* select aif1 clk srouce from mclk1 */ + ac101_update_bits(codec, SYSCLK_CTRL, (0x3< 24576000)) { @@ -612,14 +625,14 @@ static int ac101_set_pll(struct snd_soc_dai *codec_dai, int pll_id, int source, break; } } - /*config pll m*/ + /* config pll m */ if (m == 64) m = 0; ac101_update_bits(codec, PLL_CTRL1, (0x3f<