diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/mxs/mxs-saif.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index aba71bfa33b1..fdbb36aa9cf5 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
@@ -394,9 +394,14 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream, | |||
394 | struct snd_soc_dai *cpu_dai) | 394 | struct snd_soc_dai *cpu_dai) |
395 | { | 395 | { |
396 | struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); | 396 | struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); |
397 | struct mxs_saif *master_saif; | ||
397 | u32 scr, stat; | 398 | u32 scr, stat; |
398 | int ret; | 399 | int ret; |
399 | 400 | ||
401 | master_saif = mxs_saif_get_master(saif); | ||
402 | if (!master_saif) | ||
403 | return -EINVAL; | ||
404 | |||
400 | /* mclk should already be set */ | 405 | /* mclk should already be set */ |
401 | if (!saif->mclk && saif->mclk_in_use) { | 406 | if (!saif->mclk && saif->mclk_in_use) { |
402 | dev_err(cpu_dai->dev, "set mclk first\n"); | 407 | dev_err(cpu_dai->dev, "set mclk first\n"); |
@@ -420,6 +425,11 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream, | |||
420 | return ret; | 425 | return ret; |
421 | } | 426 | } |
422 | 427 | ||
428 | /* prepare clk in hw_param, enable in trigger */ | ||
429 | clk_prepare(saif->clk); | ||
430 | if (saif != master_saif) | ||
431 | clk_prepare(master_saif->clk); | ||
432 | |||
423 | scr = __raw_readl(saif->base + SAIF_CTRL); | 433 | scr = __raw_readl(saif->base + SAIF_CTRL); |
424 | 434 | ||
425 | scr &= ~BM_SAIF_CTRL_WORD_LENGTH; | 435 | scr &= ~BM_SAIF_CTRL_WORD_LENGTH; |