From: Viorel Suman Date: Thu, 18 Apr 2019 12:14:17 +0000 (+0300) Subject: MLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent X-Git-Tag: rel_imx_4.19.35_1.1.0~700 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=b17f0cc8f0676783d2e74c2521c01d5e89443de3;p=linux.git MLK-21484-1: ASoC: fsl_micfil: unprepare the clk before reparent On recent kernels clks which are marked with CLK_SET_RATE_GATE are "protected" against further changes at clk_prepare time, including clk reparent. Fix this by moving clk_disable_unprepare before clk_set_parent. Signed-off-by: Viorel Suman --- diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 591aefc2a38e..4e8fd7237754 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -1414,6 +1414,7 @@ static int fsl_micfil_set_mclk_rate(struct fsl_micfil *micfil, int clk_id, return -EINVAL; } + clk_disable_unprepare(micfil->mclk); if (!clk_is_match(pll, npll)) { ret = clk_set_parent(p, npll); if (ret < 0) @@ -1421,7 +1422,6 @@ static int fsl_micfil_set_mclk_rate(struct fsl_micfil *micfil, int clk_id, "failed to set parrent %d\n", ret); } - clk_disable_unprepare(micfil->mclk); ret = clk_set_rate(micfil->mclk, freq * 1024); if (ret) dev_warn(dev, "failed to set rate (%u): %d\n",