]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/davinci/davinci-mcasp.c
Merge branch 'fix/davinci' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[karo-tx-linux.git] / sound / soc / davinci / davinci-mcasp.c
index e460f97c514e3d5b85f2b2ad3c7203d019ec68a1..0dab382ba147894b9d059dc6232a29e8b6c38e55 100644 (file)
@@ -582,8 +582,17 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
         * both left and right channels), so it has to be divided by number of
         * tdm-slots (for I2S - divided by 2).
         */
-       if (mcasp->bclk_lrclk_ratio)
-               word_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
+       if (mcasp->bclk_lrclk_ratio) {
+               u32 slot_length = mcasp->bclk_lrclk_ratio / mcasp->tdm_slots;
+
+               /*
+                * When we have more bclk then it is needed for the data, we
+                * need to use the rotation to move the received samples to have
+                * correct alignment.
+                */
+               rx_rotate = (slot_length - word_length) / 4;
+               word_length = slot_length;
+       }
 
        /* mapping of the XSSZ bit-field as described in the datasheet */
        fmt = (word_length >> 1) - 1;
@@ -1125,6 +1134,7 @@ static struct snd_soc_dai_driver davinci_mcasp_dai[] = {
                },
                .ops            = &davinci_mcasp_dai_ops,
 
+               .symmetric_samplebits   = 1,
        },
        {
                .name           = "davinci-mcasp.1",
@@ -1391,6 +1401,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
        ret = pm_runtime_get_sync(&pdev->dev);
        if (IS_ERR_VALUE(ret)) {
                dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
+               pm_runtime_disable(&pdev->dev);
                return ret;
        }