aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mxs/mxs-saif.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mxs/mxs-saif.c')
-rw-r--r--sound/soc/mxs/mxs-saif.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index dccfb37a9626..f204dbac11d4 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -124,6 +124,8 @@ static int mxs_saif_set_clk(struct mxs_saif *saif,
124 * 124 *
125 * If MCLK is not used, we just set saif clk to 512*fs. 125 * If MCLK is not used, we just set saif clk to 512*fs.
126 */ 126 */
127 clk_prepare_enable(master_saif->clk);
128
127 if (master_saif->mclk_in_use) { 129 if (master_saif->mclk_in_use) {
128 if (mclk % 32 == 0) { 130 if (mclk % 32 == 0) {
129 scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; 131 scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE;
@@ -133,6 +135,7 @@ static int mxs_saif_set_clk(struct mxs_saif *saif,
133 ret = clk_set_rate(master_saif->clk, 384 * rate); 135 ret = clk_set_rate(master_saif->clk, 384 * rate);
134 } else { 136 } else {
135 /* SAIF MCLK should be either 32x or 48x */ 137 /* SAIF MCLK should be either 32x or 48x */
138 clk_disable_unprepare(master_saif->clk);
136 return -EINVAL; 139 return -EINVAL;
137 } 140 }
138 } else { 141 } else {
@@ -140,6 +143,8 @@ static int mxs_saif_set_clk(struct mxs_saif *saif,
140 scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE; 143 scr &= ~BM_SAIF_CTRL_BITCLK_BASE_RATE;
141 } 144 }
142 145
146 clk_disable_unprepare(master_saif->clk);
147
143 if (ret) 148 if (ret)
144 return ret; 149 return ret;
145 150