From: Mark Brown Date: Fri, 31 Jan 2014 16:38:20 +0000 (+0000) Subject: Merge branch 'fix/davinci' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie... X-Git-Tag: firefly_0821_release~176^2~4090^2~1^2~3^2~4^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61d384aed4e8fbfafe3909a706935a03223c1254;p=firefly-linux-kernel-4.4.55.git Merge branch 'fix/davinci' of git://git./linux/kernel/git/broonie/sound into HEAD --- 61d384aed4e8fbfafe3909a706935a03223c1254 diff --cc sound/soc/davinci/davinci-mcasp.c index ae328beb676a,670afa29e30d..f662ef22b8ae --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@@ -613,20 -604,9 +612,21 @@@ static int davinci_mcasp_hw_params(stru u8 slots = mcasp->tdm_slots; u8 active_serializers; int channels; + int ret; struct snd_interval *pcm_channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + + /* If mcasp is BCLK master we need to set BCLK divider */ + if (mcasp->bclk_master) { + unsigned int bclk_freq = snd_soc_params_to_bclk(params); + if (mcasp->sysclk_freq % bclk_freq != 0) { + dev_err(mcasp->dev, "Can't produce requred BCLK\n"); + return -EINVAL; + } + davinci_mcasp_set_clkdiv( + cpu_dai, 1, mcasp->sysclk_freq / bclk_freq); + } + channels = pcm_channels->min; active_serializers = (channels + slots - 1) / slots;