Skip to content

Commit

Permalink
ASoC: mediatek: mt8195: update audio tuner settings
Browse files Browse the repository at this point in the history
Audio tuner is used to handle clock drift between 26M and APLL domain.

It's expected when abs(chg_cnt) equals to upper bound, tuner updates pcw
setting automatically, and then abs(chg_cnt) decreases.
In the stress test, we found abs(chg_cnt) possibly equals to 2 at the
unexpected timing. This results in wrong pcw updating.
Finally, abs(chg_cnt) will always be larger than upper bound,

As a result, we update the upper bound to 3 to handle the corner case.

Signed-off-by: Trevor Wu <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
wenliangwu authored and broonie committed Sep 28, 2022
1 parent 16b5144 commit 7ba6546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/mediatek/mt8195/mt8195-afe-clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static struct mt8195_afe_tuner_cfg mt8195_afe_tuner_cfgs[MT8195_AUD_PLL_NUM] = {
.upper_bound_reg = AFE_APLL_TUNER_CFG,
.upper_bound_shift = 8,
.upper_bound_maskbit = 0xff,
.upper_bound_default = 0x2,
.upper_bound_default = 0x3,
},
[MT8195_AUD_PLL2] = {
.id = MT8195_AUD_PLL2,
Expand All @@ -135,7 +135,7 @@ static struct mt8195_afe_tuner_cfg mt8195_afe_tuner_cfgs[MT8195_AUD_PLL_NUM] = {
.upper_bound_reg = AFE_APLL_TUNER_CFG1,
.upper_bound_shift = 8,
.upper_bound_maskbit = 0xff,
.upper_bound_default = 0x2,
.upper_bound_default = 0x3,
},
[MT8195_AUD_PLL3] = {
.id = MT8195_AUD_PLL3,
Expand Down

0 comments on commit 7ba6546

Please sign in to comment.