Commit 10f4bb0d authored by Hans de Goede's avatar Hans de Goede Committed by chrome-bot
Browse files

UPSTREAM: ASoC: rt5651: Remove is_sys_clk_from_pll()



is_sys_clk_from_pll() is used as a snd_soc_dapm_route.connected callback,
checking RT5651_GBL_CLK to determine if the sys-clk is PLL1 and thus the
PWR_PLL bit in reg PWR_ANLG2 must be set.

RT5651_GBL_CLK is changed by rt5651_set_dai_sysclk(), which gets called by
the pre_pmu / post_pmd functions of the "Platform Clock" dapm-supply.

This creates an ordering issue, during a dapm transition first all
connected() callbacks are called to build a list of supplies to enable
and then the complete list is walked to enable the supplies. Since the
connected() check happens before enabling any supplies,
is_sys_clk_from_pll() ends up deciding if the PWR_PLL bit should be set
based on the state the "Platform Clock" supply had *before* the transition.
This sometimes results in PWR_PLL being off, even though *after* the
transition PLL1 is configured as sys-clk.

This commit removes is_sys_clk_from_pll() instead simply setting / clearing
PWR_PLL in rt5651_set_dai_sysclk() based on the selected sys-clk, which
fixes this and as a bonus results in a nice cleanup.

Tested-by: default avatarCarlo Caione <carlo@endlessm.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
(cherry picked from commit d082174c)
Signed-off-by: default avatarSamaga Prasanna Krishna <samaga.krishna@intel.corp-partner.google.com>

BUG=b:110025789
TEST=Test Audio use cases with full SOF 0.6 rebase release series applied.

Change-Id: I68b6181ef6ce594e3a5a54d21ca1769dcf87c801
Reviewed-on: https://chromium-review.googlesource.com/1353437


Commit-Ready: Curtis Malainey <cujomalainey@chromium.org>
Tested-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
Reviewed-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
parent be5ad67e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment