aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/fsl/fsl_esai.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index a645e296199e..ca319d59f843 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -513,10 +513,15 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
513 u32 width = snd_pcm_format_width(params_format(params)); 513 u32 width = snd_pcm_format_width(params_format(params));
514 u32 channels = params_channels(params); 514 u32 channels = params_channels(params);
515 u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); 515 u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
516 u32 slot_width = width;
516 u32 bclk, mask, val; 517 u32 bclk, mask, val;
517 int ret; 518 int ret;
518 519
519 bclk = params_rate(params) * esai_priv->slot_width * esai_priv->slots; 520 /* Override slot_width if being specifially set */
521 if (esai_priv->slot_width)
522 slot_width = esai_priv->slot_width;
523
524 bclk = params_rate(params) * slot_width * esai_priv->slots;
520 525
521 ret = fsl_esai_set_bclk(dai, tx, bclk); 526 ret = fsl_esai_set_bclk(dai, tx, bclk);
522 if (ret) 527 if (ret)
@@ -538,7 +543,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
538 regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx), mask, val); 543 regmap_update_bits(esai_priv->regmap, REG_ESAI_xFCR(tx), mask, val);
539 544
540 mask = ESAI_xCR_xSWS_MASK | (tx ? ESAI_xCR_PADC : 0); 545 mask = ESAI_xCR_xSWS_MASK | (tx ? ESAI_xCR_PADC : 0);
541 val = ESAI_xCR_xSWS(esai_priv->slot_width, width) | (tx ? ESAI_xCR_PADC : 0); 546 val = ESAI_xCR_xSWS(slot_width, width) | (tx ? ESAI_xCR_PADC : 0);
542 547
543 regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx), mask, val); 548 regmap_update_bits(esai_priv->regmap, REG_ESAI_xCR(tx), mask, val);
544 549
@@ -780,9 +785,6 @@ static int fsl_esai_probe(struct platform_device *pdev)
780 return ret; 785 return ret;
781 } 786 }
782 787
783 /* Set a default slot size */
784 esai_priv->slot_width = 32;
785
786 /* Set a default slot number */ 788 /* Set a default slot number */
787 esai_priv->slots = 2; 789 esai_priv->slots = 2;
788 790